BaseTools/UPT: Fix a parser issue
Update the method to get PCD information and support empty section. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
parent
09e27ac559
commit
490433ab84
|
@ -568,8 +568,9 @@ def GenUserExtensions(ModuleObject):
|
||||||
if UserExtension.GetIdentifier() == 'Depex':
|
if UserExtension.GetIdentifier() == 'Depex':
|
||||||
continue
|
continue
|
||||||
Statement = UserExtension.GetStatement()
|
Statement = UserExtension.GetStatement()
|
||||||
if not Statement:
|
# Comment the code to support user extension without any statement just the section header in []
|
||||||
continue
|
# if not Statement:
|
||||||
|
# continue
|
||||||
ArchList = UserExtension.GetSupArchList()
|
ArchList = UserExtension.GetSupArchList()
|
||||||
for Index in xrange(0, len(ArchList)):
|
for Index in xrange(0, len(ArchList)):
|
||||||
ArchList[Index] = ConvertArchForInstall(ArchList[Index])
|
ArchList[Index] = ConvertArchForInstall(ArchList[Index])
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# This file contained the miscellaneous routines for GenMetaFile usage.
|
# This file contained the miscellaneous routines for GenMetaFile usage.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials are licensed and made available
|
# This program and the accompanying materials are licensed and made available
|
||||||
# under the terms and conditions of the BSD License which accompanies this
|
# under the terms and conditions of the BSD License which accompanies this
|
||||||
|
@ -108,33 +108,28 @@ def ObtainPcdName(Packages, TokenSpaceGuidValue, Token):
|
||||||
TokenSpaceGuidName = ''
|
TokenSpaceGuidName = ''
|
||||||
PcdCName = ''
|
PcdCName = ''
|
||||||
TokenSpaceGuidNameFound = False
|
TokenSpaceGuidNameFound = False
|
||||||
PcdCNameFound = False
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Get TokenSpaceGuidCName from Guids section
|
# Get TokenSpaceGuidCName from Guids section
|
||||||
#
|
#
|
||||||
for GuidKey in DecGuidsDict:
|
for GuidKey in DecGuidsDict:
|
||||||
GuidList = DecGuidsDict[GuidKey]
|
GuidList = DecGuidsDict[GuidKey]
|
||||||
if TokenSpaceGuidNameFound:
|
|
||||||
break
|
|
||||||
for GuidItem in GuidList:
|
for GuidItem in GuidList:
|
||||||
if TokenSpaceGuidValue.upper() == GuidItem.GuidString.upper():
|
if TokenSpaceGuidValue.upper() == GuidItem.GuidString.upper():
|
||||||
TokenSpaceGuidName = GuidItem.GuidCName
|
TokenSpaceGuidName = GuidItem.GuidCName
|
||||||
TokenSpaceGuidNameFound = True
|
TokenSpaceGuidNameFound = True
|
||||||
break
|
break
|
||||||
|
if TokenSpaceGuidNameFound:
|
||||||
|
break
|
||||||
#
|
#
|
||||||
# Retrieve PcdCName from Pcds Section
|
# Retrieve PcdCName from Pcds Section
|
||||||
#
|
#
|
||||||
for PcdKey in DecPcdsDict:
|
for PcdKey in DecPcdsDict:
|
||||||
PcdList = DecPcdsDict[PcdKey]
|
PcdList = DecPcdsDict[PcdKey]
|
||||||
if PcdCNameFound:
|
|
||||||
return TokenSpaceGuidName, PcdCName
|
|
||||||
for PcdItem in PcdList:
|
for PcdItem in PcdList:
|
||||||
if TokenSpaceGuidName == PcdItem.TokenSpaceGuidCName and Token == PcdItem.TokenValue:
|
if TokenSpaceGuidName == PcdItem.TokenSpaceGuidCName and Token == PcdItem.TokenValue:
|
||||||
PcdCName = PcdItem.TokenCName
|
PcdCName = PcdItem.TokenCName
|
||||||
PcdCNameFound = True
|
return TokenSpaceGuidName, PcdCName
|
||||||
break
|
|
||||||
|
|
||||||
return TokenSpaceGuidName, PcdCName
|
return TokenSpaceGuidName, PcdCName
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue