Re: rpm.RPMTAG_SOURCERPM vs rpm.RPMTAG_SOURCEPACKAGE

seth vidal <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <1232730097.3258.31.camel@rosebud>
On Fri, 2009-01-23 at 18:56 +0200, Ville Skyttä wrote:
> Hi,
> 
> http://yum.baseurl.org/gitweb?p=yum.git;a=commitdiff;h=066241a5b0b46671ea871908a27cb792ec491b49
> 
> I believe this change is broken and should be reverted - rpm.RPMTAG_SOURCERPM 
> is the name-version-release.src.rpm string of the source rpm that a binary 
> package was created from (so "1" will never match); and if the package is a 
> source rpm, its RPMTAG_SOURCERPM is something evaluating to False (seemingly 
> an empty list for me on F-9).  So things should have been ok before the above 
> change.
> 
> Another way of testing whether a package is a source one is checking for 
> rpm.RPMTAG_SOURCEPACKAGE (not RPMTAG_SOURCERPM) which should be 1 for source 
> packages.  But based on 
> http://osdir.com/ml/linux.redhat.rpm.devel/2006-04/msg00014.html I believe 
> RPMTAG_SOURCEPACKAGE is a legacy thing already removed from rpm5.org, FWIW, 
> and RPMTAG_SOURCERPM should work for both rpm.org and rpm5.org.
> 
> Anyway, I think RPMTAG_SOURCEPACKAGE still works for all rpm.org versions 
> currently, but you want to use it, the code should be:
> 
>     if hdr[rpm.RPMTAG_SOURCEPACKAGE] == 1:
>         arch = 'src'
>     else:
>         arch = hdr['arch']
> 
> ...and _not_:
> 
>     if hdr[rpm.RPMTAG_SOURCEPACKAGE] == 1:
>         arch = hdr['arch']
>     else:
>         arch = 'src'

You are correct and it is now fixed.

thanks,
-sv


_______________________________________________
Yum mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.