[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/__init__.py yum/packageSack.py

James Antill james at osuosl.org
Thu Feb 18 19:13:57 UTC 2010


 yum/__init__.py    |   10 ++++++++++
 yum/packageSack.py |    8 +++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 47c944baed557d823a8f973a07463410d1e464bd
Author: James Antill <james at and.org>
Date:   Thu Feb 18 12:59:07 2010 -0500

    Don't load all of the rpmdb in matchPackageNames(), used by at least rm.

diff --git a/yum/packageSack.py b/yum/packageSack.py
index 6e986a4..0d9301b 100644
--- a/yum/packageSack.py
+++ b/yum/packageSack.py
@@ -255,7 +255,6 @@ class PackageSackBase(object):
     def searchAll(self, arg, query_type):
         raise NotImplementedError()
     
-    # FIXME: This needs to be merged with how "yum list" works.
     def matchPackageNames(self, pkgspecs):
         """take a list strings and match the packages in the sack against it
            this will match against:
@@ -281,8 +280,11 @@ class PackageSackBase(object):
                 specs[p] = re.compile(restring)
             else:
                 specs[p] = p
-         
-        for pkgtup in self.simplePkgList():
+
+        #  We don't use simplePkgList() here because that loads all of the
+        # rpmdb, if we are Eg. doing a "remove PackageKit".
+        pkgs = self.returnPackages(patterns=unmatched)
+        for pkgtup in [pkg.pkgtup for pkg in pkgs]:
             (n,a,e,v,r) = pkgtup
             names = set((
                 n, 
commit 7ff844b691d7c5cdb1621be4535449d803c578aa
Author: James Antill <james at and.org>
Date:   Thu Feb 18 12:27:27 2010 -0500

    Close history before downloads (maybe stop presto doing any damage).

diff --git a/yum/__init__.py b/yum/__init__.py
index 06f6156..324a8ec 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1515,6 +1515,16 @@ class YumBase(depsolve.Depsolve):
         def adderror(po, msg):
             errors.setdefault(po, []).append(msg)
 
+        #  We close the history DB here because some plugins (presto) use
+        # threads. And sqlite really doesn't like threads. And while I don't
+        # think it should matter, we've had some reports of history DB
+        # corruption, and it was implied that it happened just after C-c
+        # at download time and this is a safe thing to do.
+        #  Note that manual testing shows that history is not connected by
+        # this point, from the cli with no plugins. So this really does
+        # nothing *sigh*.
+        self.history.close()
+
         self.plugins.run('predownload', pkglist=pkglist)
         repo_cached = False
         remote_pkgs = []


More information about the Yum-commits mailing list