aboutsummaryrefslogtreecommitdiff
path: root/release/Makefile.inc1
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2020-08-29 15:30:21 +0000
committerGlen Barber <gjb@FreeBSD.org>2020-08-29 15:30:21 +0000
commit52a8a2de0f17b321b9b82dbbd4951a37d11aa0da (patch)
treea5223f1791491dcc88e577f4bc07c94cdb2f0a70 /release/Makefile.inc1
parent8f82b5d4e3fb6f4d6edec03b85de986d360b90be (diff)
downloadsrc-52a8a2de0f17b321b9b82dbbd4951a37d11aa0da.tar.gz
src-52a8a2de0f17b321b9b82dbbd4951a37d11aa0da.zip
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)
Notes
Notes: svn path=/head/; revision=364957
Diffstat (limited to 'release/Makefile.inc1')
-rw-r--r--release/Makefile.inc110
1 files changed, 7 insertions, 3 deletions
diff --git a/release/Makefile.inc1 b/release/Makefile.inc1
index 0cd88f84460c..00a6861686c4 100644
--- a/release/Makefile.inc1
+++ b/release/Makefile.inc1
@@ -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/\^\///'
@@ -23,6 +21,12 @@ GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | s
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
# Set the build date, primarily for snapshot builds.
.if !defined(BUILDDATE) || empty(BUILDDATE)