summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BaseTools/Source/Python/Common/Misc.py5
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py8
2 files changed, 6 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 01297cd0a9..19a1319639 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -526,6 +526,7 @@ def RealPath(File, Dir='', OverrideDir=''):
return NewFile
def RealPath2(File, Dir='', OverrideDir=''):
+ NewFile = None
if OverrideDir:
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
if NewFile:
@@ -535,8 +536,10 @@ def RealPath2(File, Dir='', OverrideDir=''):
return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)]
if GlobalData.gAllFiles:
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(Dir, File))]
- else:
+ if not NewFile:
NewFile = os.path.normpath(os.path.join(Dir, File))
+ if not os.path.exists(NewFile):
+ return None, None
if NewFile:
if Dir:
if Dir[-1] == os.path.sep:
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index c4e433d425..c2ad4e0e2a 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -105,8 +105,6 @@ def main():
FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
if not os.path.exists(FdfFilename):
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=FdfFilename)
- if os.path.normcase (FdfFilename).find(Workspace) != 0:
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "FdfFile doesn't exist in Workspace!")
GenFdsGlobalVariable.FdfFile = FdfFilename
GenFdsGlobalVariable.FdfFileTimeStamp = os.path.getmtime(FdfFilename)
@@ -136,10 +134,8 @@ def main():
if not os.path.exists(ActivePlatform) :
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
- if os.path.normcase (ActivePlatform).find(Workspace) != 0:
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist in Workspace!")
-
- ActivePlatform = ActivePlatform[len(Workspace):]
+ if os.path.normcase (ActivePlatform).find(Workspace) == 0:
+ ActivePlatform = ActivePlatform[len(Workspace):]
if len(ActivePlatform) > 0 :
if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':
ActivePlatform = ActivePlatform[1:]