make: support CORE_TREE and related plumbing

Rename CORE_COMMIT to make it less ambiguous as CORE_HASH is the
commit hash and CORE_TREE is the tree hash.  It was also in the
metadata for no apparent reason.
This commit is contained in:
Franco Fichtner committed 2026-11-20 18:44:48 +00:00
1 parent 002c832fd9
commit 526cdfce26
6 files changed
+22 -15

No files matched your search

+5 -5
View File
@@ -87,13 +87,13 @@ _NEXTMATCH= --match=${CORE_ABI}\*
. if empty(_NEXTMATCH)
. error Did not find appropriate tag for CORE_ABI=${CORE_ABI}
. endif
CORE_COMMIT!= ${GITVERSION} ${_NEXTMATCH}
CORE_SOURCE!= ${GITVERSION} ${_NEXTMATCH}
.endif
CORE_COMMIT?= unknown 0 undefined
CORE_VERSION?= ${CORE_COMMIT:[1]}
CORE_REVISION?= ${CORE_COMMIT:[2]}
CORE_HASH?= ${CORE_COMMIT:[3]}
CORE_SOURCE?= unknown 0 undefined mismatch
CORE_VERSION?= ${CORE_SOURCE:[1]}
CORE_REVISION?= ${CORE_SOURCE:[2]}
CORE_HASH?= ${CORE_SOURCE:[3]}
_CORE_SERIES= ${CORE_VERSION:S/./ /g}
CORE_SERIES?= ${_CORE_SERIES:[1]}.${_CORE_SERIES:[2]}
+1 -1
View File
@@ -75,7 +75,6 @@ VERSIONFILE= opnsense/version/core
REPLACEMENTS= CORE_ABI \
CORE_ARCH \
CORE_COMMIT \
CORE_CONFLICTS \
CORE_COPYRIGHT_HOLDER \
CORE_COPYRIGHT_WWW \
@@ -94,6 +93,7 @@ REPLACEMENTS= CORE_ABI \
CORE_SERIES \
CORE_SERIES_FW \
CORE_SYSLOGNG \
CORE_TREE \
CORE_UID \
CORE_USER \
CORE_VERSION \
+4 -3
View File
@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2026 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -29,6 +29,7 @@ set -e
VERSION=$(git describe --abbrev=0 --always ${1})
REVISION=$(git rev-list ${VERSION}.. --count)
HASH=$(git rev-list HEAD --max-count=1 | cut -c1-9)
COMMIT=$(git rev-parse --short=9 HEAD)
TREE=$(git rev-parse 'HEAD^{tree}')
echo ${VERSION} ${REVISION} ${HASH}
echo ${VERSION} ${REVISION} ${COMMIT} ${TREE}
+5 -3
View File
@@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 2018-2025 Franco Fichtner <franco@opnsense.org>
.\" Copyright (c) 2018-2026 Franco Fichtner <franco@opnsense.org>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 14, 2026
.Dd November 20, 2026
.Dt OPNSENSE-VERSION 8
.Os
.Sh NAME
@@ -32,7 +32,7 @@
.Nd OPNsense version utility
.Sh SYNOPSIS
.Nm
.Op Fl AaCDefHilNnsVvwx
.Op Fl AaCDefHilNnsTtVvwx
.Op Ar package
.Nm
.Fl ( c | O | o | Fl R Ar tag_or_file )
@@ -101,6 +101,8 @@ by expanding the full string or file given.
This feature is restricted to the root user.
.It Fl s
Return the accumulated file size of the package.
.It Fl T
Return the package tree hash.
.It Fl t
Return the support tier level of the package.
.It Fl V
+3 -2
View File
@@ -1,7 +1,6 @@
{
"CORE_ABI": "%%CORE_ABI%%",
"CORE_ARCH": "%%CORE_ARCH%%",
"CORE_COMMIT": "%%CORE_COMMIT%%",
"CORE_CONFLICTS": "%%CORE_CONFLICTS%%",
"CORE_COPYRIGHT_HOLDER": "%%CORE_COPYRIGHT_HOLDER%%",
"CORE_COPYRIGHT_WWW": "%%CORE_COPYRIGHT_WWW%%",
@@ -17,9 +16,10 @@
"CORE_PKGVERSION": "%%CORE_PKGVERSION%%",
"CORE_PRODUCT": "%%CORE_PRODUCT%%",
"CORE_PYTHON_DOT": "%%CORE_PYTHON_DOT%%",
"CORE_SERIES_FW": "%%CORE_SERIES_FW%%",
"CORE_SERIES": "%%CORE_SERIES%%",
"CORE_SERIES_FW": "%%CORE_SERIES_FW%%",
"CORE_SYSLOGNG": "%%CORE_SYSLOGNG%%",
"CORE_TREE": "%%CORE_TREE%%",
"CORE_UID": "%%CORE_UID%%",
"CORE_USER": "%%CORE_USER%%",
"CORE_VERSION": "%%CORE_VERSION%%",
@@ -37,6 +37,7 @@
"product_nickname": "%%CORE_NICKNAME%%",
"product_series": "%%CORE_SERIES%%",
"product_tier": "1",
"product_tree": "%%CORE_TREE%%",
"product_version": "%%CORE_PKGVERSION%%",
"product_website": "%%CORE_WWW%%"
}
+4 -1
View File
@@ -44,7 +44,7 @@ ensure_root()
fi
}
while getopts AaCcDeHilNnOoR:stVvwx OPT; do
while getopts AaCcDeHilNnOoR:sTtVvwx OPT; do
case ${OPT} in
A)
OUTPUT="${OUTPUT} \${product_arch}"
@@ -93,6 +93,9 @@ while getopts AaCcDeHilNnOoR:stVvwx OPT; do
s)
OUTPUT="${OUTPUT} \${product_size}"
;;
T)
OUTPUT="${OUTPUT} \${product_tree}"
;;
t)
OUTPUT="${OUTPUT} \${product_tier}"
;;