rpm: make local repodata deterministic (fixes #117) #118
Reference in New Issue
Block a user
Delete Branch "benvin/rpm-repodata-deterministic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Local RPM repos regenerated
repomd.xmlon every request and advertised aprimary.xml.gzsha256 that drifted every second, becausetime.Now().Unix()was embedded inside the gzippedprimary.xml(and inrepomd<revision>/<timestamp>). The advertised hash therefore never matched the content-addressed<sha256>-primary.xml.gzbytes a second later or on the other replica, sodnffailed with a checksum mismatch. Part of #117.How:
<time file=>inprimary.xmlfrom the persistedrpm_metadata.created_atinstead of the wall clock; unset timestamps collapse to a fixed0.repomd<revision>/<timestamp>from the newest package upload time, sorepomd.xmlis byte-identical across replicas and requests.file_pathas a total-order tiebreak to the metadataORDER BY.OS: 255) so compressed bytes depend only on the payload.repomd.xmlequals the sha256 of the bytes eachserve*handler returns.