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 22:34:26 +02:00
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
# Figure out where the git binary is.
|
2020-08-27 15:33:21 +02:00
|
|
|
.for _P in /usr/bin /usr/local/bin
|
|
|
|
. if !defined(GIT_CMD) || empty(GIT_CMD)
|
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 22:34:26 +02:00
|
|
|
. if exists(${_P}/git)
|
|
|
|
GIT_CMD= ${_P}/git
|
|
|
|
. endif
|
2020-08-27 15:33:21 +02:00
|
|
|
. endif
|
|
|
|
.endfor
|
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 22:34:26 +02:00
|
|
|
|
2020-08-29 17:30:21 +02:00
|
|
|
.if !empty(GIT_CMD) && exists(${GIT_CMD})
|
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 22:34:26 +02:00
|
|
|
# Set the git branch and hash to export where needed.
|
2020-08-29 17:31:23 +02:00
|
|
|
. if !defined(GITBRANCH) || empty(GITBRANCH)
|
2020-08-27 15:33:21 +02:00
|
|
|
GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
|
2020-08-29 17:31:23 +02:00
|
|
|
. export GITBRANCH
|
|
|
|
. endif
|
|
|
|
. if !defined(GITREV) || empty(GITREV)
|
2020-08-27 15:33:21 +02:00
|
|
|
GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true
|
2020-08-29 17:31:23 +02:00
|
|
|
. export GITREV
|
|
|
|
. endif
|
2020-12-16 19:40:49 +01:00
|
|
|
. if !defined(GITCOUNT) || empty(GITCOUNT)
|
2021-03-17 15:57:32 +01:00
|
|
|
GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --first-parent --count HEAD 2>/dev/null || true
|
2020-12-16 19:40:49 +01:00
|
|
|
. export GITCOUNT
|
|
|
|
. endif
|
2020-08-29 17:30:21 +02:00
|
|
|
.else
|
|
|
|
GITBRANCH= nullbranch
|
|
|
|
GITREV= nullhash
|
2020-12-16 19:40:49 +01:00
|
|
|
GITCOUNT= nullcount
|
2020-08-29 17:31:23 +02:00
|
|
|
. export GITBRANCH
|
|
|
|
. export GITREV
|
2020-12-16 19:40:49 +01:00
|
|
|
. export GITCOUNT
|
2020-08-29 17:30:21 +02:00
|
|
|
.endif
|
2020-08-12 18:25:25 +02:00
|
|
|
|
|
|
|
# Set the build date, primarily for snapshot builds.
|
|
|
|
.if !defined(BUILDDATE) || empty(BUILDDATE)
|
|
|
|
BUILDDATE!= date +%Y%m%d
|
|
|
|
.export BUILDDATE
|
|
|
|
.endif
|
2020-08-28 04:09:10 +02:00
|
|
|
|
2021-03-02 16:11:04 +01:00
|
|
|
# Override UNAME_r to allow building ports for a different branch.
|
|
|
|
UNAME_r= ${REVISION}-${BRANCH}
|
|
|
|
.export UNAME_r
|