Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136973352
D4347.id17228.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D4347.id17228.diff
View Options
Index: sys/conf/newvers.sh
===================================================================
--- sys/conf/newvers.sh
+++ sys/conf/newvers.sh
@@ -30,6 +30,18 @@
# @(#)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.
+#
+# -R Reproducible build if the tree represents an unmodified
+# checkout from svn, p4 or git. Metadata is included if
+# the tree is modified.
+
TYPE="FreeBSD"
REVISION="11.0"
BRANCH="CURRENT"
@@ -162,6 +174,9 @@
if [ -n "$svnversion" ] ; then
svn=`cd ${SYSDIR} && $svnversion 2>/dev/null`
+ if expr "$svn" : ".*M" >/dev/null; then
+ modified=true
+ fi
case "$svn" in
[0-9]*) svn=" r${svn}" ;;
*) unset svn ;;
@@ -196,6 +211,7 @@
if $git_cmd --work-tree=${SYSDIR}/.. diff-index \
--name-only HEAD | read dummy; then
git="${git}-dirty"
+ modified=true
fi
fi
@@ -208,7 +224,10 @@
p4opened=`cd ${SYSDIR} && $p4_cmd opened ./... 2>&1`
case "$p4opened" in
File*) ;;
- //*) p4version="${p4version}+edit" ;;
+ //*)
+ p4version="${p4version}+edit"
+ modified=true
+ ;;
esac
;;
*) unset p4version ;;
@@ -227,10 +246,30 @@
fi
fi
+include_metadata=true
+while getopts Rr opt; do
+ case "$opt" in
+ r)
+ include_metadata=
+ ;;
+ R)
+ if [ -z "${modified}" ]; then
+ include_metadata=
+ fi
+ esac
+done
+shift $((OPTIND - 1))
+
+if [ -z "${include_metadata}" ]; then
+ VERSTR="${VERSION} ${svn}${git}${hg}${p4version}\\n"
+else
+ VERSTR="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\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 VERSTR "${VERSTR}"
#define RELSTR "${RELEASE}"
char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 9:24 PM (2 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25807300
Default Alt Text
D4347.id17228.diff (2 KB)
Attached To
Mode
D4347: Allow reproducible kernel builds by removing build metadata
Attached
Detach File
Event Timeline
Log In to Comment