mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
newvers.sh: avoid regenerating vers.c if content unchanged
When reproducible build mode is enabled vers.c may be unchanged between successive builds. In this case avoid changing the file's metadata so that it does not cause dependent targets to be rebuilt. Sponsored by: The FreeBSD Foundation Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D17892
This commit is contained in:
parent
a42546df88
commit
179460e148
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340238
|
@ -328,7 +328,7 @@ else
|
|||
VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n"
|
||||
fi
|
||||
|
||||
cat << EOF > vers.c
|
||||
vers_content_new=$(cat << EOF
|
||||
$COPYRIGHT
|
||||
#define SCCSSTR "@(#)${VERINFO}"
|
||||
#define VERSTR "${VERSTR}"
|
||||
|
@ -342,5 +342,10 @@ char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR;
|
|||
int osreldate = ${RELDATE};
|
||||
char kern_ident[] = "${i}";
|
||||
EOF
|
||||
)
|
||||
vers_content_old=$(cat vers.c 2>/dev/null || true)
|
||||
if [ "$vers_content_new" != "$vers_content_old" ]; then
|
||||
echo "$vers_content_new" > vers.c
|
||||
fi
|
||||
|
||||
echo $((v + 1)) > version
|
||||
|
|
Loading…
Reference in a new issue