From 4465cd124fbcf5490faad6a1a834299b30b5d009 Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Fri, 10 Jan 2020 16:29:45 +0800 Subject: BaseTools:Fix GenFds issue for BuildOption replace GenFdsOption BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2455 BuildOption is used by TargetTxtClassObj.py GenFdsOption is used by GenFds.py When the GenFds tool is used alone (e.g. python3 -m GenFds.GenFds -h) With the OptionParser function, the first detected function prints the help message import TargetTxtClassObj to GenFds, The BuildOption will be executed and replace GenFdsOption We removed all objects associated with this problem that were created directly during the import process (e.g. BuildOption, BuildTarget = MyOptionParser(), TargetTxt = TargetTxtDict()) The Patch is going to fix this issue Signed-off-by: Zhiju.Fan Cc: Liming Gao Cc: Bob Feng Reviewed-by: Bob Feng --- BaseTools/Source/Python/GenFds/GenFds.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/GenFds/GenFds.py') diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index d8bc28e4d0..d5511f4c40 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -20,7 +20,7 @@ from linecache import getlines from io import BytesIO import Common.LongFilePathOs as os -from Common.TargetTxtClassObject import TargetTxt +from Common.TargetTxtClassObject import TargetTxtDict from Common.DataType import * import Common.GlobalData as GlobalData from Common import EdkLogger @@ -210,6 +210,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None): BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt")) if os.path.isfile(BuildConfigurationFile) == True: # if no build target given in command line, get it from target.txt + TargetObj = TargetTxtDict() + TargetTxt = TargetObj.Target if not GenFdsGlobalVariable.TargetName: BuildTargetList = TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_TARGET] if len(BuildTargetList) != 1: -- cgit v1.2.3