Description: Make generated manpage date reproducible uudoc stamped each generated manpage with the current date (Zoned::now()), which made the package unreproducible: rebuilding on a different day produced a different .TH date line in every rust-*.1 manpage. . Honour SOURCE_DATE_EPOCH instead, which Debian derives from the latest debian/changelog entry, falling back to the current date when the variable is unset (e.g. an upstream build outside dpkg-buildpackage). Author: Sylvestre Ledru Bug: https://reproduce.debian.net/i386/api/v1/builds/211467/artifacts/519913/diffoscope Forwarded: not-needed Last-Update: 2026-06-04 =================================================================== --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -187,8 +187,19 @@ fn gen_manpage( // Convert to string for processing let manpage = String::from_utf8(buffer).expect("Invalid UTF-8 in manpage"); - // Post-process the manpage to fix mandoc lint issues - let date = Zoned::now().strftime("%Y-%m-%d").to_string(); + // Post-process the manpage to fix mandoc lint issues. + // Honour SOURCE_DATE_EPOCH (set by Debian from the latest debian/changelog + // entry) so the manpage date is reproducible; fall back to the current date. + let date = match std::env::var("SOURCE_DATE_EPOCH") + .ok() + .and_then(|s| s.trim().parse::().ok()) + { + Some(epoch) => jiff::Timestamp::from_second(epoch) + .expect("invalid SOURCE_DATE_EPOCH") + .strftime("%Y-%m-%d") + .to_string(), + None => Zoned::now().strftime("%Y-%m-%d").to_string(), + }; let processed_manpage = post_process_manpage(manpage, &date); // Write the processed manpage to stdout