Set the timezone too when invoking date with a timestamp because it can

be affected too:
$ env TZ=UTC date -r 1700157305
Thu Nov 16 17:55:05 UTC 2023
$ env TZ=UTC24:24:24 date -r 1700157305
Wed Nov 15 17:30:41 UTC 2023
This commit is contained in:
christos 2023-11-16 18:06:05 +00:00
parent b720a91354
commit 48ce0cf66c
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.58 2023/11/13 21:01:51 christos Exp $
# $NetBSD: Makefile.inc,v 1.59 2023/11/16 18:06:05 christos Exp $
#
# Ross Harvey <ross@NetBSD.org>
@ -59,12 +59,12 @@ PRESET+= -rnextminor=${nextmin}
.endif
.endif
.if defined(BUILDID) && "${BUILDID:M20*Z}" != ""
curdate!= env LANG="C" ${TOOL_DATE} -d "${BUILDID:C/[0-9][0-9][0-9][0-9]Z$//}" "+%b %d, %Y"
curdate!= env LANG="C" TZ="UTC" ${TOOL_DATE} -d "${BUILDID:C/[0-9][0-9][0-9][0-9]Z$//}" "+%b %d, %Y"
.else
.if ${NETBSD_OFFICIAL_RELEASE:Uno} == "yes"
.error "No release date could be derived from BUILDID"
.else
curdate!= env LANG="C" ${TOOL_DATE} ${DATE_TIMESTAMP} "+%b %d, %Y"
curdate!= env LANG="C" TZ="UTC" ${TOOL_DATE} ${DATE_TIMESTAMP} "+%b %d, %Y"
.endif
.endif
PRESET+= -dcur_date="${curdate}"