Source: xorp
Version: 1.8.5-4.1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps
X-Debbugs-Cc: [email protected]
Hi,
Whilst working on the "reproducible builds" effort [0], we noticed
that xorp could not be built reproducibly.
Patch attached.
[0] https://wiki.debian.org/ReproducibleBuilds
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
--- a/libxorp/create_buildinfo.sh 2016-07-15 17:56:24.575091115 +0200
--- b/libxorp/create_buildinfo.sh 2016-07-15 21:57:56.723874929 +0200
@@ -45,7 +45,10 @@
fi
cat build_info.prefix > $BINFO
-if uname -mrspn > /dev/null 2>&1
+if [ -n "$SOURCE_DATE_EPOCH" ]
+ then
+ echo "const char* BuildInfo::getBuildMachine() { return \"Reproducible
build @ $SOURCE_DATE_EPOCH\"; }" >> $BINFO
+elif uname -mrspn > /dev/null 2>&1
then
echo "const char* BuildInfo::getBuildMachine() { return \"`uname
-mrspn`\"; }" >> $BINFO
else
@@ -59,7 +62,7 @@
if date > /dev/null 2>&1
then
- echo "const char* BuildInfo::getBuildDate() { return \"`date`\"; }" >>
$BINFO
+ echo "const char* BuildInfo::getBuildDate() { return \"$(date --utc
--date=@${SOURCE_DATE_EPOCH:-$(date +%s)})\"; }" >> $BINFO
else
echo "Warning: 'date' does not function on this system."
echo "const char* BuildInfo::getBuildDate() { return \"Unknown\"; }" >>
$BINFO
@@ -68,7 +71,7 @@
if date '+%F %H:%M' > /dev/null 2>&1
then
- echo "const char* BuildInfo::getShortBuildDate() { return \"`date '+%F
%H:%M'`\"; }" >> $BINFO
+ echo "const char* BuildInfo::getShortBuildDate() { return \"$(date --utc
--date=@${SOURCE_DATE_EPOCH:-$(date +%s)}) '+%F %H:%M'\"; }" >> $BINFO
else
echo "Warning: date +%F %H:%M does not function on this system."
echo "const char* BuildInfo::getShortBuildDate() { return \"Unknown\"; }"
>> $BINFO