From fd171542e0aa89ac12a09d79608173f48019b14b Mon Sep 17 00:00:00 2001 From: vanjeff Date: Fri, 11 Sep 2009 03:14:43 +0000 Subject: Sync basetools' source and binary files with r1707 of the basetools project. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9257 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/Workspace/MetaFileParser.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py') diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index 294237daee..40eb82656d 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -16,6 +16,7 @@ # import os import time +import copy import Common.EdkLogger as EdkLogger from CommonDataClass.DataClass import * @@ -55,7 +56,7 @@ class MetaFileParser(object): self._FileType = FileType self.MetaFile = FilePath self._FileDir = os.path.dirname(self.MetaFile) - self._Macros = {} + self._Macros = copy.copy(Macros) # for recursive parsing self._Owner = Owner @@ -87,7 +88,9 @@ class MetaFileParser(object): ## Set parsing complete flag in both class and table def _Done(self): self._Finished = True - self._Table.SetEndFlag() + ## Do not set end flag when processing included files + if self._From == -1: + self._Table.SetEndFlag() ## Return the table containg parsed data # @@ -208,11 +211,14 @@ class MetaFileParser(object): if TokenList[0] == '': EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given", ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1) - if len(TokenList) == 1: - self._Macros[TokenList[0]] = '' - else: - # keep the macro definition for later use - self._Macros[TokenList[0]] = ReplaceMacro(TokenList[1], self._Macros, False) + + # Macros defined in the command line override ones defined in the meta-data file + if not TokenList[0] in self._Macros: + if len(TokenList) == 1: + self._Macros[TokenList[0]] = '' + else: + # keep the macro definition for later use + self._Macros[TokenList[0]] = ReplaceMacro(TokenList[1], self._Macros, False) return TokenList[0], self._Macros[TokenList[0]] -- cgit v1.2.3