Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Aug 2020 15:30:21 +0000 (UTC)
From:      Glen Barber <gjb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364957 - head/release
Message-ID:  <202008291530.07TFULLm017629@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gjb
Date: Sat Aug 29 15:30:21 2020
New Revision: 364957
URL: https://svnweb.freebsd.org/changeset/base/364957

Log:
  Avoid the build from falling over if devel/git is not installed
  on the system.  Set a null branch/hash in this case, to avoid
  undefined GITREV/GITBRANCH variables from falling over in other
  areas.
  
  Reported by:	many
  Sponsored by:	Rubicon Communications, LLC (netgate.com)

Modified:
  head/release/Makefile.inc1

Modified: head/release/Makefile.inc1
==============================================================================
--- head/release/Makefile.inc1	Sat Aug 29 15:13:07 2020	(r364956)
+++ head/release/Makefile.inc1	Sat Aug 29 15:30:21 2020	(r364957)
@@ -10,10 +10,8 @@ GIT_CMD=   ${_P}/git
 .  endif
 . endif
 .endfor
-.if !defined(GIT_CMD) && empty(GIT_CMD)
-. error "Git binary not found.  Set GIT_CMD appropriately."
-.endif
 
+.if !empty(GIT_CMD) && exists(${GIT_CMD})
 # Set the git branch and hash to export where needed.
 .if !defined(GITBRANCH) || empty(GITBRANCH)
 GITBRANCH!=	${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
@@ -21,6 +19,12 @@ GITBRANCH!=	${GIT_CMD} -C ${.CURDIR} rev-parse --abbre
 .endif
 .if !defined(GITREV) || empty(GITREV)
 GITREV!=	${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true
+.export GITREV
+.endif
+.else
+GITBRANCH=	nullbranch
+GITREV=		nullhash
+.export GITBRANCH
 .export GITREV
 .endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008291530.07TFULLm017629>