Give development builds their own Debian package version

make deb versions a build that isn't a release after the last tag:
0.2.0~rc.1+git3.gca0f148, plus the build time (.m<UTC time>) with
uncommitted changes. apt sorts it after that RC and before the next, so
installing it over the RC or an older build is an upgrade and needs no
--reinstall. mkdeb.sh removes older packages of the same architecture
from dist/ so the install globs match one package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
abrown38andClaude Opus 5.5 committed 2026-10-09 15:28:18 +00:00
1 parent fb1ee09250
commit e1bcb5d479
4 files changed
+28 -2

No files matched your search

+5
View File
@@ -95,6 +95,11 @@ All notable changes to Jarl are documented here. The format follows
development builds and how far past the last tag they are: `dev development builds and how far past the last tag they are: `dev
ca0f148b78b6 (3 commits after v0.2.0-rc.1)`. In 0.2.0-rc.1 they still ca0f148b78b6 (3 commits after v0.2.0-rc.1)`. In 0.2.0-rc.1 they still
printed `0.2.0-rc.1 (ca0f148b78b6)`. printed `0.2.0-rc.1 (ca0f148b78b6)`.
- `make deb` gives development builds their own package version after
the last tag (`0.2.0~rc.1+git3.gca0f148`, plus the build time with
uncommitted changes). Installing one over the RC or an older build is
an upgrade: no more `apt install --reinstall`. It also removes older
packages from `dist/` (docs/development.md).
- The view in the zone list, and on the zone page, links to that view, - The view in the zone list, and on the zone page, links to that view,
and the views page highlights it. It used to be plain text, and the zone and the views page highlights it. It used to be plain text, and the zone
page linked to the views page as a whole. page linked to the views page as a whole.
+11 -2
View File
@@ -41,9 +41,18 @@ DESTDIR ?=
JARLD_BIN ?= bin/jarld JARLD_BIN ?= bin/jarld
JARL_BIN ?= bin/jarl JARL_BIN ?= bin/jarl
# make deb: the package's architecture (Debian name) and version. # make deb: the package's architecture (Debian name) and version. A
# release is VERSION with ~ for - (0.2.0-rc.1 -> 0.2.0~rc.1, which apt
# sorts before 0.2.0). A development build is versioned after the last
# tag: 3 commits past v0.2.0-rc.1 is 0.2.0~rc.1+git3.gca0f148, which apt
# sorts after that RC and before 0.2.0, so installing it upgrades without
# --reinstall. Uncommitted changes add the build time (.m20261009153000),
# so each such build is newer than the last.
DEB_ARCH ?= $(shell dpkg --print-architecture 2>/dev/null || go env GOARCH) DEB_ARCH ?= $(shell dpkg --print-architecture 2>/dev/null || go env GOARCH)
DEB_VERSION ?= $(subst -,~,$(VERSION)) DEB_DEV_VERSION := $(shell [ -n '$(DESCRIBE)' ] || exit 0; \
m=; git diff --quiet HEAD 2>/dev/null || m=.m$$(date -u +%Y%m%d%H%M%S); \
echo '$(DESCRIBE)' | sed -E 's/^v(.*)-([0-9]+)-g([0-9a-f]{7})[0-9a-f]*$$/\1+git\2.g\3/' | tr - '~' | sed "s/$$/$$m/")
DEB_VERSION ?= $(if $(RELEASE_TAG),$(subst -,~,$(VERSION)),$(or $(DEB_DEV_VERSION),$(subst -,~,$(VERSION))))
.PHONY: all build completion test vet e2e install install-files uninstall deb dist cli-dist clean .PHONY: all build completion test vet e2e install install-files uninstall deb dist cli-dist clean
+9
View File
@@ -252,6 +252,15 @@ it on Gitea). Only a release build reports a version number:
`RELEASE_TAG=v0.2.0 make` forces the first case. `RELEASE_TAG=v0.2.0 make` forces the first case.
`make deb` versions the packages the same way. A release gets `VERSION`
with `~` for `-` (`0.2.0~rc.1`). A development build gets a version after
the last tag: 3 commits past `v0.2.0-rc.1` is `0.2.0~rc.1+git3.gca0f148`,
and uncommitted changes add the build time (`.m20261009153000`). apt sorts
these after that RC and before the next one or `0.2.0`. So installing a
newer build over an older one, or over the RC, is an upgrade: plain
`apt install ./dist/…` works, without `--reinstall`. `make deb` removes
older packages of the same architecture from `dist/` first.
Pushing the same tag again (`git tag -f`, `git push -f`) re-runs it, and Pushing the same tag again (`git tag -f`, `git push -f`) re-runs it, and
the script replaces the attachments and packages, so a failed release can the script replaces the attachments and packages, so a failed release can
simply be retried. simply be retried.
+3
View File
@@ -54,6 +54,9 @@ fi
work=dist/deb/${DEB_VERSION}_${DEB_ARCH} work=dist/deb/${DEB_VERSION}_${DEB_ARCH}
stage=$work/stage stage=$work/stage
rm -rf "$work" rm -rf "$work"
# Older packages of this architecture (every development build has its
# own version), so 'apt install ./dist/jarl_*_amd64.deb' finds just one.
rm -f dist/jarl_*_"$DEB_ARCH".deb dist/jarl-cli_*_"$DEB_ARCH".deb
mkdir -p "$stage" mkdir -p "$stage"
# Binaries for the package's architecture (bin/ holds the host's, which # Binaries for the package's architecture (bin/ holds the host's, which