diff options
author | Liming Gao <liming.gao@intel.com> | 2017-12-19 16:01:38 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-25 11:05:53 +0800 |
commit | a09395932d997d41f59ae3ee2f7f77f91f5caa02 (patch) | |
tree | 582c325c0ddcbbd70d5300a3c833c07538317462 /BaseTools/Source/Python/Workspace/DscBuildData.py | |
parent | 520365decb26e5176ec2bb614f11ddeaa495de54 (diff) | |
download | edk2-a09395932d997d41f59ae3ee2f7f77f91f5caa02.tar.gz edk2-a09395932d997d41f59ae3ee2f7f77f91f5caa02.tar.bz2 edk2-a09395932d997d41f59ae3ee2f7f77f91f5caa02.zip |
BaseTools: Support nest field name in DSC/DEC
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>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/DscBuildData.py')
-rw-r--r-- | BaseTools/Source/Python/Workspace/DscBuildData.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 23c2c0d410..4642e761b9 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1207,18 +1207,19 @@ class DscBuildData(PlatformBuildClassObject): def get_length(value):
Value = value.strip()
- if Value.startswith('GUID') and Value.endswith(')'):
- return 16
- if Value.startswith('L"') and Value.endswith('"'):
- return len(Value[2:-1])
- if Value[0] == '"' and Value[-1] == '"':
- return len(Value) - 2
- if Value[0] == '{' and Value[-1] == '}':
- return len(Value.split(","))
- if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1:
- return len(list(Value[2:-1]))
- if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1:
- return len(Value) - 2
+ if len(value) > 1:
+ if Value.startswith('GUID') and Value.endswith(')'):
+ return 16
+ if Value.startswith('L"') and Value.endswith('"'):
+ return len(Value[2:-1])
+ if Value[0] == '"' and Value[-1] == '"':
+ return len(Value) - 2
+ if Value[0] == '{' and Value[-1] == '}':
+ return len(Value.split(","))
+ if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1:
+ return len(list(Value[2:-1]))
+ if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1:
+ return len(Value) - 2
return len(Value)
return str(max([pcd_size for pcd_size in [get_length(item) for item in sku_values]]))
|