Re: rpm.RPMTAG_SOURCERPM vs rpm.RPMTAG_SOURCEPACKAGE
James Antill <[email protected]>
| Newsgroups | gmane.linux.rpm.yum |
|---|---|
| Message-ID | <[email protected]> |
Ville Skyttä <[email protected]> writes: > 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. --- a/rpmUtils/miscutils.py +++ b/rpmUtils/miscutils.py - if hdr[rpm.RPMTAG_SOURCERPM]: + if hdr[rpm.RPMTAG_SOURCERPM] or hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1: arch = hdr['arch'] else: arch = 'src' ...doesn't the second one fail on some packages? Panu? How about: - if hdr[rpm.RPMTAG_SOURCERPM]: + if hdr[rpm.RPMTAG_SOURCERPM] or name.startswith('gpg-pubkey'): ...worse/better? -- James Antill -- [email protected]