detached 70424d4

fix(packaging): temp dir removed on failure, module cache in srcdir, one package in dist

commit
70424d47407281690e093fb877c7c2b310f4efe6
author
brice · · 2026-09-26 06:21 UTC
parent
9cbbe26
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +10 -8
M Makefile +6 -6
@@ -52,12 +52,12 @@ check: vet test arch fakes-check
5252 pkg: SHELL := bash
5353 pkg: .SHELLFLAGS := -eo pipefail -c
5454 pkg:
55- @git diff --quiet HEAD || echo "warning: uncommitted changes are not packaged" >&2
55+ @test -z "$$(git status --porcelain)" || echo "warning: uncommitted changes are not packaged" >&2
5656 v=$$(t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \
5757 echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)"); \
58- d=$$(mktemp -d /tmp/nefertty-pkg.XXXXXX); \
59- git archive --prefix=nefertty-$$v/ -o $$d/nefertty-$$v.tar.gz HEAD; \
60- cp packaging/arch/PKGBUILD $$d/; \
61- cd $$d && sed -i "s/^pkgver=.*/pkgver=$$v/; s/^sha256sums=.*/sha256sums=('$$(sha256sum *.tar.gz | cut -d' ' -f1)')/" PKGBUILD; \
62- makepkg -f --noconfirm; mkdir -p $(CURDIR)/dist; mv *.pkg.tar.zst $(CURDIR)/dist/; cd /; rm -rf $$d
58+ d=$$(mktemp -d /tmp/nefertty-pkg.XXXXXX); trap 'rm -rf "$$d"' EXIT; \
59+ git archive --prefix=nefertty-$$v/ -o "$$d/nefertty-$$v.tar.gz" HEAD; \
60+ cp packaging/arch/PKGBUILD "$$d/"; \
61+ cd "$$d" && sed -i "s/^pkgver=.*/pkgver=$$v/; s/^sha256sums=.*/sha256sums=('$$(sha256sum *.tar.gz | cut -d' ' -f1)')/" PKGBUILD; \
62+ makepkg -f --noconfirm; mkdir -p $(CURDIR)/dist; rm -f $(CURDIR)/dist/nefertty-*.pkg.tar.zst; mv *.pkg.tar.zst $(CURDIR)/dist/
6363 @ls dist/*.pkg.tar.zst
@@ -52,12 +52,12 @@ check: vet test arch fakes-check
52 pkg: SHELL := bash52 pkg: SHELL := bash
53 pkg: .SHELLFLAGS := -eo pipefail -c53 pkg: .SHELLFLAGS := -eo pipefail -c
54 pkg:54 pkg:
55- @git diff --quiet HEAD || echo "warning: uncommitted changes are not packaged" >&255+ @test -z "$$(git status --porcelain)" || echo "warning: uncommitted changes are not packaged" >&2
56 v=$$(t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \56 v=$$(t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \
57 echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)"); \57 echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)"); \
58- d=$$(mktemp -d /tmp/nefertty-pkg.XXXXXX); \58+ d=$$(mktemp -d /tmp/nefertty-pkg.XXXXXX); trap 'rm -rf "$$d"' EXIT; \
59- git archive --prefix=nefertty-$$v/ -o $$d/nefertty-$$v.tar.gz HEAD; \59+ git archive --prefix=nefertty-$$v/ -o "$$d/nefertty-$$v.tar.gz" HEAD; \
60- cp packaging/arch/PKGBUILD $$d/; \60+ cp packaging/arch/PKGBUILD "$$d/"; \
61- cd $$d && sed -i "s/^pkgver=.*/pkgver=$$v/; s/^sha256sums=.*/sha256sums=('$$(sha256sum *.tar.gz | cut -d' ' -f1)')/" PKGBUILD; \61+ cd "$$d" && sed -i "s/^pkgver=.*/pkgver=$$v/; s/^sha256sums=.*/sha256sums=('$$(sha256sum *.tar.gz | cut -d' ' -f1)')/" PKGBUILD; \
62- makepkg -f --noconfirm; mkdir -p $(CURDIR)/dist; mv *.pkg.tar.zst $(CURDIR)/dist/; cd /; rm -rf $$d62+ makepkg -f --noconfirm; mkdir -p $(CURDIR)/dist; rm -f $(CURDIR)/dist/nefertty-*.pkg.tar.zst; mv *.pkg.tar.zst $(CURDIR)/dist/
63 @ls dist/*.pkg.tar.zst63 @ls dist/*.pkg.tar.zst
M README.md +2 -0
@@ -31,6 +31,8 @@ NeferTTY depends on tagged releases of [purego-libwayland](https://github.com/bn
3131 go work init . ../purego-libwayland ../purego-vulkan
3232 ```
3333
34+`make pkg` ignores the workspace and builds the versions in `go.mod`: tag a binding change and update `go.mod` before packaging it.
35+
3436 ## Configuration
3537
3638 Configuration lives at `$XDG_CONFIG_HOME/nefertty/config` (or `~/.config/nefertty/config`). Use `nefertty --config path` to select another file; `nefertty validate-config [path]` checks it without starting the compositor.
@@ -31,6 +31,8 @@ NeferTTY depends on tagged releases of [purego-libwayland](https://github.com/bn
31 go work init . ../purego-libwayland ../purego-vulkan31 go work init . ../purego-libwayland ../purego-vulkan
32 ```32 ```
33 33
34+`make pkg` ignores the workspace and builds the versions in `go.mod`: tag a binding change and update `go.mod` before packaging it.
35+
34 ## Configuration36 ## Configuration
35 37
36 Configuration lives at `$XDG_CONFIG_HOME/nefertty/config` (or `~/.config/nefertty/config`). Use `nefertty --config path` to select another file; `nefertty validate-config [path]` checks it without starting the compositor.38 Configuration lives at `$XDG_CONFIG_HOME/nefertty/config` (or `~/.config/nefertty/config`). Use `nefertty --config path` to select another file; `nefertty validate-config [path]` checks it without starting the compositor.
M cmd/nefertty/main.go +1 -1
@@ -104,7 +104,7 @@ func run() error {
104104 }
105105 v := info.Main.Version
106106 if version != "" {
107- v = version // set by release builds (make dist)
107+ v = version // set by packaged builds (PKGBUILD -X main.version)
108108 } else if v == "" {
109109 v = "(devel)"
110110 }
@@ -104,7 +104,7 @@ func run() error {
104 }104 }
105 v := info.Main.Version105 v := info.Main.Version
106 if version != "" {106 if version != "" {
107- v = version // set by release builds (make dist)107+ v = version // set by packaged builds (PKGBUILD -X main.version)
108 } else if v == "" {108 } else if v == "" {
109 v = "(devel)"109 v = "(devel)"
110 }110 }
M packaging/arch/PKGBUILD +1 -1
@@ -19,7 +19,7 @@ sha256sums=('SKIP')
1919
2020 prepare() {
2121 cd "$pkgname-$pkgver"
22- export GOFLAGS='-mod=mod' GOWORK=off GOTOOLCHAIN=local
22+ export GOPATH="$srcdir/gopath" GOFLAGS='-mod=readonly -modcacherw' GOWORK=off GOTOOLCHAIN=local
2323 go mod download
2424 go mod vendor
2525 }
@@ -19,7 +19,7 @@ sha256sums=('SKIP')
19 19
20 prepare() {20 prepare() {
21 cd "$pkgname-$pkgver"21 cd "$pkgname-$pkgver"
22- export GOFLAGS='-mod=mod' GOWORK=off GOTOOLCHAIN=local22+ export GOPATH="$srcdir/gopath" GOFLAGS='-mod=readonly -modcacherw' GOWORK=off GOTOOLCHAIN=local
23 go mod download23 go mod download
24 go mod vendor24 go mod vendor
25 }25 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 25

Tags 10

↑↓ moveenter openesc close