[Fedora-packaging] Hardlinking *.pyc and *.pyo

Jeremy Katz katzj at redhat.com
Wed Jun 13 19:31:15 UTC 2007


On Wed, 2007-06-13 at 21:51 +0300, Ville Skyttä wrote:
> On Tuesday 03 April 2007, Ville Skyttä wrote:
> > Related to recent space saving discussions, I came across PLD's
> > rpm-build-macros package recently, and found that they hardlink
> > identical *.pyc and *.pyo.
> [...]
> > The PLD implementation looks like this:
> [...]
> > The use of "cmp" would require diffutils installed.  Or the above
> > could be converted to use hardlink instead (which would have to be made
> > sure to be around) or maybe sha1sum (in coreutils, pretty much always
> > around in buildroots).
> >
> > I suppose something like the above could be easily added to
> > redhat-rpm-config or rpm, eg. embedded in brp-python-bytecompile
> > or run after it in %__os_install_post.
> 
> Jeremy pinged me about resurrecting this thread, so here goes, the original 
> threads starts at 
> http://www.redhat.com/archives/fedora-packaging/2007-April/msg00003.html for 
> those who missed it.
> 
> Anyway, attached is a patch against rpm.org hg for discussion - seems somewhat 
> clumsy to use sha1sum for this but I guess it could be acceptable.  Tested on 
> just a few python packages on F-7.  Better implementations certainly exist, 
> and are welcome :)

Looks okay to me.  Probably the easiest thing to do is to put it in
redhat-rpm-config for now[1] and then go from there.  If anyone
disagrees with it, raise your hands... otherwise, I'll get it in the
start of next week

Jeremy

[1] Basically, we'll change the macros to call a brp-python-post in
redhat-rpm-config.  That script will call the one in stock rpm as well
as do the hardlink steps.




More information about the packaging mailing list