Re: rpm.RPMTAG_SOURCERPM vs rpm.RPMTAG_SOURCEPACKAGE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 06 March 2009, Ville Skyttä wrote:
> On Tue, Jan 27, 2009 at 2:26 PM, Panu Matilainen
>
> <pmatilai@xxxxxxxxxxxxxxx> wrote:
> > On Mon, 26 Jan 2009, Ville Skyttä wrote:
> >> On Friday 23 January 2009, Panu Matilainen wrote:
> >>> Yup, what was there before was correct (and identical to what rpm
> >>> itself uses) - the existence of RPMTAG_SOURCERPM tag means it's a
> >>> binary, otherwise it's a source.
> >>
> >> I just remembered something that was the cause of a long since resolved
> >> rpmlint bug: RPMTAG_SOURCERPM is also empty for installed gpg-pubkey
> >> packages, so they would fall into the "it's a source" category above.
> >
> > Oh, yuck. Thanks for pointing that out, "fixed" now upstream by adding
> > RPMTAG_SOURCERPM to gpg-pubkeys on import.
>
> I hate to return to this, but the fix-on-import behavior means that
> gpg-pubkeys imported with older versions of rpm aren't affected, and
> continue to cause problems after upgrading to a later rpm version if
> the keys are not re-imported.  The attached patch makes
> pkgTupleFromHeader() take this into account, and fixes the problem for
> me.

Any news about this patch?


From 8a860ff18b882c2319aa9dfb375d1e4848b4f062 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@xxxxxx>
Date: Thu, 5 Mar 2009 23:58:41 +0200
Subject: [PATCH] Don't treat gpg-pubkeys imported with rpm < 4.6.0 as source packages in pkgTupleFromHeader().

---
 rpmUtils/miscutils.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py
index a339193..5b792a0 100644
--- a/rpmUtils/miscutils.py
+++ b/rpmUtils/miscutils.py
@@ -118,7 +118,11 @@ def pkgTupleFromHeader(hdr):
        None epoch to 0, as well."""
    
     name = hdr['name']
-    if hdr[rpm.RPMTAG_SOURCERPM]:
+
+    # RPMTAG_SOURCEPACKAGE: RPMTAG_SOURCERPM is not necessarily there for
+    # e.g. gpg-pubkeys imported with older rpm versions
+    # http://lists.baseurl.org/pipermail/yum/2009-January/022275.html
+    if hdr[rpm.RPMTAG_SOURCERPM] or hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1:
         arch = hdr['arch']
     else:
         arch = 'src'
-- 
1.6.0.6

_______________________________________________
Yum mailing list
Yum@xxxxxxxxxxxxxxxxx
http://lists.baseurl.org/mailman/listinfo/yum

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux