Source: ruby-tioga
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The tioga.sty.gz embeds the current date:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/diffoscope-results/ruby-tioga.html

  ./usr/share/doc/ruby-tioga/tioga.sty.gz

  \ProvidesPackage{tioga}[2023/03/16]
vs.
  \ProvidesPackage{tioga}[2022/02/12]

The attached patch fixes this by using the SOURCE_DATE_EPOCH environment
variable instead of the current time, which is typically set from the
timestamp in debian/changelog.


With this patch applied, ruby-tioga should build reproducibly on
tests.reproducible-builds.org!


Thanks for maintaining ruby-tioga!


live well,
  vagrant
From 59fec7800e70a9dc93a52121a813b8d1226222c6 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Mon, 14 Feb 2022 00:19:12 +0000
Subject: [PATCH] misc/mk_tioga_sty.rb: Use a consistent date when generating
 the sty file.

If the SOURCE_DATE_EPOCH environment variable is available, use that
instead of the current time to set the date.

https://reproducible-builds.org/docs/source-date-epoch/
---
 misc/mk_tioga_sty.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/misc/mk_tioga_sty.rb b/misc/mk_tioga_sty.rb
index dcbe275..6bb4fc0 100644
--- a/misc/mk_tioga_sty.rb
+++ b/misc/mk_tioga_sty.rb
@@ -42,7 +42,11 @@ color_specs + "\nEnd_of_preamble\n" +
 
 out.close
 
-date = Date::today
+if ENV['SOURCE_DATE_EPOCH'].nil?
+  date = Date::today
+else
+  date = Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
+end
 str_date = sprintf "%04d/%02d/%02d", date.year, date.month, date.day
 
 
-- 
2.34.1

Attachment: signature.asc
Description: PGP signature

Reply via email to