rpm-software-management / createrepo_c

C implementation of the createrepo.
http://rpm-software-management.github.io/createrepo_c
GNU General Public License v2.0
99 stars 95 forks source link

RFE: metadata in filelists.xml (e.g. hash digest, username, groupname, modes) #281

Open wfrisch opened 3 years ago

wfrisch commented 3 years ago

It would be useful to have optional metadata within the <file> elements of filelists.xml:

All of these properties are present in RPM headers and could be included at very low run-time cost. A package in filelists.xml could look like this:

<package pkgid="dddf30051617f2afcd92909b153badac6e820a742db2996fd74d2c203c75ee58" name="zchunk" arch="x86_64" checksum_type="sha256">
  <version epoch="0" ver="1.1.16" rel="1.1"/>
  <file type="dir" mode="40755" user="root" group="root">/usr/share/doc/packages/zchunk</file>
  <file size="15184" digest="1226b22b7f3018ca8872506cbafff4476e24f77263fec5574cb1474b5b6bf6ec" mode="100755" user="root" group="root">/usr/bin/unzck</file>
  <file size="19400" digest="c280cdcd68b045cfd1480c8ee85e2bb667462bed0fde1169c939e4bdd6769390" mode="100755" user="root" group="root">/usr/bin/zck</file>
</package>

The new behavior should be enabled by a command-line option, e.g. --verbose-filelists, in order not to bloat the XML for users who do not need the additional metadata.

wfrisch commented 3 years ago

Implementation: https://github.com/wfrisch/createrepo_c/tree/verbose-filelists

I also added a new command-line option --verbose-filelists, but it's not wired up to anything yet.

Please let me know what you think.

dralley commented 3 years ago

What use cases do you have in mind?

wfrisch commented 3 years ago

What use cases do you have in mind?

Individual file hash digests allow the user to monitor individual files within an entire repository. For instance, I'd like to monitor changes in systemd unit files or udev rules. Permissions issues can be detected with the attributes mode, user and group. File size is not very important for me personally and I could do without it.

kontura commented 1 year ago

It might be of interest that recently there was a new switch added: --filelists-ext that generates filelists with file hashes.