Re: Extract source URLs from RPM spec files

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

 





On Dec 6, 2007 4:57 PM, Mildred <mildred593@xxxxxxxxx> wrote:
Hi,

I would like to create a probram that would download automatically the
source files of packages given a spec file and build it using rpmbuild.



FYI: rpmbuild (in rpm-4.4.6 and later) will already fetch sources/patches,

rpm-4.4.9 will also fetch Icon: url's, as well as verify digests/signatures

of the fetch'ed elements (if the information is added to spec file build dependencies).

 

But I just wonder how to extract the source URLs from the spec file. I can't
use standard srep and sed since often the Source line contains variables
that need to be resolved.

I found that rpm has an option --specfile that seems deigned for that
purpose. But rpm do not seems to be aware of the source filenames
unfortunately.


Yep. The issue is that there is an ambiguity of exactly what is

being queried with --specfile. The default for --specfile queries all binary

(sub-)packages, as that is arguably more useful to most.


 

Does anyone knows how I could extract this information without writing a
spec file parser ?


FYI: Here's what is in rpm-5.0:


$ rpm -q --qf '[%{source}\n]' --specsrpm time.spec

    time-1.7.tar.gz


(I fergit when I implemented --specsrpm, more than a year ago for sure)


which is a start, but does not include (because the *.src.rpm header does not include)

the full URL, only the basename of the included file.


It wouldn't be hard to add the full source URL as an additional tag in *.src.rpm if you want.


Post an RFE to <rpm-devel@xxxxxxxx> if you (or someone else) wants the ability

to query the full source url from spec files and *.src.rpm headers.


hth


73 de Jeff


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux