summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-11-30 15:57:00 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-12-02 11:04:08 +0800
commitc62f1874f4df469e620dd72a9d31b51d9d99be27 (patch)
tree8db81de8f6961ff2da3b76761f669cdedcb92902 /BaseTools
parent3e7e8571da891122c6821ebc428ce6dbd8a35ff3 (diff)
downloaddevice_linaro_bootloader_edk2-c62f1874f4df469e620dd72a9d31b51d9d99be27.tar.gz
device_linaro_bootloader_edk2-c62f1874f4df469e620dd72a9d31b51d9d99be27.tar.bz2
device_linaro_bootloader_edk2-c62f1874f4df469e620dd72a9d31b51d9d99be27.zip
BaseTools: Support QuotedString for PREBUILD/POSTBUILD in DSC file
If the prebuild/postbuild script statement start with double quotations, current tool report error, while DSC spec allow this usage. so update tool to support it. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceDatabase.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
index 46179a39e..e7bc87dc6 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
@@ -231,9 +231,21 @@ class DscBuildData(PlatformBuildClassObject):
EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=Record[-1],
ExtraData=ErrorInfo)
elif Name == TAB_DSC_PREBUILD:
- self._Prebuild = PathClass(NormPath(Record[2], self._Macros), GlobalData.gWorkspace)
+ PrebuildValue = Record[2]
+ if Record[2][0] == '"':
+ if Record[2][-1] != '"':
+ EdkLogger.error('build', FORMAT_INVALID, 'Missing double quotes in the end of %s statement.' % TAB_DSC_PREBUILD,
+ File=self.MetaFile, Line=Record[-1])
+ PrebuildValue = Record[2][1:-1]
+ self._Prebuild = PathClass(NormPath(PrebuildValue, self._Macros), GlobalData.gWorkspace)
elif Name == TAB_DSC_POSTBUILD:
- self._Postbuild = PathClass(NormPath(Record[2], self._Macros), GlobalData.gWorkspace)
+ PostbuildValue = Record[2]
+ if Record[2][0] == '"':
+ if Record[2][-1] != '"':
+ EdkLogger.error('build', FORMAT_INVALID, 'Missing double quotes in the end of %s statement.' % TAB_DSC_POSTBUILD,
+ File=self.MetaFile, Line=Record[-1])
+ PostbuildValue = Record[2][1:-1]
+ self._Postbuild = PathClass(NormPath(PostbuildValue, self._Macros), GlobalData.gWorkspace)
elif Name == TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES:
self._SupArchList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)
elif Name == TAB_DSC_DEFINES_BUILD_TARGETS: