[Rpm-maint] silly idea for srpms

Panu Matilainen pmatilai at laiskiainen.org
Thu Dec 9 12:45:48 UTC 2010

On Tue, 7 Dec 2010, seth vidal wrote:

> it'd be nice to have one of two things in rpm to do directly from the
> python bindings. I've hacked around it - but it ain't pretty:
> 1. for a srpm to carry the specfile contents as an rpm tag that we can
> get to just with rpm -qp --qf %{specfile}\n foo.rpm. So we don't have to
> go through the trouble of cracking the rpm itself to get the specfile
> out.
> 2. some way to extract the specfile from the srpm w/o having to go
> through a subprocess call and/or other pain to rpm2cpio.
> Here's why - it would be handy for retrieving the spec file, passing it
> to rpm.spec() to generate the list of binary pkgs that would be created
> by this srpm being built.
> what would be the preferred route to doing that?
> the reason i suggested 1 is that would mean that pulling the rpm header
> would give you that info and not require you to fetch all of the package
> payload (which could be quite big)
> thoughts?

Something like this has come up before some time, somewhere.

There's no limit to how large a spec can be, but the header size is 
limited. In practise though, any old spec fits inside the header quite 
comfortably. It'd just mean duplicating the data "forever" to avoid 
introducing a grave incompatibility in the src.rpm format.

However IMO the better question is: how to avoid having to go through srpm 
at all? For many things, having the spec available separately in a 
repository of some kind would be far more useful than dragging the oddball 
noarch-but-still-arch srpm construct around.

 	- Panu -

More information about the Rpm-maint mailing list