]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Support DSC and FDF file out of WORKSPACE by GenFds.
authorYingke Liu <yingke.d.liu@intel.com>
Tue, 16 Sep 2014 08:33:40 +0000 (08:33 +0000)
committeryingke <yingke@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Sep 2014 08:33:40 +0000 (08:33 +0000)
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

BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/GenFds/GenFds.py

index 01297cd0a916f0e50fad79fc405150c38c0cf916..19a1319639a54326364ea47f29888eaa908e4436 100644 (file)
@@ -526,6 +526,7 @@ def RealPath(File, Dir='', OverrideDir=''):
     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
@@ -535,8 +536,10 @@ def RealPath2(File, Dir='', OverrideDir=''):
                 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
index c4e433d42530d979594c1852ff2ce2074aa010bc..c2ad4e0e2a7c7f0c766741a090bb70ecd9ca935c 100644 (file)
@@ -105,8 +105,6 @@ def main():
                 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
@@ -136,10 +134,8 @@ def main():
             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