mirror_edk2/BaseTools/Source/Python
Chris Co 5895956dd9 BaseTools/Trim: Normalize filepaths to fix comparisons on Windows
When using Linaro GCC5+ arm-eabi toolchain on Windows, the generated
DSDT.iii contains a canonicalized ("\.\" removed and lower case)
filepath for the preprocessed DSDT.i file in the first line.
Trim.exe is called on DSDT.iii to generate DSDT.iiii, which does a
line for line comparison of filepaths encountered to the preprocessed
DSDT.i filepath found in the first line to determine what lines to
place in DSDT.iiii. Since the DSDT.i filepath is canonicalized and
all later filepaths in DSDT.iii are not canonicalized, all comparisons
fail and the result is in an empty DSDT.iiii.

Issue was first reported to Linaro here:
https://bugs.linaro.org/show_bug.cgi?id=2909
where the recommendation was to address the issue in Trim.exe.

This patch normalizes the case and pathname of all filepaths
encountered during Trim.exe execution on preprocessed files.  This
fixes comparisons of filepaths that contain mismatching case on
case-insensitive filesystems, redundant separators, and uplevel
references.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Christopher Co <christopher.co@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-07-04 10:42:32 +08:00
..
AutoGen BaseTools: AutoGen - move constructor out of loop 2018-06-29 15:39:28 +08:00
BPDG BaseTools: Replace StringIO.StringIO with io.BytesIO 2018-06-27 16:33:28 +08:00
build BaseTools: Replace StringIO.StringIO with io.BytesIO 2018-06-27 16:33:28 +08:00
Common BaseTools: Move variable out of Global 2018-06-28 08:46:49 +08:00
CommonDataClass BaseTools: CommonClass - remove unused classes 2018-04-26 14:44:36 +08:00
Ecc BaseTools: Fix old python2 idioms 2018-06-27 16:33:27 +08:00
Eot BaseTools: Fix old python2 idioms 2018-06-27 16:33:27 +08:00
GenFds BaseTools: Replace StringIO.StringIO with io.BytesIO 2018-06-27 16:33:28 +08:00
GenPatchPcdTable BaseTools: Adjust the spaces around commas and colons 2018-06-27 16:33:25 +08:00
PatchPcdValue BaseTools: replace 'UINT8','UINT16','UINT32','UINT64','VOID*' with shared constants. 2018-04-23 11:11:20 +08:00
Pkcs7Sign BaseTools: Adjust the spaces around commas and colons 2018-06-27 16:33:25 +08:00
Rsa2048Sha256Sign BaseTools: Adjust the spaces around commas and colons 2018-06-27 16:33:25 +08:00
Table BaseTools: Rename String to StringUtils. 2018-05-28 13:05:00 +08:00
TargetTool BaseTools: Fix old python2 idioms 2018-06-27 16:33:27 +08:00
Trim BaseTools/Trim: Normalize filepaths to fix comparisons on Windows 2018-07-04 10:42:32 +08:00
UPT BaseTools: Fix old python2 idioms 2018-06-27 16:33:27 +08:00
Workspace BaseTools: Fix two drivers include the same file issue 2018-06-29 15:21:45 +08:00
GNUmakefile Sync BaseTool trunk (version r2599) into EDKII BaseTools. 2013-08-23 02:18:16 +00:00
Makefile BaseTools: Rename String to StringUtils. 2018-05-28 13:05:00 +08:00
sitecustomize.py License header updated to match correct format. 2014-08-28 13:53:34 +00:00