X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FUPT%2FObject%2FParser%2FInfBinaryObject.py;h=af5af46ab21dbf272d89210b8b99f76b7957580b;hp=cc2fc49053261cc53d4bc482730a2e8faee98087;hb=f7496d717357b9af78414d19679b073403812340;hpb=39456d00f36e04b7e7efb208f350f4e83b6c3531 diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py index cc2fc49053..af5af46ab2 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py @@ -1,12 +1,12 @@ ## @file -# This file is used to define class objects of INF file [Binaries] section. -# It will consumed by InfParser. +# This file is used to define class objects of INF file [Binaries] section. +# It will consumed by InfParser. # -# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
# -# This program and the accompanying materials are licensed and made available -# under the terms and conditions of the BSD License which accompanies this -# distribution. The full text of the license may be found at +# This program and the accompanying materials are licensed and made available +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php # # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, @@ -117,7 +117,7 @@ class InfBianryCommonItem(InfBianryItem, CurrentLine): self.Family = Family def GetFamily(self): return self.Family - + def SetGuidValue(self, GuidValue): self.GuidValue = GuidValue def GetGuidValue(self): @@ -228,7 +228,7 @@ class InfBinariesObject(InfSectionCommonDef): Line=VerCurrentLine.GetLineNo(), ExtraData=VerCurrentLine.GetLineString()) # - # Validate Feature Flag Express + # Validate Feature Flag Express # FeatureFlagRtv = IsValidFeatureFlagExp(VerContent[3].\ strip()) @@ -246,15 +246,15 @@ class InfBinariesObject(InfSectionCommonDef): # # Determine binary file name duplicate. Follow below rule: # - # A binary filename must not be duplicated within - # a [Binaries] section. A binary filename may appear in - # multiple architectural [Binaries] sections. A binary - # filename listed in an architectural [Binaries] section - # must not be listed in the common architectural + # A binary filename must not be duplicated within + # a [Binaries] section. A binary filename may appear in + # multiple architectural [Binaries] sections. A binary + # filename listed in an architectural [Binaries] section + # must not be listed in the common architectural # [Binaries] section. - # + # # NOTE: This check will not report error now. - # + # for Item in self.Binaries: if Item.GetFileName() == InfBianryVerItemObj.GetFileName(): ItemSupArchList = Item.GetSupArchList() @@ -315,7 +315,7 @@ class InfBinariesObject(InfSectionCommonDef): Line=CurrentLineOfItem.GetLineNo(), ExtraData=CurrentLineOfItem.GetLineString()) return False - + if len(ItemContent) > 7: Logger.Error("InfParser", ToolError.FORMAT_INVALID, @@ -335,7 +335,7 @@ class InfBinariesObject(InfSectionCommonDef): BinaryFileType = ItemContent[0].strip() if BinaryFileType == 'RAW' or BinaryFileType == 'ACPI' or BinaryFileType == 'ASL': BinaryFileType = 'BIN' - + if BinaryFileType not in DT.BINARY_FILE_TYPE_LIST: Logger.Error("InfParser", ToolError.FORMAT_INVALID, @@ -344,10 +344,10 @@ class InfBinariesObject(InfSectionCommonDef): File=CurrentLineOfItem.GetFileName(), Line=CurrentLineOfItem.GetLineNo(), ExtraData=CurrentLineOfItem.GetLineString()) - + if BinaryFileType == 'SUBTYPE_GUID': BinaryFileType = 'FREEFORM' - + if BinaryFileType == 'LIB' or BinaryFileType == 'UEFI_APP': Logger.Error("InfParser", ToolError.FORMAT_INVALID, @@ -407,7 +407,7 @@ class InfBinariesObject(InfSectionCommonDef): # if BinaryFileType != 'FREEFORM': InfBianryCommonItemObj.SetTarget(ItemContent[2]) - + if len(ItemContent) >= 4: # # Add Family information @@ -416,13 +416,13 @@ class InfBinariesObject(InfSectionCommonDef): InfBianryCommonItemObj.SetFamily(ItemContent[3]) else: InfBianryCommonItemObj.SetTarget(ItemContent[3]) - + if len(ItemContent) >= 5: # - # TagName entries are build system specific. If there - # is content in the entry, the tool must exit + # TagName entries are build system specific. If there + # is content in the entry, the tool must exit # gracefully with an error message that indicates build - # system specific content cannot be distributed using + # system specific content cannot be distributed using # the UDP # if BinaryFileType != 'FREEFORM': @@ -435,7 +435,7 @@ class InfBinariesObject(InfSectionCommonDef): ExtraData=CurrentLineOfItem.GetLineString()) else: InfBianryCommonItemObj.SetFamily(ItemContent[4]) - + if len(ItemContent) >= 6: # # Add FeatureFlagExp @@ -449,7 +449,7 @@ class InfBinariesObject(InfSectionCommonDef): Line=CurrentLineOfItem.GetLineNo(), ExtraData=CurrentLineOfItem.GetLineString()) # - # Validate Feature Flag Express + # Validate Feature Flag Express # FeatureFlagRtv = IsValidFeatureFlagExp(ItemContent[5].strip()) if not FeatureFlagRtv[0]: @@ -468,7 +468,7 @@ class InfBinariesObject(InfSectionCommonDef): File=CurrentLineOfItem.GetFileName(), Line=CurrentLineOfItem.GetLineNo(), ExtraData=CurrentLineOfItem.GetLineString()) - + if len(ItemContent) == 7: if ItemContent[6].strip() == '': Logger.Error("InfParser", @@ -478,7 +478,7 @@ class InfBinariesObject(InfSectionCommonDef): Line=CurrentLineOfItem.GetLineNo(), ExtraData=CurrentLineOfItem.GetLineString()) # - # Validate Feature Flag Express + # Validate Feature Flag Express # FeatureFlagRtv = IsValidFeatureFlagExp(ItemContent[6].strip()) if not FeatureFlagRtv[0]: @@ -495,15 +495,15 @@ class InfBinariesObject(InfSectionCommonDef): # # Determine binary file name duplicate. Follow below rule: # - # A binary filename must not be duplicated within - # a [Binaries] section. A binary filename may appear in - # multiple architectural [Binaries] sections. A binary - # filename listed in an architectural [Binaries] section - # must not be listed in the common architectural + # A binary filename must not be duplicated within + # a [Binaries] section. A binary filename may appear in + # multiple architectural [Binaries] sections. A binary + # filename listed in an architectural [Binaries] section + # must not be listed in the common architectural # [Binaries] section. - # + # # NOTE: This check will not report error now. - # + # # for Item in self.Binaries: # if Item.GetFileName() == InfBianryCommonItemObj.GetFileName(): # ItemSupArchList = Item.GetSupArchList() @@ -537,7 +537,7 @@ class InfBinariesObject(InfSectionCommonDef): for ArchItem in ArchList: # # Validate Arch - # + # if (ArchItem == '' or ArchItem is None): ArchItem = 'COMMON' __SupArchList.append(ArchItem) @@ -546,7 +546,7 @@ class InfBinariesObject(InfSectionCommonDef): if len(UiInf) > 0: # # Check UI - # + # for UiItem in UiInf: IsValidFileFlag = False InfBianryUiItemObj = None @@ -630,7 +630,7 @@ class InfBinariesObject(InfSectionCommonDef): Line=UiCurrentLine.GetLineNo(), ExtraData=UiCurrentLine.GetLineString()) # - # Validate Feature Flag Express + # Validate Feature Flag Express # FeatureFlagRtv = IsValidFeatureFlagExp(UiContent[3].strip()) if not FeatureFlagRtv[0]: @@ -647,15 +647,15 @@ class InfBinariesObject(InfSectionCommonDef): # # Determine binary file name duplicate. Follow below rule: # - # A binary filename must not be duplicated within - # a [Binaries] section. A binary filename may appear in - # multiple architectural [Binaries] sections. A binary - # filename listed in an architectural [Binaries] section - # must not be listed in the common architectural + # A binary filename must not be duplicated within + # a [Binaries] section. A binary filename may appear in + # multiple architectural [Binaries] sections. A binary + # filename listed in an architectural [Binaries] section + # must not be listed in the common architectural # [Binaries] section. - # + # # NOTE: This check will not report error now. - # + # # for Item in self.Binaries: # if Item.GetFileName() == InfBianryUiItemObj.GetFileName(): # ItemSupArchList = Item.GetSupArchList()