On 05/19/2018 12:25 AM, Francesco wrote:
Hi Jeff,


2018-05-18 18:54 GMT+02:00 Jeff Johnson <n3...@me.com <mailto:n3...@me.com>>:

    You do realize that rpm already computes a digest (usually SHA256,
    but MD5 can be configured) for all files in a *.rpm package file?
    That information can be retrieved using --queryformat easily (if
    make can use digests other than MD5).


No, I really did not know that. I explored --queryformat and found out on my Centos7 system that indeed the command
      rpm -q --qf '[%{filenames} %{FILEMD5S}\n]' coreutils | grep date
provides:
/usr/bin/date 0955c235d9f069b32d22830f661071a33d99425dc5eca69b8da99654c67e0cc7

that really looks exactly what I needed!
Actually as you say that's not a md5 checksum (as the tag name FILEMD5S would suggest) but rather a sha256 checksum, but for my purpose there's no difference.

The FILEMD5S tag is a backwards compatibility leftover, the actual tag name is FILEDIGESTS since rpm 4.6.x and the used algorithm in FILEDIGESTALGO. See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L393 for the configuration + values.

        - Panu -

_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to