summaryrefslogtreecommitdiff
path: root/sys/conf/newvers.sh
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2016-12-15 12:57:03 +0000
committerEd Maste <emaste@FreeBSD.org>2016-12-15 12:57:03 +0000
commit7e9de36c3a524b63e0d21a8cc634b40404bb3200 (patch)
treef295717f1a825de316d3be881cb5e5229c7e7e39 /sys/conf/newvers.sh
parentc5f74c48734b78cbc442cdf0891d2418f548cba8 (diff)
downloadsrc-test2-7e9de36c3a524b63e0d21a8cc634b40404bb3200.tar.gz
src-test2-7e9de36c3a524b63e0d21a8cc634b40404bb3200.zip
Notes
Diffstat (limited to 'sys/conf/newvers.sh')
-rw-r--r--sys/conf/newvers.sh30
1 files changed, 28 insertions, 2 deletions
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 72e9ae60610a..9e018f769f0e 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -30,6 +30,14 @@
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
# $FreeBSD$
+# Command line options:
+#
+# -r Reproducible build. Do not embed directory names, user
+# names, time stamps or other dynamic information into
+# the outuput file. This is intended to allow two builds
+# done at different times and even by different people on
+# different hosts to produce identical output.
+
TYPE="FreeBSD"
REVISION="12.0"
BRANCH="CURRENT"
@@ -250,10 +258,28 @@ if [ -n "$hg_cmd" ] ; then
fi
fi
+include_metadata=true
+while getopts r opt; do
+ case "$opt" in
+ r)
+ include_metadata=
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+if [ -z "${include_metadata}" ]; then
+ VERINFO="${VERSION} ${svn}${git}${hg}${p4version}"
+ VERSTR="${VERINFO}\\n"
+else
+ VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
+ VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n"
+fi
+
cat << EOF > vers.c
$COPYRIGHT
-#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
-#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n ${u}@${h}:${d}\\n"
+#define SCCSSTR "@(#)${VERINFO}"
+#define VERSTR "${VERSTR}"
#define RELSTR "${RELEASE}"
char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;