[yum-git] yum/rpmtrans.py

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


 yum/rpmtrans.py |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 0ef13fbaf250ebebbe67cafc6d395bc8adbd4c37
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Mar 6 14:57:37 2008 -0500

    make sure the persistdir is made when we setup the transaction so it doesn't
    cause problems in chroots

diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py
index 7afb001..33c9126 100644
--- a/yum/rpmtrans.py
+++ b/yum/rpmtrans.py
@@ -155,6 +155,8 @@ class RPMTransaction:
         self.filelog = False
 
         self._setupOutputLogging()
+        if not os.path.exists(self.base.conf.persistdir):
+            os.makedirs(self.base.conf.persistdir) # make the dir, just in case
 
     def _setupOutputLogging(self):
         # UGLY... set up the transaction to record output from scriptlets
@@ -285,11 +287,6 @@ class RPMTransaction:
         tsfn = '%s/transaction-all.%s' % (self.base.conf.persistdir, self._ts_time)
         self.ts_all_fn = tsfn
         try:
-            # fixme - we should probably be making this elsewhere but I'd
-            # rather that the transaction not fail so we do it here, anyway
-            if not os.path.exists(self.base.conf.persistdir):
-                os.makedirs(self.base.conf.persistdir) # make the dir, just in case
-            
             fo = open(tsfn, 'w')
         except (IOError, OSError), e:
             self.display.errorlog('could not open ts_all file: %s' % e)



More information about the Yum-cvs-commits mailing list