how to get a specfile from an RPM

Jonathan Dieter jdieter at gmail.com
Wed Aug 15 09:06:37 UTC 2007


On Wed, 2007-08-15 at 16:59 +0800, Ed Greshko wrote:
> Jos Vos wrote:
> > On Wed, Aug 15, 2007 at 08:16:36AM +0800, Ed Greshko wrote:
> > 
> >> And you can do it simply by...
> >>
> >> rpm2cpio whatever-package.src.rpm | cpio -i *spec
> > 
> > Correct, but better quote it (use '*.spec'), as there might be files
> > matching *spec in your current directory and then it mostly won't
> > work as expected ;-).
> 
> I don't think the quotes are needed, although they couldn't hurt.  The *spec
> is a parameter to cpio telling it what files to extract so I don't think
> having another .spec in your directory will hurt.  In fact, I tried it both
> quoted and unquoted with another spec file in my current directory and the
> results are the same.  Care to share your concern?
> 
I think the concern is that if you have foo.spec in your current
directory and you try doing:

rpm2cpio bar.src.rpm | cpio -i *spec

bash will turn *spec into foo.spec, which cpio will then try to extract
from the archive (which wouldn't exist in this example).

If you don't have any .spec files in the current directory, bash will
just send *spec to cpio, which will handle it the expected way.

Jonathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070815/59e69666/attachment-0001.sig>


More information about the fedora-list mailing list