NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/57912: [RB] acorn32/earmv4, cats/earmv4, epoc32/earmv4, hpcarm/earmv4, iyonix/earm, shark/earmv4, zaurus/earm Use repro epoch for generating date string



>Number:         57912
>Category:       misc
>Synopsis:       [RB] acorn32/earmv4, cats/earmv4, epoc32/earmv4, hpcarm/earmv4, iyonix/earm, shark/earmv4, zaurus/earm Use repro epoch for generating date string
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 08 19:10:00 +0000 2024
>Originator:     Jan-Benedict Glaw
>Release:        current
>Organization:
>Environment:
Linux lili 5.16.0-4-amd64 #1 SMP PREEMPT Debian 5.16.12-1 (2022-03-08) x86_64 GNU/Linux
>Description:
Most earmv4 variants use a boot file that has an embedded timestamp. Generate it from $MKREPRO_TIMESTAMP for reproducibility.
>How-To-Repeat:
Build one of the listed mach/arch variants twice and compare the build artifacts.
>Fix:
diff --git a/sys/arch/acorn32/stand/lib/newvers_rm.sh b/sys/arch/acorn32/stand/lib/newvers_rm.sh
index d78468983450..37eddb944b33 100644
--- a/sys/arch/acorn32/stand/lib/newvers_rm.sh
+++ b/sys/arch/acorn32/stand/lib/newvers_rm.sh
@@ -40,7 +40,12 @@ set -e
 r=`awk -F: '$1 ~ /^[0-9.]*$/ { it = $1; } END { print it }' $1`
 r=`echo $r | sed 's/\.\([0-9]\)$/.0\1/'`
 
-t=`date +"%d %b %Y"`
+if [ -n "$MKREPRO_TIMESTAMP" ]; then
+       # Try NetBSD date, fall back to GNU date.
+       date -u -r "$MKREPRO_TIMESTAMP" '+%d %b %Y' 2> /dev/null || date -u -d "@$MKREPRO_TIMESTAMP" '+%d %b %Y'
+else
+       t=`date +"%d %b %Y"`
+fi
 
 echo "const char rmhelp[] = \"$2\\t${r} (${t})\";" > rmvers.c
 



Home | Main Index | Thread Index | Old Index