aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/newvers.sh
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2017-09-05 00:46:50 +0000
committerEd Maste <emaste@FreeBSD.org>2017-09-05 00:46:50 +0000
commit83de94911fe453adb04dfc6c9246905d549520a4 (patch)
treed16bc43928a8f707f5d8c43a48ea4ae367a3ad16 /sys/conf/newvers.sh
parentf57494dcf1504caafa6d7c6ca7de69b45707aeff (diff)
downloadsrc-83de94911fe453adb04dfc6c9246905d549520a4.tar.gz
src-83de94911fe453adb04dfc6c9246905d549520a4.zip
MFC r322798: newvers.sh: accommodate `git worktree`
newvers.sh looks for a .vcs subdirectory (e.g. .git, .svn) to determine which vcs info tool to run (e.g., git rev-parse, svn info). (As of r308789 in head / r323167 in stable/11 if a .vcs subdirectory is not found at ${TOPDIR} then newvers.sh walks up successive parent directories, testing for the .vcs subdirectory at each step. This is done in case the FreeBSD source is built in a subdirectory as part of some larger project, but either way newvers.sh still tests for the .vcs subdirectory.) However, when using git worktree there is no .git subdirectory but rather a plain text .git file which contains a reference to the main working tree. Change findvcs() to test that the .vcs entry exists, regardless of type. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/stable/11/; revision=323168
Diffstat (limited to 'sys/conf/newvers.sh')
-rw-r--r--sys/conf/newvers.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index ce444fcaa29e..348ccc7c11d2 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -62,7 +62,7 @@ findvcs()
savedir=$(pwd)
cd ${SYSDIR}/..
while [ $(pwd) != "/" ]; do
- if [ -d "./$1" ]; then
+ if [ -e "./$1" ]; then
VCSDIR=$(pwd)"/$1"
cd ${savedir}
return 0