BaseTools: Add more parameter checking for CopyFileOnChange()
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2193 The current CopyFileOnChange() method in Misc.py does not accept the input SrcFile parameter as a dir, but the method does not check the SrcFile is dir or not. This patch is to add more input parameter type checking and error message output for method CopyFileOnChange. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
@ -536,7 +536,8 @@ def CopyFileOnChange(SrcFile, Dst, FileLock=None):
|
|||||||
SrcFile = LongFilePath(SrcFile)
|
SrcFile = LongFilePath(SrcFile)
|
||||||
Dst = LongFilePath(Dst)
|
Dst = LongFilePath(Dst)
|
||||||
|
|
||||||
if not os.path.exists(SrcFile):
|
if os.path.isdir(SrcFile):
|
||||||
|
EdkLogger.error(None, FILE_COPY_FAILURE, ExtraData='CopyFileOnChange SrcFile is a dir, not a file: %s' % SrcFile)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if os.path.isdir(Dst):
|
if os.path.isdir(Dst):
|
||||||
|
Reference in New Issue
Block a user