]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/MkPkg.py
BaseTools: skip updating temporary variable.
[mirror_edk2.git] / BaseTools / Source / Python / UPT / MkPkg.py
index b8b78e4515504c1492db461db0ba940fd9e6712a..ff9aa7fb117c8d5bc4fdb89cec478dc43311b060 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Install distribution package.\r
 #\r
 ## @file\r
 # Install distribution package.\r
 #\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -45,12 +45,12 @@ import Logger.Log as Logger
 from Xml.XmlParser import DistributionPackageXml\r
 from Xml.IniToXml import IniToXml\r
 \r
 from Xml.XmlParser import DistributionPackageXml\r
 from Xml.IniToXml import IniToXml\r
 \r
-from Library.Misc import CheckEnvVariable\r
 from Library import GlobalData\r
 from Library.ParserValidate import IsValidPath\r
 \r
 from Core.DistributionPackageClass import DistributionPackageClass\r
 from Core.PackageFile import PackageFile\r
 from Library import GlobalData\r
 from Library.ParserValidate import IsValidPath\r
 \r
 from Core.DistributionPackageClass import DistributionPackageClass\r
 from Core.PackageFile import PackageFile\r
+from Common.MultipleWorkspace import MultipleWorkspace as mws\r
 \r
 ## CheckForExistingDp\r
 #\r
 \r
 ## CheckForExistingDp\r
 #\r
@@ -73,12 +73,11 @@ def CheckForExistingDp(Path):
 #\r
 #\r
 def Main(Options = None):\r
 #\r
 #\r
 def Main(Options = None):\r
-    if Options == None:\r
+    if Options is None:\r
         Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FOUND)\r
     try:\r
         DataBase = GlobalData.gDB        \r
         ContentFileClosed = True\r
         Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FOUND)\r
     try:\r
         DataBase = GlobalData.gDB        \r
         ContentFileClosed = True\r
-        CheckEnvVariable()\r
         WorkspaceDir = GlobalData.gWORKSPACE\r
 \r
         #\r
         WorkspaceDir = GlobalData.gWORKSPACE\r
 \r
         #\r
@@ -138,7 +137,7 @@ def Main(Options = None):
                 # write().\r
                 #\r
                 FromFile = os.path.normpath(FileObject.GetURI()).encode('utf_8')\r
                 # write().\r
                 #\r
                 FromFile = os.path.normpath(FileObject.GetURI()).encode('utf_8')\r
-                FileFullPath = os.path.normpath(os.path.join(WorkspaceDir, FromFile))\r
+                FileFullPath = mws.join(WorkspaceDir, FromFile)\r
                 if FileFullPath in RePkgDict:\r
                     (DpGuid, DpVersion, DpName, Repackage) = RePkgDict[FileFullPath]\r
                     if not Repackage:\r
                 if FileFullPath in RePkgDict:\r
                     (DpGuid, DpVersion, DpName, Repackage) = RePkgDict[FileFullPath]\r
                     if not Repackage:\r
@@ -185,7 +184,7 @@ def Main(Options = None):
                     DistPkg.Header.RePackage = True\r
           \r
         Cwd = getcwd()\r
                     DistPkg.Header.RePackage = True\r
           \r
         Cwd = getcwd()\r
-        chdir(WorkspaceDir)        \r
+        chdir(WorkspaceDir)\r
         ContentFile.PackFiles(FileList)\r
         chdir(Cwd)\r
         \r
         ContentFile.PackFiles(FileList)\r
         chdir(Cwd)\r
         \r
@@ -266,7 +265,7 @@ def CheckFileList(QualifiedExt, FileList, ErrorStringExt, ErrorStringFullPath):
                          ErrorStringExt % Item)\r
         \r
         Item = os.path.normpath(Item)\r
                          ErrorStringExt % Item)\r
         \r
         Item = os.path.normpath(Item)\r
-        Path = os.path.normpath(os.path.join(WorkspaceDir, Item))\r
+        Path = mws.join(WorkspaceDir, Item)\r
         if not os.path.exists(Path):\r
             Logger.Error("\nMkPkg", FILE_NOT_FOUND, ST.ERR_NOT_FOUND % Item)\r
         elif Item == Path:\r
         if not os.path.exists(Path):\r
             Logger.Error("\nMkPkg", FILE_NOT_FOUND, ST.ERR_NOT_FOUND % Item)\r
         elif Item == Path:\r