Module Name: src Committed By: christos Date: Tue Apr 2 14:15:19 UTC 2024
Modified Files: src/sys/conf: newvers_stand.sh Log Message: Use ${TOOL_DATE} (Jan-Benedict Glaw) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/conf/newvers_stand.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/conf/newvers_stand.sh diff -u src/sys/conf/newvers_stand.sh:1.9 src/sys/conf/newvers_stand.sh:1.10 --- src/sys/conf/newvers_stand.sh:1.9 Sat Apr 8 15:53:54 2017 +++ src/sys/conf/newvers_stand.sh Tue Apr 2 10:15:19 2024 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $NetBSD: newvers_stand.sh,v 1.9 2017/04/08 19:53:54 christos Exp $ +# $NetBSD: newvers_stand.sh,v 1.10 2024/04/02 14:15:19 christos Exp $ # # Copyright (c) 2000 The NetBSD Foundation, Inc. # All rights reserved. @@ -35,6 +35,8 @@ # Called as: # sh ${S}/conf/newvers_stand.sh [-dkn] [-D <date>] [-m <machine>] VERSION_TEMPLATE [EXTRA_MSG] +DATE=${TOOL_DATE:-date} + cwd=$(dirname "$0") add_name=true @@ -45,8 +47,8 @@ dateargs= # parse command args while getopts "m:D:dknm:" OPT; do - case $OPT in - D) dateargs="-r $OPTARG";; + case ${OPT} in + D) dateargs="-r ${OPTARG}";; d) add_date=false;; k) add_kernrev=false;; m) machine=${OPTARG};; @@ -56,25 +58,25 @@ while getopts "m:D:dknm:" OPT; do esac done -shift $(expr $OPTIND - 1) +shift $(expr ${OPTIND} - 1) r=$(awk -F: '$1 ~ /^[0-9.]*$/ { it = $1; } END { print it }' "$1") shift -t=$(LC_ALL=C TZ=UTC date $dateargs) +t=$(LC_ALL=C TZ=UTC ${DATE} ${dateargs}) -if $add_date; then +if ${add_date}; then echo "const char bootprog_rev[] = \"${r} (${t})\";" > vers.c else echo "const char bootprog_rev[] = \"${r}\";" > vers.c fi -if $add_name; then +if ${add_name}; then extra=${1:+" $1"} echo "const char bootprog_name[] = \"NetBSD/${machine}${extra}\";" >> vers.c fi -if $add_kernrev; then +if ${add_kernrev}; then osr=$(sh "${cwd}/osrelease.sh") echo "const char bootprog_kernrev[] = \"${osr}\";" >> vers.c fi