diff --git a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py index 6db13b06b6..bfe6dcc70f 100644 --- a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py +++ b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py @@ -212,7 +212,7 @@ class DistributionPackageClass(object): # for MiscFileObj in Package.GetMiscFileList(): for FileObj in MiscFileObj.GetFileList(): - MiscFileFullPath = os.path.normpath(os.path.join(os.path.dirname(FullPath), FileObj.GetURI())) + MiscFileFullPath = os.path.normpath(os.path.join(PackagePath, FileObj.GetURI())) if MiscFileFullPath not in self.FileList: self.FileList.append(MiscFileFullPath) diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py index 2a11204f7d..6980892874 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py @@ -705,7 +705,7 @@ def GenGuidSections(GuidObjList): else: Comment = '' if Usage != DT.ITEM_UNDEFINED and GuidType == DT.ITEM_UNDEFINED: - Comment = '## ' + Usage + ' ## GUID ' + Comment + Comment = '## ' + Usage + Comment elif GuidType == 'Variable': Comment = '## ' + Usage + ' ## ' + GuidType + ':' + VariableName + Comment else: @@ -1027,10 +1027,10 @@ def GenSpecialSections(ObjectList, SectionName): Content = '# ' + ('\n' + '# ').join(GetSplitValueList(SectionContent, '\n')) Content = Content.lstrip() # - # add two empty line after the generated section content to differentiate it between other possible sections + # add a return to differentiate it between other possible sections # if Content: - Content += '\n#\n#\n' + Content += '\n' return Content ## GenBuildOptions # diff --git a/BaseTools/Source/Python/UPT/Library/Parsing.py b/BaseTools/Source/Python/UPT/Library/Parsing.py index db0fec3a73..ace3e0d118 100644 --- a/BaseTools/Source/Python/UPT/Library/Parsing.py +++ b/BaseTools/Source/Python/UPT/Library/Parsing.py @@ -983,7 +983,7 @@ def GenSection(SectionName, SectionDict, SplitArch=True, NeedBlankLine=False): NewStatement = "" for Line in LineList: # ignore blank comment - if not Line.replace("#", '').strip() and SectionName != 'Defines': + if not Line.replace("#", '').strip() and SectionName not in ('Defines', 'Hob', 'Event', 'BootMode'): continue # add two space before non-comments line except the comments in Defines section if Line.strip().startswith('#') and SectionName == 'Defines':