diff options
author | ian <ian@FreeBSD.org> | 2013-09-28 16:39:46 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2013-09-28 16:39:46 +0000 |
commit | 797b9c8d73c61673ccff89e5a1134ae939515682 (patch) | |
tree | 4bcae28a231177b0e5ad45539de05cc02b1ae19a /sys/conf | |
parent | 76fc3e6b8cc292f2edc72be38e42c5f7966e1ec0 (diff) | |
download | FreeBSD-src-797b9c8d73c61673ccff89e5a1134ae939515682.zip FreeBSD-src-797b9c8d73c61673ccff89e5a1134ae939515682.tar.gz |
Allow the path to the system source directory to be passed in to
newvers.sh. Pass it in from include/Makefile. If it isn't passed in,
fall back to the old logic of using dirname $0.
Using dirname $0 does not yield the path to the script if it was
sourced in from another script in another directory; you end up with
the parent script's path. That was causing newvers.sh to look one
level below the FreeBSD src/ directory when building osreldate.h and it
may find something like a git or svn repo there that has nothing to do
with FreeBSD.
PR: 174422
Approved by: re ()
MFC after: 2 weeks
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/newvers.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 6a0c18c..2f23b12 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -38,7 +38,10 @@ if [ "X${BRANCH_OVERRIDE}" != "X" ]; then fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" -SYSDIR=$(dirname $0)/.. + +if [ "X${SYSDIR}" = "X" ]; then + SYSDIR=$(dirname $0)/.. +fi if [ "X${PARAMFILE}" != "X" ]; then RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ |