## @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
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 Common.MultipleWorkspace import MultipleWorkspace as mws\r
\r
## CheckForExistingDp\r
#\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
- CheckEnvVariable()\r
WorkspaceDir = GlobalData.gWORKSPACE\r
\r
#\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
DistPkg.Header.RePackage = True\r
\r
Cwd = getcwd()\r
- chdir(WorkspaceDir) \r
+ chdir(WorkspaceDir)\r
ContentFile.PackFiles(FileList)\r
chdir(Cwd)\r
\r
Logger.Quiet(ST.MSG_FINISH)\r
ReturnCode = 0\r
\r
- except FatalError, XExcept:\r
+ except FatalError as XExcept:\r
ReturnCode = XExcept.args[0] \r
if Logger.GetLevel() <= Logger.DEBUG_9:\r
Logger.Quiet(ST.MSG_PYTHON_ON % \\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