Skip to content

Commit

Permalink
pkg: compute CORE_NEXT to do automated tag matching
Browse files Browse the repository at this point in the history
If CORE_NEXT.b tag exists do not use anything else anymore,
otherwise if CORE_NEXT* something exists use this, otherwise
hands off from manual tag pattern matching.

Since this is based on computation of CORE_ABI input we
can use this on the development track to always figure out
the correct version to use without checking the CORE_ABI
explicitly.

Use CORE_NEXT in a file replacement as well.
  • Loading branch information
fichtner committed Feb 7, 2021
1 parent ae7bbba commit 3dcc9f5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
26 changes: 19 additions & 7 deletions Makefile
Expand Up @@ -32,13 +32,25 @@ CORE_ABI?= 21.1
CORE_PHP?= 73
CORE_PYTHON?= 37

.if exists(${GIT}) && exists(${GITVERSION})
. if ${CORE_ABI} == "21.1"
CORE_COMMIT!= ${GITVERSION} --match=21.7\*
. elif ${CORE_ABI} == "20.7"
CORE_COMMIT!= ${GITVERSION} --match=21.1.b
. else
CORE_COMMIT!= ${GITVERSION}
_CORE_NEXT= ${CORE_ABI:C/\./ /}
.if ${_CORE_NEXT:[2]} == 7
CORE_NEXT!= expr ${_CORE_NEXT:[1]} + 1
CORE_NEXT:= ${CORE_NEXT}.1
.else
CORE_NEXT= ${_CORE_NEXT:[1]}
CORE_NEXT:= ${CORE_NEXT}.7
.endif

.if exists(${GIT})
. if exists(${GITVERSION})
_NEXTBETA!= ${GIT} tag -l ${CORE_NEXT}.b
_NEXTDEVEL!= ${GIT} tag -l ${CORE_NEXT}\*
. if !empty(_NEXTBETA)
_NEXTMATCH= --match=${CORE_NEXT}.b
. elif !empt(_NEXTDEVEL)
_NEXTMATCH= --match=${CORE_NEXT}\*
. endif
CORE_COMMIT!= ${GITVERSION} ${_NEXTMATCH}
. endif
.else
CORE_COMMIT= unknown 0 undefined
Expand Down
1 change: 1 addition & 0 deletions Mk/defaults.mk
Expand Up @@ -85,6 +85,7 @@ REPLACEMENTS= CORE_ABI \
CORE_HASH \
CORE_MAINTAINER \
CORE_NAME \
CORE_NEXT \
CORE_PACKAGESITE \
CORE_PKGVERSION \
CORE_PRODUCT \
Expand Down
Expand Up @@ -50,7 +50,7 @@
s" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" logo+
s" @@@@@@@@@@@@@@@@@@@@@@@@@@@@ " logo+
s" #[m " logo+
s" 21.7 ``The Road Ahead'' #[m" logo+
s" %%CORE_NEXT%% ``The Road Ahead'' #[m" logo+

2drop
;

0 comments on commit 3dcc9f5

Please sign in to comment.