For EDK module, if source over write path does exists, the source file will be got...
authorlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 10 Sep 2009 07:21:26 +0000 (07:21 +0000)
committerlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 10 Sep 2009 07:21:26 +0000 (07:21 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1703 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/Misc.py

index 14f6550..2c1041c 100755 (executable)
@@ -418,6 +418,14 @@ def RealPath(File, Dir='', OverrideDir=''):
     return NewFile
 
 def RealPath2(File, Dir='', OverrideDir=''):
+    if OverrideDir:
+        NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
+        if NewFile:
+            if OverrideDir[-1] == os.path.sep:
+                return NewFile[len(OverrideDir):], NewFile[0:len(OverrideDir)]
+            else:
+                return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)]
+
     NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(Dir, File))]
     if NewFile:
         if Dir:
@@ -428,10 +436,6 @@ def RealPath2(File, Dir='', OverrideDir=''):
         else:
             return NewFile, ''
 
-    if OverrideDir:
-        NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
-        if NewFile:
-            return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)]
     return None, None
 
 ## Check if gvien file exists or not