[yum-commits] Branch 'yum-3_2_X' - 2 commits - cli.py

Panu Matilainen pmatilai at osuosl.org
Thu Feb 10 17:40:00 UTC 2011


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

New commits:
commit 7115478c527415cb3c8317456cdf50024de89a94
Author: Panu Matilainen <pmatilai at laiskiainen.org>
Date:   Thu Feb 10 12:16:50 2011 +0200

    Use the same transaction set all the way through
    
    Saves another round of re-populating transactions, bringing it down to
    just one. Also move ordering earlier so we can drop unused memory before
    the test-transaction already.

diff --git a/cli.py b/cli.py
index 5db39b7..6cf6753 100644
--- a/cli.py
+++ b/cli.py
@@ -540,6 +540,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         if not self.conf.diskspacecheck:
             self.tsInfo.probFilterFlags.append(rpm.RPMPROB_FILTER_DISKSPACE)
             
+        self.ts.order() # order the transaction
+        self.ts.clean() # release memory not needed beyond this point
         
         testcb = RPMTransaction(self, test=True)
         tserrors = self.ts.test(testcb)
@@ -554,7 +556,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
                  self.errorSummary(errstring)
         self.verbose_logger.log(yum.logginglevels.INFO_2,
              _('Transaction Test Succeeded'))
-        del self.ts
         
         self.verbose_logger.debug('Transaction Test time: %0.3f' % (time.time() - tt_st))
         
@@ -562,11 +563,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         signal.signal(signal.SIGQUIT, signal.SIG_DFL)
         
         ts_st = time.time()
-        self.initActionTs() # make a new, blank ts to populate
-        self.populateTs(keepold=0) # populate the ts
-        self.ts.check() #required for ordering
-        self.ts.order() # order
-        self.ts.clean() # release memory not needed beyond this point
 
         # put back our depcheck callback
         self.dsCallback = dscb
commit ffb89779d14a2b0544bed110b22ae6a3c8c77efd
Author: Panu Matilainen <pmatilai at laiskiainen.org>
Date:   Thu Feb 10 11:57:38 2011 +0200

    Tell rpm to release memory it wont need for the transaction
    
    Calling ts.clean() releases memory used by dependency checks and
    ordering. Depending on the transaction size, this can be tens of megs.
    And yes its dumb that callers need to bother with such issues...

diff --git a/cli.py b/cli.py
index 7237f6c..5db39b7 100644
--- a/cli.py
+++ b/cli.py
@@ -566,6 +566,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         self.populateTs(keepold=0) # populate the ts
         self.ts.check() #required for ordering
         self.ts.order() # order
+        self.ts.clean() # release memory not needed beyond this point
 
         # put back our depcheck callback
         self.dsCallback = dscb


More information about the Yum-commits mailing list