Makefile.inc1:
- New file. Adds logic to search for the git binary, as well
as determining the branch and revision, used in various
places.
Makefile:
- Remove searching for the svn{,lite} binary.
Makefile.ec2:
- Reduce duplicated code, removing searching for the svn{,lite}
binary, in addition to EC2_SVN{BRANCH,REV}.
- Rename EC2_SVN* with GIT* for consistency.
Makefile.mirrors:
- Remove the SRCBRANCH declaration, replaced with the exported
GITBRANCH variable.
- Update _SNAP_SUFFIX from SVNREVISION to GITREV, and remove
the leading 'r' from it, since it will break git hashes.
- Remove yet another instance of duplicated code to search for
the svn{,version}lite binary.
Sponsored by: Rubicon Communications, LLC (netgate.com)
2020-07-16 20:34:26 +00:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# Figure out where the git binary is.
|
|
|
|
.if !defined(GIT_CMD) || empty(GIT_CMD)
|
|
|
|
. for _P in /usr/bin /usr/local/bin
|
|
|
|
. if exists(${_P}/git)
|
|
|
|
GIT_CMD= ${_P}/git
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. export GIT_CMD
|
|
|
|
.else
|
|
|
|
. 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)
|
2020-08-25 18:30:12 +00:00
|
|
|
GITBRANCH!= cd ${.CURDIR} && ${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
|
Makefile.inc1:
- New file. Adds logic to search for the git binary, as well
as determining the branch and revision, used in various
places.
Makefile:
- Remove searching for the svn{,lite} binary.
Makefile.ec2:
- Reduce duplicated code, removing searching for the svn{,lite}
binary, in addition to EC2_SVN{BRANCH,REV}.
- Rename EC2_SVN* with GIT* for consistency.
Makefile.mirrors:
- Remove the SRCBRANCH declaration, replaced with the exported
GITBRANCH variable.
- Update _SNAP_SUFFIX from SVNREVISION to GITREV, and remove
the leading 'r' from it, since it will break git hashes.
- Remove yet another instance of duplicated code to search for
the svn{,version}lite binary.
Sponsored by: Rubicon Communications, LLC (netgate.com)
2020-07-16 20:34:26 +00:00
|
|
|
.export GITBRANCH
|
|
|
|
.endif
|
|
|
|
.if !defined(GITREV) || empty(GITREV)
|
2020-08-25 18:30:12 +00:00
|
|
|
GITREV!= cd ${.CURDIR} && ${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true
|
Makefile.inc1:
- New file. Adds logic to search for the git binary, as well
as determining the branch and revision, used in various
places.
Makefile:
- Remove searching for the svn{,lite} binary.
Makefile.ec2:
- Reduce duplicated code, removing searching for the svn{,lite}
binary, in addition to EC2_SVN{BRANCH,REV}.
- Rename EC2_SVN* with GIT* for consistency.
Makefile.mirrors:
- Remove the SRCBRANCH declaration, replaced with the exported
GITBRANCH variable.
- Update _SNAP_SUFFIX from SVNREVISION to GITREV, and remove
the leading 'r' from it, since it will break git hashes.
- Remove yet another instance of duplicated code to search for
the svn{,version}lite binary.
Sponsored by: Rubicon Communications, LLC (netgate.com)
2020-07-16 20:34:26 +00:00
|
|
|
.export GITREV
|
|
|
|
.endif
|
2020-08-12 16:25:25 +00:00
|
|
|
|
|
|
|
# Set the build date, primarily for snapshot builds.
|
|
|
|
.if !defined(BUILDDATE) || empty(BUILDDATE)
|
|
|
|
BUILDDATE!= date +%Y%m%d
|
|
|
|
.export BUILDDATE
|
|
|
|
.endif
|