NetBSD Problem Report #57912

From www@netbsd.org  Thu Feb  8 19:05:01 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4AB6D1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  8 Feb 2024 19:05:01 +0000 (UTC)
Message-Id: <20240208190500.48F5A1A9239@mollari.NetBSD.org>
Date: Thu,  8 Feb 2024 19:05:00 +0000 (UTC)
From: jbglaw@lug-owl.de
Reply-To: jbglaw@lug-owl.de
To: gnats-bugs@NetBSD.org
Subject: [RB] acorn32/earmv4, cats/earmv4, epoc32/earmv4, hpcarm/earmv4, iyonix/earm, shark/earmv4, zaurus/earm Use repro epoch for generating date string
X-Send-Pr-Version: www-1.0

>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
>Last-Modified:  Thu Feb 08 19:30:03 +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


>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57912 CVS commit: src/sys/arch/acorn32/stand/lib
Date: Thu, 8 Feb 2024 14:28:42 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Thu Feb  8 19:28:42 UTC 2024

 Modified Files:
 	src/sys/arch/acorn32/stand/lib: newvers_rm.sh

 Log Message:
 PR/57912: Jan-Benedict Glaw: Use repro epoch for generating date string


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/sys/arch/acorn32/stand/lib/newvers_rm.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.