File: reproducible_builds

package info (click to toggle)
guymager 0.8.13-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,764 kB
  • sloc: cpp: 17,479; makefile: 30; sh: 22
file content (16 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- a/manuals/rebuild.sh
+++ b/manuals/rebuild.sh
@@ -1,6 +1,12 @@
 #!/bin/bash
 
-TH_Date=`date '+%Y-%m-%d'`
+# only set if not already handled via debhelper or alike,
+# to support reproducible builds
+if [ -z "${SOURCE_DATE_EPOCH:-}" ] ; then
+  export SOURCE_DATE_EPOCH="$(date -d "$1" +'%s')"
+fi
+
+TH_Date=`date --utc --date=@${SOURCE_DATE_EPOCH} '+%Y-%m-%d'`
 TH_Source=`head -qn 1 ../debian/changelog ../changelog 2>/dev/null | awk '{
                                                   Version = $2
                                                   gsub ("\\\\(", "", Version)