Re: Extract source URLs from RPM spec files
"Jeff Johnson" <[email protected]>
| Newsgroups | gmane.linux.redhat.rpm.general |
|---|---|
| Message-ID | <[email protected]> |
On Dec 6, 2007 4:57 PM, Mildred <[email protected]> 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 <[email protected]> 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 [email protected] https://www.redhat.com/mailman/listinfo/rpm-list