diff options
author | Glen Barber <gjb@FreeBSD.org> | 2020-08-27 13:33:21 +0000 |
---|---|---|
committer | Glen Barber <gjb@FreeBSD.org> | 2020-08-27 13:33:21 +0000 |
commit | 6e7be14e7f1f2e1fbb6322d016b8a0ab062578e6 (patch) | |
tree | 06b29e1144bcd74e339506def8d4a1417c2e02fc /release/Makefile.inc1 | |
parent | bee3d446c4cd1c4317918c407551f3c197ff17db (diff) | |
download | src-test-6e7be14e7f1f2e1fbb6322d016b8a0ab062578e6.tar.gz src-test-6e7be14e7f1f2e1fbb6322d016b8a0ab062578e6.zip |
Adjust the logic to locating GIT_CMD.
Use 'git -C' instead of cd(1). [1]
Suggested by: garga [1]
Sponsored by: Rubicon Communications, LLC (netgate.com)
Notes
Notes:
svn path=/projects/release-git/; revision=364864
Diffstat (limited to 'release/Makefile.inc1')
-rw-r--r-- | release/Makefile.inc1 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/release/Makefile.inc1 b/release/Makefile.inc1 index 3f650f863659f..8fd38b966bd58 100644 --- a/release/Makefile.inc1 +++ b/release/Makefile.inc1 @@ -3,24 +3,24 @@ # # Figure out where the git binary is. -.if !defined(GIT_CMD) || empty(GIT_CMD) -. for _P in /usr/bin /usr/local/bin +.for _P in /usr/bin /usr/local/bin +. if !defined(GIT_CMD) || empty(GIT_CMD) . if exists(${_P}/git) GIT_CMD= ${_P}/git . endif -. endfor -. export GIT_CMD -.else +. endif +.endfor +.if !defined(GIT_CMD) && empty(GIT_CMD) . error "Git binary not found. Set GIT_CMD appropriately." .endif # Set the git branch and hash to export where needed. .if !defined(GITBRANCH) || empty(GITBRANCH) -GITBRANCH!= cd ${.CURDIR} && ${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///' +GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///' .export GITBRANCH .endif .if !defined(GITREV) || empty(GITREV) -GITREV!= cd ${.CURDIR} && ${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true +GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true .export GITREV .endif |