summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Ecc/Check.py
diff options
context:
space:
mode:
authorLi YangX <yangx.li@intel.com>2015-10-08 09:28:51 +0000
committerlgao4 <lgao4@Edk2>2015-10-08 09:28:51 +0000
commitc4f52e128fef070954e34e91fb4e9c458d9fc1e7 (patch)
tree09acbb4ec633d3eb98aa4de8c39256cb643f2336 /BaseTools/Source/Python/Ecc/Check.py
parentfb0f8067ea4bfe21b8bc3bd2b2617f5b3d8d87aa (diff)
downloadedk2-platforms-c4f52e128fef070954e34e91fb4e9c458d9fc1e7.tar.xz
BaseTools: Update ECC tool to support multiple workspaces
Update ECC to refer MultipleWorkspace class to convert the file path from WORKSPACE and PACKAGES_PATH. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Li YangX <yangx.li@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18581 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Ecc/Check.py')
-rw-r--r--BaseTools/Source/Python/Ecc/Check.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python/Ecc/Check.py
index c2be1b01d3..5e5c8e72e4 100644
--- a/BaseTools/Source/Python/Ecc/Check.py
+++ b/BaseTools/Source/Python/Ecc/Check.py
@@ -19,6 +19,7 @@ from MetaDataParser import ParseHeaderCommentSection
import EccGlobalData
import c
from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
## Check
#
@@ -380,9 +381,7 @@ class Check(object):
for Key in RecordDict:
if len(RecordDict[Key]) > 1:
for Item in RecordDict[Key]:
- Path = Item[1].replace(EccGlobalData.gWorkspace, '')
- if Path.startswith('\\') or Path.startswith('/'):
- Path = Path[1:]
+ Path = mws.relpath(Item[1], EccGlobalData.gWorkspace)
if not EccGlobalData.gException.IsException(ERROR_INCLUDE_FILE_CHECK_NAME, Path):
EccGlobalData.gDb.TblReport.Insert(ERROR_INCLUDE_FILE_CHECK_NAME, OtherMsg="The file name for [%s] is duplicate" % Path, BelongsToTable='File', BelongsToItem=Item[0])
@@ -653,7 +652,7 @@ class Check(object):
if LibraryClass[1].upper() == 'NULL' or LibraryClass[1].startswith('!ifdef') or LibraryClass[1].startswith('!ifndef') or LibraryClass[1].endswith('!endif'):
continue
else:
- LibraryIns = os.path.normpath(os.path.join(EccGlobalData.gWorkspace, LibraryClass[2]))
+ LibraryIns = os.path.normpath(mws.join(EccGlobalData.gWorkspace, LibraryClass[2]))
SqlCommand = """select Value3 from Inf where BelongsToFile =
(select ID from File where lower(FullPath) = lower('%s'))
and Value2 = '%s'""" % (LibraryIns, 'LIBRARY_CLASS')
@@ -729,7 +728,7 @@ class Check(object):
for Record in RecordSet:
FdfID = Record[0]
FilePath = Record[1]
- FilePath = os.path.normpath(os.path.join(EccGlobalData.gWorkspace, FilePath))
+ FilePath = os.path.normpath(mws.join(EccGlobalData.gWorkspace, FilePath))
SqlCommand = """select ID from Inf where Model = %s and BelongsToFile = (select ID from File where FullPath like '%s')
""" % (MODEL_EFI_SOURCE_FILE, FilePath)
NewRecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
@@ -913,9 +912,7 @@ class Check(object):
RecordSet = Table.Exec(SqlCommand)
Path = ""
for Record in RecordSet:
- Path = Record[0].replace(EccGlobalData.gWorkspace, '')
- if Path.startswith('\\') or Path.startswith('/'):
- Path = Path[1:]
+ Path = mws.relpath(Record[0], EccGlobalData.gWorkspace)
return Path
# Check whether two module INFs under one workspace has the same FILE_GUID value