Revision: 17661
          http://sourceforge.net/p/edk2/code/17661
Author:   hchen30
Date:     2015-06-19 00:02:34 +0000 (Fri, 19 Jun 2015)
Log Message:
-----------
BaseTools/Upt: Update error message

Update error message of installation failure to avoid confusion.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <[email protected]>
Reviewed-by: lhauch <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/Python/UPT/InstallPkg.py
    trunk/edk2/BaseTools/Source/Python/UPT/Logger/StringTable.py
    trunk/edk2/BaseTools/Source/Python/UPT/UPT.py

Modified: trunk/edk2/BaseTools/Source/Python/UPT/InstallPkg.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/UPT/InstallPkg.py        2015-06-18 
10:30:38 UTC (rev 17660)
+++ trunk/edk2/BaseTools/Source/Python/UPT/InstallPkg.py        2015-06-19 
00:02:34 UTC (rev 17661)
@@ -1,7 +1,7 @@
 ## @file
 # Install distribution package.
 #
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
 #
 # This program and the accompanying materials are licensed and made available 
 # under the terms and conditions of the BSD License which accompanies this 
@@ -556,15 +556,16 @@
         Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),
             platform) + format_exc())
     finally:
-        Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_STARTED)
-        if DistFile:
-            DistFile.Close()
-        if ContentZipFile:
-            ContentZipFile.Close()
-        if GlobalData.gUNPACK_DIR:
-            rmtree(GlobalData.gUNPACK_DIR)
-            GlobalData.gUNPACK_DIR = None
-        Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_DONE)
+        if ReturnCode != UPT_ALREADY_INSTALLED_ERROR:
+            Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_STARTED)
+            if DistFile:
+                DistFile.Close()
+            if ContentZipFile:
+                ContentZipFile.Close()
+            if GlobalData.gUNPACK_DIR:
+                rmtree(GlobalData.gUNPACK_DIR)
+                GlobalData.gUNPACK_DIR = None
+            Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_DONE)
     if ReturnCode == 0:
         Logger.Quiet(ST.MSG_FINISH)
     return ReturnCode

Modified: trunk/edk2/BaseTools/Source/Python/UPT/Logger/StringTable.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/UPT/Logger/StringTable.py        
2015-06-18 10:30:38 UTC (rev 17660)
+++ trunk/edk2/BaseTools/Source/Python/UPT/Logger/StringTable.py        
2015-06-19 00:02:34 UTC (rev 17661)
@@ -1,7 +1,7 @@
 ## @file
 # This file is used to define strings used in the UPT tool
 #
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
 #
 # This program and the accompanying materials are licensed and made available 
 # under the terms and conditions of the BSD License which accompanies this 
@@ -781,7 +781,7 @@
 WRN_FILE_EXISTED          = _("This file already exists: %s")
 WRN_FILE_NOT_OVERWRITTEN  = \
 _("This file already exist and cannot be overwritten: %s")
-WRN_DIST_PKG_INSTALLED    = _("This distribution package has been installed")
+WRN_DIST_PKG_INSTALLED = _("This distribution package has previously been 
installed.")
 WRN_DIST_NOT_FOUND         = _(
     "Distribution is not found at location %s")
 WRN_MULTI_PCD_RANGES      = _(

Modified: trunk/edk2/BaseTools/Source/Python/UPT/UPT.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/UPT/UPT.py       2015-06-18 10:30:38 UTC 
(rev 17660)
+++ trunk/edk2/BaseTools/Source/Python/UPT/UPT.py       2015-06-19 00:02:34 UTC 
(rev 17661)
@@ -38,6 +38,7 @@
 from Logger.ToolError import FILE_TYPE_MISMATCH
 from Logger.ToolError import OPTION_CONFLICT
 from Logger.ToolError import FatalError
+from Logger.ToolError import UPT_ALREADY_INSTALLED_ERROR
 
 import MkPkg
 import InstallPkg
@@ -282,7 +283,7 @@
                          format_exc())
     finally:
         try:
-            if ReturnCode != 0:
+            if ReturnCode != 0 and ReturnCode != UPT_ALREADY_INSTALLED_ERROR:
                 Logger.Quiet(ST.MSG_RECOVER_START)
                 GlobalData.gDB.RollBack()
                 Mgr.rollback()


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to