From owner-svn-src-projects@freebsd.org Thu Aug 27 13:33:22 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FA5F3B1F71 for ; Thu, 27 Aug 2020 13:33:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BckFZ0Cf8z4dLb; Thu, 27 Aug 2020 13:33:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E035C249C7; Thu, 27 Aug 2020 13:33:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RDXLD8021829; Thu, 27 Aug 2020 13:33:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RDXLie021828; Thu, 27 Aug 2020 13:33:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008271333.07RDXLie021828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 27 Aug 2020 13:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r364864 - projects/release-git/release X-SVN-Group: projects X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: projects/release-git/release X-SVN-Commit-Revision: 364864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 13:33:22 -0000 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