InfBinaryObject.py revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
## @file
# This file is used to define class objects of INF file [Binaries] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# 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
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
'''
InfBinaryObject
'''
import os
from Library import GlobalData
class InfBianryItem():
self.SupArchList = []
def GetFileName(self):
def GetFeatureFlagExp(self):
return self.FeatureFlagExp
def GetHelpString(self):
return self.HelpString
def GetSupArchList(self):
return self.SupArchList
def GetVerTypeName(self):
return self.VerTypeName
def GetVerTypeName(self):
return self.UiTypeName
def GetCommonType(self):
return self.CommonType
def GetTagName(self):
##
#
#
#
class InfBinariesObject(InfSectionCommonDef):
#
# Macro defined in this section should be only used in this section.
#
## CheckVer
#
#
#
# Check Ver
#
InfBianryVerItemObj = None
#
# Should not less than 2 elements
#
return False
return False
#
# Create a Ver Object.
#
#
# Verify File exist or not
#
VerContent[1])))
#
#
else:
return False
if IsValidFileFlag:
#
# Add Target information
#
#
# Validate Feature Flag Express
#
strip())
if not FeatureFlagRtv[0]:
#
# 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
# [Binaries] section.
#
# NOTE: This check will not report error now.
#
for ItemArch in ItemSupArchList:
for VerItemObjArch in __SupArchList:
if ItemArch == VerItemObjArch:
#
# ST.ERR_INF_PARSER_ITEM_DUPLICATE
#
pass
#
# ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
#
pass
if InfBianryVerItemObj != None:
else:
BinariesList = []
## ParseCommonBinary
#
# ParseCommonBinary
#
#
# Check common binary definitions
# Type | FileName | Target | Family | TagName | FeatureFlagExp
#
for Item in CommonBinary:
InfBianryCommonItemObj = None
return False
return False
#
# Create a Common Object.
#
#
# Convert Binary type.
#
BinaryFileType = 'BIN'
if BinaryFileType == 'SUBTYPE_GUID':
BinaryFileType = 'FREEFORM'
#
# Verify File exist or not
#
ItemContent[1])))
#
#
else:
return False
if IsValidFileFlag:
#
# Add Target information
#
#
# Add Family information
#
#
# 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
# the UDP
#
#
# Add FeatureFlagExp
#
#
# Validate Feature Flag Express
#
if not FeatureFlagRtv[0]:
#
# 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
# [Binaries] section.
#
# NOTE: This check will not report error now.
#
# for Item in self.Binaries:
# if Item.GetFileName() == InfBianryCommonItemObj.GetFileName():
# ItemSupArchList = Item.GetSupArchList()
# for ItemArch in ItemSupArchList:
# for ComItemObjArch in __SupArchList:
# if ItemArch == ComItemObjArch:
# #
# # ST.ERR_INF_PARSER_ITEM_DUPLICATE
# #
# pass
#
# if ItemArch.upper() == 'COMMON' or ComItemObjArch.upper() == 'COMMON':
# #
# # ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
# #
# pass
if InfBianryCommonItemObj != None:
else:
BinariesList = []
__SupArchList = []
#
# Validate Arch
#
ArchItem = 'COMMON'
if UiInf != None:
#
# Check UI
#
InfBianryUiItemObj = None
#
# Should not less than 2 elements
#
return False
return False
#
# Create an Ui Object.
#
#
# Verify File exist or not
#
UiContent[1])))
#
#
else:
return False
if IsValidFileFlag:
#
# Add Target information
#
#
# Validate Feature Flag Express
#
if not FeatureFlagRtv[0]:
#
# 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
# [Binaries] section.
#
# NOTE: This check will not report error now.
#
# for Item in self.Binaries:
# if Item.GetFileName() == InfBianryUiItemObj.GetFileName():
# ItemSupArchList = Item.GetSupArchList()
# for ItemArch in ItemSupArchList:
# for UiItemObjArch in __SupArchList:
# if ItemArch == UiItemObjArch:
# #
# # ST.ERR_INF_PARSER_ITEM_DUPLICATE
# #
# pass
# if ItemArch.upper() == 'COMMON' or UiItemObjArch.upper() == 'COMMON':
# #
# # ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
# #
# pass
if InfBianryUiItemObj != None:
else:
BinariesList = []
return True