Date: Thu, 27 Aug 2020 13:33:21 +0000 (UTC) From: Glen Barber <gjb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r364864 - projects/release-git/release Message-ID: <202008271333.07RDXLie021828@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gjb Date: Thu Aug 27 13:33:21 2020 New Revision: 364864 URL: https://svnweb.freebsd.org/changeset/base/364864 Log: 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) Modified: projects/release-git/release/Makefile.inc1 Modified: projects/release-git/release/Makefile.inc1 ============================================================================== --- projects/release-git/release/Makefile.inc1 Thu Aug 27 13:26:36 2020 (r364863) +++ projects/release-git/release/Makefile.inc1 Thu Aug 27 13:33:21 2020 (r364864) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008271333.07RDXLie021828>