diff options
author | Will Andrews <will@FreeBSD.org> | 2018-07-01 01:09:52 +0000 |
---|---|---|
committer | Will Andrews <will@FreeBSD.org> | 2018-07-01 01:09:52 +0000 |
commit | 7d4a3185c95a5a83ca8487aef5b0ea673307ea9d (patch) | |
tree | e76e7e15b210313d2421e29ef9e41d3d98c4a872 /tools/build | |
parent | f25b23cf892e54ef4e10705a6aca460610233663 (diff) | |
download | src-7d4a3185c95a5a83ca8487aef5b0ea673307ea9d.tar.gz src-7d4a3185c95a5a83ca8487aef5b0ea673307ea9d.zip |
beinstall: enable use with git worktrees.
Notes
Notes:
svn path=/head/; revision=335831
Diffstat (limited to 'tools/build')
-rwxr-xr-x | tools/build/beinstall.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/build/beinstall.sh b/tools/build/beinstall.sh index 94b25c59af24..a24fc2ad7787 100755 --- a/tools/build/beinstall.sh +++ b/tools/build/beinstall.sh @@ -101,7 +101,8 @@ trap 'errx "Interrupt caught"' HUP INT TERM objdir=$(make -V .OBJDIR 2>/dev/null) [ ! -d "${objdir}" ] && errx "Must have built FreeBSD from source tree" -if [ -d .git ] ; then +# May be a worktree, in which case .git is a file, not a directory. +if [ -e .git ] ; then commit_time=$(git show --format='%ct' 2>/dev/null | head -1) [ $? -ne 0 ] && errx "Can't lookup git commit timestamp" commit_ts=$(date -r ${commit_time} '+%Y%m%d.%H%M%S') |