summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/UPT
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2016-08-01 23:25:34 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-08-03 10:50:14 +0800
commit0e025deac50ec0fbcfc419afb47014ad1a8e10c5 (patch)
tree030fe5093956475930c264c86bbf693b2052e1fb /BaseTools/Source/Python/UPT
parent645a51287e9519eb4c6d27b4e4f11d0556a624e8 (diff)
downloadedk2-platforms-0e025deac50ec0fbcfc419afb47014ad1a8e10c5.tar.xz
BaseTool/UPT: Not expand macro for UserExtension
All MACRO values defined by the DEFINE statements n any section (except [Userextensions] sections other than TianoCore."ExtraFiles) of the INF or DEC file must be expanded before processing of the file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT')
-rw-r--r--BaseTools/Source/Python/UPT/Parser/DecParser.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/UPT/Parser/DecParser.py b/BaseTools/Source/Python/UPT/Parser/DecParser.py
index 5a2842a230..85b8a17fe4 100644
--- a/BaseTools/Source/Python/UPT/Parser/DecParser.py
+++ b/BaseTools/Source/Python/UPT/Parser/DecParser.py
@@ -270,7 +270,21 @@ class _DecBase:
self._LoggerError(ST.ERR_DECPARSE_BACKSLASH_EMPTY)
CatLine += Line
- self._RawData.CurrentLine = self._ReplaceMacro(CatLine)
+ #
+ # All MACRO values defined by the DEFINE statements in any section
+ # (except [Userextensions] sections for Intel) of the INF or DEC file
+ # must be expanded before processing of the file.
+ #
+ __IsReplaceMacro = True
+ Header = self._RawData.CurrentScope[0] if self._RawData.CurrentScope else None
+ if Header and len(Header) > 2:
+ if Header[0].upper() == 'USEREXTENSIONS' and not (Header[1] == 'TianoCore' and Header[2] == '"ExtraFiles"'):
+ __IsReplaceMacro = False
+ if __IsReplaceMacro:
+ self._RawData.CurrentLine = self._ReplaceMacro(CatLine)
+ else:
+ self._RawData.CurrentLine = CatLine
+
return CatLine, CommentList
## Parse