From a968352d16336398eb7eea3700cbff77fcae9e04 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 9 Nov 2026 13:18:38 +0100 Subject: [PATCH 1/3] pkg.sh: Retitle release commits "Release " The current "Start version" commit subject sits well in a history of commits where that commit is followed by commits which complete a release of that version on a respective platform. Those checkpoints are going to move out of commits to Git tags, with only one commit per version remaining. So, label the version bump commit simply "Release " instead. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0 Signed-off-by: Jan Lindemann --- scripts/pkg.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/pkg.sh b/scripts/pkg.sh index e3a2cffd..7ae7911d 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -293,7 +293,7 @@ check_release_is_current() check_update_version() { - local comment="Start version" + local comment="Release" set -- `getopt 'c:' "$@"` while [ "$1" != -- ] ; do case "$1" in @@ -312,7 +312,7 @@ check_update_version() [ "$next" ] || fatal "Failed to get next version." if [ "$next" != "$v" ]; then echo "$next-dev" > VERSION - scm_commit -m "$comment: $next" VERSION + scm_commit -m "$comment $next" VERSION return 0 fi return 1 @@ -1297,7 +1297,7 @@ build) cmd_build "$@" ;; release-reinstall) - check_update_version -c "Start version" + check_update_version cmd_build "$@" cmd_upload ;; -- 2.56.1 From bb1353cfb34ba45ea1ce02f69c899f1e21076275 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 9 Nov 2026 13:17:00 +0100 Subject: [PATCH 2/3] pkg.sh: Use tags instead of RELEASES file If a release on a platform is due is decided by checking if the version / platform / architecture combination is recorded in RELEASES. This commit moves that bookkeeping from RELEASES to Git tag. Create a git tag per release, named after the version and the platform of the RELEASES entry, so "kali-rolling/amd64: 1.0.0-288" becomes the tag v1.0.0-288@kali-rolling/amd64, and push the branch commit and the tag. The tag message keeps the previous commit message, "Release @". Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0 Signed-off-by: Jan Lindemann --- scripts/pkg.sh | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/scripts/pkg.sh b/scripts/pkg.sh index 7ae7911d..dda435eb 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -85,6 +85,13 @@ write_map() cmd_version -p `platform` $1 write $2 } +release_tags() +{ + # a release of a version on a platform is tagged + # v@ + git tag -l "v*@`platform`" +} + find_path() { local p @@ -177,12 +184,6 @@ increase_build_no() check_next_version() { local v=`read_map $TOPDIR/VERSION | sed 's/-dev//'` - local n=`read_map -n $TOPDIR/RELEASES | sed 's/-dev//'` - if [ "$n" != "$v" ]; then - echo "+ $PKG_PROJECT version is already at $v, no need to increase for release" >&2 - echo $v - return - fi local h=`calculate_hash` [ -n "$h" ] || fatal "failed to calculate source hash" if [ ! -f $TOPDIR/HASH ]; then @@ -190,7 +191,7 @@ check_next_version() echo $v return fi - if ! read_map $TOPDIR/HASH | grep -q $h; then + if ! grep -q $h $TOPDIR/HASH; then echo "+ $PKG_PROJECT has no matching HASH value, needs release" >&2 increase_build_no $v return @@ -274,8 +275,8 @@ check_release_is_current() done shift - if ! read_map -n $TOPDIR/RELEASES | grep -Fq $next; then - echo "next version $next is not in RELEASES, needs release" >&2 + if ! release_tags | grep -qF "v$next@"; then + echo "next version $next is not released on `platform`, needs release" >&2 return 1 fi @@ -311,8 +312,12 @@ check_update_version() local next=`check_next_version` [ "$next" ] || fatal "Failed to get next version." if [ "$next" != "$v" ]; then + local h=`calculate_hash` + [ -n "$h" ] || fatal "failed to calculate source hash" echo "$next-dev" > VERSION - scm_commit -m "$comment $next" VERSION + write_map $TOPDIR/HASH $h + $SCM add $TOPDIR/HASH || true + scm_commit -m "$comment $next" VERSION $TOPDIR/HASH return 0 fi return 1 @@ -373,6 +378,7 @@ cmd_version() case $cmd in read) + [ -f "$file" ] || return 0 local p=`echo $platform | sed 's%/%\\\/%g'` local v=`sed "/$p:/ !d; s/$p: *//" $file` [ "$v" ] && { @@ -609,8 +615,6 @@ upload_pkg() set -e local p local v=`read_map $TOPDIR/VERSION | sed 's/-dev//'` - local h=`calculate_hash` - [ -n "$h" ] || fatal "failed to calculate source hash" case $PKG_FORMAT in rpm) server=pkg.janware.com @@ -657,17 +661,12 @@ upload_pkg() ;; esac - write_map $TOPDIR/RELEASES $v - $SCM add $TOPDIR/RELEASES || true - write_map $TOPDIR/HASH $h - $SCM add $TOPDIR/HASH || true echo "+ scheduling rebuild" $SSH -l root $server /opt/packager-server/bin/packager-server schedule-rebuild - scm_commit -m "Release $v@`platform`" $TOPDIR/RELEASES $TOPDIR/HASH - if [ "$SCM" = git ]; then - # Don't use extra options, they might contain -l - JW_PKG_SSH_EXTRA_OPTS="" git push || fatal "Failed to push changes to RELEASES and HASH" - fi + local tag="v$v@`platform`" + git tag -m "Release $v@`platform`" "$tag" || fatal "Failed to tag the release as $tag" + # Don't use extra options, they might contain -l + JW_PKG_SSH_EXTRA_OPTS="" git push origin HEAD "$tag" || fatal "Failed to push the release commit and tag $tag" } install_exe_wrapper() -- 2.56.1 From a24769a8405c8fa4939ee672c24fa08103b95eb2 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 10 Nov 2026 06:58:48 +0100 Subject: [PATCH 3/3] pkg.sh: Drop the RELEASES file in the release commit The release tags replace the RELEASES bookkeeping, but the file is still tracked in jw-pkg and in every other project repo, and removing it by hand in each of them does not scale. Make check_update_version() remove the RELEASES file from the tree in the release commit itself when it is still there, so the next release of each project drops it automatically. The removal is git only, as the release flow is; a repo without a tracked RELEASES file is unaffected. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0 Signed-off-by: Jan Lindemann --- scripts/pkg.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/pkg.sh b/scripts/pkg.sh index dda435eb..f9064243 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -314,10 +314,17 @@ check_update_version() if [ "$next" != "$v" ]; then local h=`calculate_hash` [ -n "$h" ] || fatal "failed to calculate source hash" + local files="VERSION $TOPDIR/HASH" + # the release tags replace the RELEASES file; the + # release commit drops it from the tree + if [ "$SCM" = git ] && [ -f $TOPDIR/RELEASES ] && \ + git rm -qf $TOPDIR/RELEASES 2>/dev/null; then + files="$files $TOPDIR/RELEASES" + fi echo "$next-dev" > VERSION write_map $TOPDIR/HASH $h $SCM add $TOPDIR/HASH || true - scm_commit -m "$comment $next" VERSION $TOPDIR/HASH + scm_commit -m "$comment $next" $files return 0 fi return 1 -- 2.56.1