[Yum-devel] [PATCH 2/2] Avoid creating countless transaction sets just to read packages

Panu Matilainen pmatilai at laiskiainen.org
Fri Feb 11 14:18:24 UTC 2011


Use the transaction handle we already have in populateTs() for fetching
headers from packages. Flipping bits for signature checking is
much cheaper and saner than instanciating and destroying entire
transaction sets once per every single package to be installed.

Alternatively an optional ts argument could be added to
po.returnHeaderFromPackage() if that's preferred.
---
 yum/depsolve.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/yum/depsolve.py b/yum/depsolve.py
index 3aaba0e..6d0d9ec 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -208,7 +208,7 @@ class Depsolve(object):
                     continue
                 rpmfile = txmbr.po.localPkg()
                 if os.path.exists(rpmfile):
-                    hdr = txmbr.po.returnHeaderFromPackage()
+                    hdr = self.ts.hdrFromPackage(txmbr.po.localPkg())
                 else:
                     self.downloadHeader(txmbr.po)
                     hdr = txmbr.po.returnLocalHeader()
-- 
1.7.4



More information about the Yum-devel mailing list