Changed StrGather behavior to be more R8 like
[people/mcb30/basetools.git] / Source / Python / AutoGen / StrGather.py
index 828ab72..5eec28a 100644 (file)
@@ -385,7 +385,7 @@ def CreateCFile(BaseName, UniObjectClass):
 #\r
 # @retval FileList:    A list of all files found\r
 #\r
-def GetFileList(IncludeList, SkipList):\r
+def GetFileList(SourceFileList, IncludeList, SkipList):\r
     if IncludeList == None:\r
         EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "Include path for unicode file is not defined")\r
 \r
@@ -393,10 +393,10 @@ def GetFileList(IncludeList, SkipList):
     if SkipList == None:\r
         SkipList = []\r
 \r
-    for Dir in IncludeList:\r
-        if not os.path.exists(Dir):\r
-            continue\r
-        for File in os.listdir(Dir):\r
+    for File in SourceFileList:\r
+        for Dir in IncludeList:\r
+            if not os.path.exists(Dir):\r
+                continue\r
             File = os.path.join(Dir, os.path.normcase(File))\r
             #\r
             # Ignore Dir\r
@@ -409,11 +409,13 @@ def GetFileList(IncludeList, SkipList):
             IsSkip = False\r
             for Skip in SkipList:\r
                 if os.path.splitext(File)[1].upper() == Skip.upper():\r
+                    EdkLogger.verbose("Skipped %s for string token uses search" % File)\r
                     IsSkip = True\r
                     break\r
 \r
             if not IsSkip:\r
                 FileList.append(File)\r
+            break\r
 \r
     return FileList\r
 \r
@@ -449,7 +451,7 @@ def SearchString(UniObjectClass, FileList):
 # This function is used for UEFI2.1 spec\r
 # \r
 #\r
-def GetStringFiles(UniFilList, IncludeList, SkipList, BaseName):\r
+def GetStringFiles(UniFilList, SourceFileList, IncludeList, SkipList, BaseName):\r
     Status = True\r
     ErrorMessage = ''\r
 \r
@@ -458,7 +460,7 @@ def GetStringFiles(UniFilList, IncludeList, SkipList, BaseName):
     else:\r
         EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 'No unicode files given')\r
 \r
-    FileList = GetFileList(IncludeList, SkipList)\r
+    FileList = GetFileList(SourceFileList, IncludeList, SkipList)\r
 \r
     Uni = SearchString(Uni, FileList)\r
 \r