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.

Modified files:

Index: src/sys/arch/acorn32/stand/lib/newvers_rm.sh
diff -u src/sys/arch/acorn32/stand/lib/newvers_rm.sh:1.2 src/sys/arch/acorn32/stand/lib/newvers_rm.sh:1.3
--- src/sys/arch/acorn32/stand/lib/newvers_rm.sh:1.2	Wed Apr 30 09:10:59 2008
+++ src/sys/arch/acorn32/stand/lib/newvers_rm.sh	Thu Feb  8 14:28:42 2024
@@ -1,6 +1,6 @@
 #! /bin/sh -
 #
-# $NetBSD: newvers_rm.sh,v 1.2 2008/04/30 13:10:59 martin Exp $
+# $NetBSD: newvers_rm.sh,v 1.3 2024/02/08 19:28:42 christos Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,10 +37,17 @@
 
 set -e
 
-r=`awk -F: '$1 ~ /^[0-9.]*$/ { it = $1; } END { print it }' $1`
-r=`echo $r | sed 's/\.\([0-9]\)$/.0\1/'`
+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.
+	t=$(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
 

Reply via email to