public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: BobCF <bob.c.feng@intel.com>
To: edk2-devel@lists.01.org
Subject: [Patch] BaseTools: Fix Sku inherit issue.
Date: Wed, 27 Dec 2017 14:03:34 +0800	[thread overview]
Message-ID: <20171227060335.1744-1-bob.c.feng@intel.com> (raw)

The final Pcd value should only be override by its parents.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/Common/Misc.py            | 2 ++
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 0374be0631..dc214dbfa8 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -2198,10 +2198,12 @@ class SkuClass():
             for item in self.SkuData.values():
                 self.__SkuInherit[item[1]]=item[2] if item[2] else "DEFAULT"
         return self.__SkuInherit.get(skuname,"DEFAULT")
 
     def GetSkuChain(self,sku):
+        if sku == "DEFAULT":
+            return ["DEFAULT"]
         skulist = [sku]
         nextsku = sku
         while 1:
             nextsku = self.GetNextSkuId(nextsku)
             skulist.append(nextsku)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 929c317957..5e052eca7c 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1319,11 +1319,11 @@ class DscBuildData(PlatformBuildClassObject):
                             FieldName = FieldName.split(']', 1)[1]
                         FieldName = NewFieldName + FieldName
                         while '[' in FieldName:
                             FieldName = FieldName.rsplit('[', 1)[0]
                             CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d);\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
-            for skuname in self.SkuIdMgr.SkuOverrideOrder():
+            for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
                 for FieldList in [inherit_OverrideValues.get(DefaultStoreName)]:
                     if not FieldList:
                         continue
                     for FieldName in FieldList:
@@ -1383,11 +1383,11 @@ class DscBuildData(PlatformBuildClassObject):
                     else:
                         if ValueSize > 4:
                             CApp = CApp + '  Pcd->%s = %dULL; // From %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0])
                         else:
                             CApp = CApp + '  Pcd->%s = %d; // From %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0])
-            for skuname in self.SkuIdMgr.SkuOverrideOrder():
+            for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
                 for FieldList in [Pcd.DefaultFromDSC,inherit_OverrideValues.get(DefaultStoreName)]:
                     if not FieldList:
                         continue
                     if Pcd.DefaultFromDSC and FieldList == Pcd.DefaultFromDSC:
-- 
2.14.3.windows.1



             reply	other threads:[~2017-12-27  5:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-27  6:03 BobCF [this message]
2017-12-27  6:03 ` [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList BobCF
2017-12-27  9:35   ` Gao, Liming
2018-01-08  3:33 ` [Patch] BaseTools: Fix Sku inherit issue Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171227060335.1744-1-bob.c.feng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox