mirror of https://github.com/acidanthera/audk.git
Support DSC and FDF file out of WORKSPACE by GenFds.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16113 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
122d9317cf
commit
9b9500a1c9
|
@ -526,6 +526,7 @@ def RealPath(File, Dir='', OverrideDir=''):
|
||||||
return NewFile
|
return NewFile
|
||||||
|
|
||||||
def RealPath2(File, Dir='', OverrideDir=''):
|
def RealPath2(File, Dir='', OverrideDir=''):
|
||||||
|
NewFile = None
|
||||||
if OverrideDir:
|
if OverrideDir:
|
||||||
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
|
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
|
||||||
if NewFile:
|
if NewFile:
|
||||||
|
@ -535,8 +536,10 @@ def RealPath2(File, Dir='', OverrideDir=''):
|
||||||
return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)]
|
return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)]
|
||||||
if GlobalData.gAllFiles:
|
if GlobalData.gAllFiles:
|
||||||
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(Dir, File))]
|
NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(Dir, File))]
|
||||||
else:
|
if not NewFile:
|
||||||
NewFile = os.path.normpath(os.path.join(Dir, File))
|
NewFile = os.path.normpath(os.path.join(Dir, File))
|
||||||
|
if not os.path.exists(NewFile):
|
||||||
|
return None, None
|
||||||
if NewFile:
|
if NewFile:
|
||||||
if Dir:
|
if Dir:
|
||||||
if Dir[-1] == os.path.sep:
|
if Dir[-1] == os.path.sep:
|
||||||
|
|
|
@ -105,8 +105,6 @@ def main():
|
||||||
FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
|
FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
|
||||||
if not os.path.exists(FdfFilename):
|
if not os.path.exists(FdfFilename):
|
||||||
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=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.FdfFile = FdfFilename
|
||||||
GenFdsGlobalVariable.FdfFileTimeStamp = os.path.getmtime(FdfFilename)
|
GenFdsGlobalVariable.FdfFileTimeStamp = os.path.getmtime(FdfFilename)
|
||||||
|
@ -136,10 +134,8 @@ def main():
|
||||||
if not os.path.exists(ActivePlatform) :
|
if not os.path.exists(ActivePlatform) :
|
||||||
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
|
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
|
||||||
|
|
||||||
if os.path.normcase (ActivePlatform).find(Workspace) != 0:
|
if os.path.normcase (ActivePlatform).find(Workspace) == 0:
|
||||||
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist in Workspace!")
|
ActivePlatform = ActivePlatform[len(Workspace):]
|
||||||
|
|
||||||
ActivePlatform = ActivePlatform[len(Workspace):]
|
|
||||||
if len(ActivePlatform) > 0 :
|
if len(ActivePlatform) > 0 :
|
||||||
if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':
|
if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':
|
||||||
ActivePlatform = ActivePlatform[1:]
|
ActivePlatform = ActivePlatform[1:]
|
||||||
|
|
Loading…
Reference in New Issue