FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > RPM Package Manager

 
 
LinkBack Thread Tools
 
Old 12-06-2007, 08:57 PM
Mildred
 
Default Extract source URLs from RPM spec files

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.

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.

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

Thanks.

Mildred

--
Mildred Ki'lya
Site: <http://mildred632.free.fr/>
XMPP: <mildred@jabber.fr> (GoogleTalk, Jabber)

GPG: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]


_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 12-08-2007, 05:24 PM
Michael Jennings
 
Default Extract source URLs from RPM spec files

On Thursday, 06 December 2007, at 22:57:27 (+0100),
Mildred wrote:

> 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.

I believe rpmbuild in RPM 5 already does this.

> 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.
>
> Does anyone knows how I could extract this information without
> writing a spec file parser ?

rpm --eval "`cat foo.spec`" will get you most of the way there.

Michael

--
Michael Jennings (a.k.a. KainX) http://www.kainx.org/ <mej@kainx.org>
Linux Server/Cluster Admin, LBL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"I have failed over and over again in my life. And that is why I
succeed." -- Michael Jordan

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 12-08-2007, 05:36 PM
"Jeff Johnson"
 
Default Extract source URLs from RPM spec files

On Dec 6, 2007 4:57 PM, Mildred <mildred593@online.fr> 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}
]' --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@rpm5.org> 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@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 

Thread Tools




All times are GMT. The time now is 03:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org