-# 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
-# distribution. The full text of the license may be found at \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
+# distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WorkspaceDir = GlobalData.gWORKSPACE\r
Dep = DependencyRules(DataBase)\r
DistPkg, ContentZipFile, DpPkgFileName, DistFile = UnZipDp(WorkspaceDir, Options.PackFileToReplace)\r
WorkspaceDir = GlobalData.gWORKSPACE\r
Dep = DependencyRules(DataBase)\r
DistPkg, ContentZipFile, DpPkgFileName, DistFile = UnZipDp(WorkspaceDir, Options.PackFileToReplace)\r
StoredDistFile, OrigDpGuid, OrigDpVersion = GetInstalledDpInfo(Options.PackFileToBeReplaced, \\r
Dep, DataBase, WorkspaceDir)\r
StoredDistFile, OrigDpGuid, OrigDpVersion = GetInstalledDpInfo(Options.PackFileToBeReplaced, \\r
Dep, DataBase, WorkspaceDir)\r
#\r
# check dependency\r
#\r
CheckReplaceDpx(Dep, DistPkg, OrigDpGuid, OrigDpVersion)\r
#\r
# check dependency\r
#\r
CheckReplaceDpx(Dep, DistPkg, OrigDpGuid, OrigDpVersion)\r
#\r
# Remove the old distribution\r
#\r
RemoveDist(OrigDpGuid, OrigDpVersion, StoredDistFile, DataBase, WorkspaceDir, Options.Yes)\r
#\r
# Remove the old distribution\r
#\r
RemoveDist(OrigDpGuid, OrigDpVersion, StoredDistFile, DataBase, WorkspaceDir, Options.Yes)\r
#\r
# Install the new distribution\r
#\r
InstallDp(DistPkg, DpPkgFileName, ContentZipFile, Options, Dep, WorkspaceDir, DataBase)\r
ReturnCode = 0\r
#\r
# Install the new distribution\r
#\r
InstallDp(DistPkg, DpPkgFileName, ContentZipFile, Options, Dep, WorkspaceDir, DataBase)\r
ReturnCode = 0\r
ReturnCode = XExcept.args[0]\r
if Logger.GetLevel() <= Logger.DEBUG_9:\r
Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),\r
ReturnCode = XExcept.args[0]\r
if Logger.GetLevel() <= Logger.DEBUG_9:\r
Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),\r
- if GlobalData.gUNPACK_DIR:\r
- rmtree(GlobalData.gUNPACK_DIR)\r
- GlobalData.gUNPACK_DIR = None\r
- Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_DONE) \r
+ for TempDir in GlobalData.gUNPACK_DIR:\r
+ rmtree(TempDir)\r
+ GlobalData.gUNPACK_DIR = []\r
+ Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_DONE)\r
return ReturnCode\r
\r
def CheckReplaceDpx(Dep, DistPkg, OrigDpGuid, OrigDpVersion):\r
return ReturnCode\r
\r
def CheckReplaceDpx(Dep, DistPkg, OrigDpGuid, OrigDpVersion):\r
if Dep.CheckDpExists(DistPkg.Header.GetGuid(), DistPkg.Header.GetVersion()):\r
Logger.Error("\nReplacePkg", UPT_ALREADY_INSTALLED_ERROR,\r
ST.WRN_DIST_PKG_INSTALLED,\r
if Dep.CheckDpExists(DistPkg.Header.GetGuid(), DistPkg.Header.GetVersion()):\r
Logger.Error("\nReplacePkg", UPT_ALREADY_INSTALLED_ERROR,\r
ST.WRN_DIST_PKG_INSTALLED,\r
Logger.Verbose(ST.MSG_CHECK_DP_FOR_REPLACE%(NewDpInfo, OrigDpInfo))\r
DepInfoResult = Dep.CheckDpDepexForReplace(OrigDpGuid, OrigDpVersion, NewDpPkgList)\r
Replaceable = DepInfoResult[0]\r
if not Replaceable:\r
Logger.Error("\nReplacePkg", UNKNOWN_ERROR,\r
ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY)\r
Logger.Verbose(ST.MSG_CHECK_DP_FOR_REPLACE%(NewDpInfo, OrigDpInfo))\r
DepInfoResult = Dep.CheckDpDepexForReplace(OrigDpGuid, OrigDpVersion, NewDpPkgList)\r
Replaceable = DepInfoResult[0]\r
if not Replaceable:\r
Logger.Error("\nReplacePkg", UNKNOWN_ERROR,\r
ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY)\r