[yum-git] 2 commits - yum-complete-transaction.py

Seth Vidal skvidal at linux.duke.edu
Thu Mar 6 19:22:59 UTC 2008


 yum-complete-transaction.py |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 9bb37873615dbf8d0cdeecaef0a886bf76093a89
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Mar 6 14:21:16 2008 -0500

    make sure the ts file exists before we unlink it.

diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py
index b6b49ea..c181226 100755
--- a/yum-complete-transaction.py
+++ b/yum-complete-transaction.py
@@ -118,8 +118,9 @@ class YumCompleteTransaction(YumUtilBase):
         # clean up the transactions 
         tsdone = '%s/transaction-done.%s' % (path, timestamp)
         tsall = '%s/transaction-all.%s' % (path, timestamp)        
-        os.unlink(tsdone)
-        os.unlink(tsall)
+        for f in [tsall, tsdone]:
+            if os.path.exists(f):
+                os.unlink(f)
 
     def main(self):
         # Add util commandline options to the yum-cli ones
commit 7fc9e9ee22a1038ce5dec3c843cab19ea2df3d8d
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Mar 6 14:17:45 2008 -0500

    if the transaction we're cleaning up fails or exited for ANY REASON do not remove
    the old transaction files so the user can do it again after they've fixed whatever broke

diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py
index c484769..b6b49ea 100755
--- a/yum-complete-transaction.py
+++ b/yum-complete-transaction.py
@@ -180,11 +180,14 @@ class YumCompleteTransaction(YumUtilBase):
             sys.exit()
             
         else:            
-            if self.doTransaction():
+            if self.doTransaction() == 0:
                 print "Cleaning up completed transaction file"            
                 self.clean_up_ts_files(timestamp, self.conf.persistdir)
                 sys.exit()
-             
+            else:
+                print "Not removing old transaction files"
+                sys.exit()
+                             
 
 
         



More information about the Yum-cvs-commits mailing list