Make builds reproducible.

Use the Debian changelog details to derive a build number and date,
so that we can make reproducible binaries.
This commit is contained in:
Carlos Maddela
2016-12-19 09:45:38 +11:00
parent ee5d92b276
commit 37a0c5dacb
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
From: Carlos Maddela <e7appew@gmail.com>
Date: Mon, 19 Dec 2016 09:39:49 +1100
Subject: Make builds reproducible.
Description: Make builds reproducible.
Use the Debian changelog details to derive a build number and date,
so that we can make reproducible binaries.
Author: Carlos Maddela <e7appew@gmail.com>
Origin: vendor
Forwarded: not-needed
Last-Update: 2016-12-19
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
scripts/time-stamper.bash | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/time-stamper.bash b/scripts/time-stamper.bash
index fd28794..60fe91a 100755
--- a/scripts/time-stamper.bash
+++ b/scripts/time-stamper.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
-build=$(grep BUILD $1 | cut -d\ -f3)
-build=$((build+1))
+# Use Debian changelog details to derive build number and date.
+build=$(dpkg-parsechangelog -S Version | sed 's/.*-\([0-9]\+\).*/\1/')
echo "#define BUILD $build" >$1
-date=$(date +"%d.%m.%y (%A, %H:%M)")
+date=$(date --date="$(dpkg-parsechangelog -S Date)" +"%d.%m.%y (%A, %H:%M)")
echo "#define BDATE \"$date\"" >>$1

View File

@@ -10,3 +10,4 @@
11-no-cruft.patch
12-fix-spelling-of-up-to.patch
13-fix-missing-language-field-in-po-files.patch
14-make-builds-reproducible.patch