[Rpm-metadata] exclude filename from .gz files

Dennis Gregorovic dgregor at redhat.com
Mon Nov 28 16:20:19 UTC 2011

When you run createrepo, the original filenames, including full path, of
the files are stored in the header of the .gz metadata.  There are two
issues with this.  The first is cosmetic - we're keeping data in those
files that we don't really need.  For example, this is from F-16:

$ file 0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml.gz 
0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml.gz: gzip compressed data, was "/srv/pungi/16.RC5.1/16/Fedora/x", max compression

Note the 'was...' portion.

The other issue, however, is a bit more problematic.  The path becomes
part of the checksum of the gzip file itself.  So, if you gunzip the
file and re-gzip it, you get a different checksum.

$ sha256sum 0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml.gz
0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa  0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml.gz
$ gunzip 0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml.gz 
$ gzip 0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml 
$ sha256sum 0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml.gz 
c5aa74f1687378a9880e638f25108d6ceafca9426097f05bd8ff66eb889c2115  0f927aeb15a8028a31982bbd769ac5df3c15251a3aa0ba9869ab9bff325134aa-primary.xml.gz

Would folks be ok with adding a flag to createrepo/modifyrepo so that
they don't include the original path in the gzip file (or perhaps making
that the default)?  I can whip together a patch if that would help.

-- Dennis

More information about the Rpm-metadata mailing list