]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Ecc: Fix an issue of path separator compatibility
authorBob Feng <bob.c.feng@intel.com>
Tue, 1 Sep 2020 10:23:15 +0000 (18:23 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 1 Sep 2020 17:55:56 +0000 (17:55 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2904

The path separator is different in Windows and Linux, the
original code does not handle this difference. This patch
is to fix this issue.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Message-Id: <20200901102315.38840-1-bob.c.feng@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
BaseTools/Source/Python/Ecc/Check.py

index 0fdc7e35c18a17671d251e4bf55c0db5b02cff65..6087abfa4d8d61756270cc8cd52e7456d6a7e73b 100644 (file)
@@ -1103,11 +1103,11 @@ class Check(object):
                     InfPathList.append(Item[0])\r
             SqlCommand = """\r
                          select ID, Path, FullPath from File where upper(FullPath) not in\r
-                            (select upper(A.Path) || '\\' || upper(B.Value1) from File as A, INF as B\r
+                            (select upper(A.Path) || '%s' || upper(B.Value1) from File as A, INF as B\r
                             where A.ID in (select BelongsToFile from INF where Model = %s group by BelongsToFile) and\r
                             B.BelongsToFile = A.ID and B.Model = %s)\r
                             and (Model = %s or Model = %s)\r
-                        """ % (MODEL_EFI_SOURCE_FILE, MODEL_EFI_SOURCE_FILE, MODEL_FILE_C, MODEL_FILE_H)\r
+                        """ % (os.sep, MODEL_EFI_SOURCE_FILE, MODEL_EFI_SOURCE_FILE, MODEL_FILE_C, MODEL_FILE_H)\r
             RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)\r
             for Record in RecordSet:\r
                 Path = Record[1]\r
@@ -1132,9 +1132,9 @@ class Check(object):
                 BelongsToFile = Pcd[4]\r
                 SqlCommand = """\r
                              select ID from File where FullPath in\r
-                            (select B.Path || '\\' || A.Value1 from INF as A, File as B where A.Model = %s and A.BelongsToFile = %s\r
+                            (select B.Path || '%s' || A.Value1 from INF as A, File as B where A.Model = %s and A.BelongsToFile = %s\r
                              and B.ID = %s and (B.Model = %s or B.Model = %s))\r
-                             """ % (MODEL_EFI_SOURCE_FILE, BelongsToFile, BelongsToFile, MODEL_FILE_C, MODEL_FILE_H)\r
+                             """ % (os.sep, MODEL_EFI_SOURCE_FILE, BelongsToFile, BelongsToFile, MODEL_FILE_C, MODEL_FILE_H)\r
                 TableSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
                 for Tbl in TableSet:\r
                     TblName = 'Identifier' + str(Tbl[0])\r