From c33e89621813cc89d67acb01368d9760901bfab7 Mon Sep 17 00:00:00 2001 From: gjb Date: Wed, 16 Dec 2020 18:40:49 +0000 Subject: [PATCH] Append the branch commit count to _SNAP_SUFFIX for development snapshot builds. Sponsored by: Rubicon Communications, LLC (netgate.com) --- release/Makefile.inc1 | 6 ++++++ release/Makefile.mirrors | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/release/Makefile.inc1 b/release/Makefile.inc1 index d9b4b6b393d..64f7c6e049a 100644 --- a/release/Makefile.inc1 +++ b/release/Makefile.inc1 @@ -21,11 +21,17 @@ 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 +. if !defined(GITCOUNT) || empty(GITCOUNT) +GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --count HEAD 2>/dev/null || true +. export GITCOUNT +. endif .else GITBRANCH= nullbranch GITREV= nullhash +GITCOUNT= nullcount . export GITBRANCH . export GITREV +. export GITCOUNT .endif # Set the build date, primarily for snapshot builds. diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors index 6e79bc00599..522844a6b05 100644 --- a/release/Makefile.mirrors +++ b/release/Makefile.mirrors @@ -33,7 +33,7 @@ TLD?= ${FTPDIR}/snapshots .if !defined(BUILDDATE) || empty(BUILDDATE) BUILDDATE!= date +%Y%m%d .endif -_SNAP_SUFFIX:= ${BUILDDATE}-${GITREV} +_SNAP_SUFFIX:= ${BUILDDATE}-${GITREV}-${GITCOUNT} .else # release SNAPSHOT= -- 2.45.0