[yum/f13/master] Fix auto-close bug with GPG key installs.

James Antill james at fedoraproject.org
Tue Sep 14 14:47:27 UTC 2010


commit 29f1fae4a9a08f72918886c15a55f9ae41d2b378
Author: James Antill <james at and.org>
Date:   Tue Sep 14 10:20:47 2010 -0400

    Fix auto-close bug with GPG key installs.

 yum-PK-auto-close-fix.patch |   39 +++++++++++++++++++++++++++++++++++++++
 yum.spec                    |    8 +++++++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/yum-PK-auto-close-fix.patch b/yum-PK-auto-close-fix.patch
new file mode 100644
index 0000000..e6dfc81
--- /dev/null
+++ b/yum-PK-auto-close-fix.patch
@@ -0,0 +1,39 @@
+commit 3e05536ef876fc761553b632495449fd96bb4b9e
+Author: James Antill <james at and.org>
+Date:   Tue Sep 14 09:48:23 2010 -0400
+
+     Can't keep ts around, due to rpmdb.auto_close. BZ 622179.
+     This kind of sucks as we have to remember in all future code not to
+    keep a ts over any .rpmdb call, it's even better because almost nobody
+    will hit it. It works though, and is simple.
+    
+     We could maybe fix this "better" by using a weakref in rpmdb, and doing
+    it that way. Or having some manual way to mark auto_close as off. Or
+    just rm'ing auto_close as a bad idea.
+
+diff --git a/yum/__init__.py b/yum/__init__.py
+index b5e9213..5c689e5 100644
+--- a/yum/__init__.py
++++ b/yum/__init__.py
+@@ -4301,12 +4301,11 @@ class YumBase(depsolve.Depsolve):
+         keyurls = repo.gpgkey
+         key_installed = False
+ 
+-        ts = self.rpmdb.readOnlyTS()
+-
+         for keyurl in keyurls:
+             keys = self._retrievePublicKey(keyurl, repo)
+ 
+             for info in keys:
++                ts = self.rpmdb.readOnlyTS()
+                 # Check if key is already installed
+                 if misc.keyInstalled(ts, info['keyid'], info['timestamp']) >= 0:
+                     self.logger.info(_('GPG key at %s (0x%s) is already installed') % (
+@@ -4331,6 +4330,7 @@ class YumBase(depsolve.Depsolve):
+                     raise Errors.YumBaseError, _("Not installing key")
+                 
+                 # Import the key
++                ts = self.rpmdb.readOnlyTS()
+                 result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key']))
+                 if result != 0:
+                     raise Errors.YumBaseError, \
diff --git a/yum.spec b/yum.spec
index 4c13374..ecb4017 100644
--- a/yum.spec
+++ b/yum.spec
@@ -3,7 +3,7 @@
 Summary: RPM installer/updater
 Name: yum
 Version: 3.2.28
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.2/%{name}-%{version}.tar.gz
@@ -15,6 +15,7 @@ Patch3: yum-multilib-policy-best.patch
 Patch4: no-more-exactarchlist.patch
 Patch5: geode-arch.patch
 Patch6: yum-HEAD.patch
+Patch7: yum-PK-auto-close-fix.patch
 
 Patch20: yum-manpage-files.patch
 
@@ -71,6 +72,7 @@ can notify you when they are available via email, syslog or dbus.
 %patch4 -p0
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 %patch20 -p1
 
 %build
@@ -134,6 +136,10 @@ rm -rf $RPM_BUILD_ROOT
 %dir /usr/lib/yum-plugins
 
 %changelog
+* Tue Sep 14 2010 James Antill <james at fedoraproject.org> - 3.2.28-4
+- Fix auto-close bug with GPG key installs.
+- Resolves: bug#622179
+
 * Fri Aug 27 2010 Seth Vidal <skvidal at fedoraproject.org>
 - obsoleted yum-plugin-download-order
 


More information about the scm-commits mailing list