return NewFile\r
\r
def RealPath2(File, Dir='', OverrideDir=''):\r
+ NewFile = None\r
if OverrideDir:\r
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]\r
if NewFile:\r
return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)]\r
if GlobalData.gAllFiles:\r
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(Dir, File))]\r
- else:\r
+ if not NewFile:\r
NewFile = os.path.normpath(os.path.join(Dir, File))\r
+ if not os.path.exists(NewFile):\r
+ return None, None\r
if NewFile:\r
if Dir:\r
if Dir[-1] == os.path.sep:\r
FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)\r
if not os.path.exists(FdfFilename):\r
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=FdfFilename)\r
- if os.path.normcase (FdfFilename).find(Workspace) != 0:\r
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "FdfFile doesn't exist in Workspace!")\r
\r
GenFdsGlobalVariable.FdfFile = FdfFilename\r
GenFdsGlobalVariable.FdfFileTimeStamp = os.path.getmtime(FdfFilename)\r
if not os.path.exists(ActivePlatform) :\r
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")\r
\r
- if os.path.normcase (ActivePlatform).find(Workspace) != 0:\r
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist in Workspace!")\r
-\r
- ActivePlatform = ActivePlatform[len(Workspace):]\r
+ if os.path.normcase (ActivePlatform).find(Workspace) == 0:\r
+ ActivePlatform = ActivePlatform[len(Workspace):]\r
if len(ActivePlatform) > 0 :\r
if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':\r
ActivePlatform = ActivePlatform[1:]\r