detached b461107

fix(aur): address PR review comments for PKGBUILD and tests

commit
b46110783ea12345a76c23450750565a796093d7
author
bnema · · 2025-12-30 21:47 UTC
parent
9712982
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +20 -19
M .github/workflows/aur.yml +6 -2
@@ -1,5 +1,9 @@
11 name: AUR Publish
22
3+# This workflow only publishes the dumber-browser-bin package to AUR.
4+# The dumber-browser-git package does not need automated updates since it
5+# always builds from the latest source using `git+https://` in its PKGBUILD.
6+
37 on:
48 workflow_run:
59 workflows: ["Flatpak"]
@@ -96,11 +100,11 @@ jobs:
96100 " 'SKIP')" \
97101 '' \
98102 'package() {' \
99- ' cd "dumber_${pkgver}"' \
103+ ' cd "${srcdir}"' \
100104 ' install -Dm755 dumber "${pkgdir}/usr/bin/dumber"' \
101105 ' install -Dm644 "${srcdir}/dev.bnema.Dumber.desktop" "${pkgdir}/usr/share/applications/dev.bnema.Dumber.desktop"' \
102106 ' install -Dm644 "${srcdir}/logo-512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/dev.bnema.Dumber.png"' \
103- ' install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"' \
107+ ' install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"' \
104108 '}' \
105109 > pkgbuild/dumber-browser-bin/PKGBUILD
106110
@@ -1,5 +1,9 @@
1 name: AUR Publish1 name: AUR Publish
2 2
3+# This workflow only publishes the dumber-browser-bin package to AUR.
4+# The dumber-browser-git package does not need automated updates since it
5+# always builds from the latest source using `git+https://` in its PKGBUILD.
6+
3 on:7 on:
4 workflow_run:8 workflow_run:
5 workflows: ["Flatpak"]9 workflows: ["Flatpak"]
@@ -96,11 +100,11 @@ jobs:
96 " 'SKIP')" \100 " 'SKIP')" \
97 '' \101 '' \
98 'package() {' \102 'package() {' \
99- ' cd "dumber_${pkgver}"' \103+ ' cd "${srcdir}"' \
100 ' install -Dm755 dumber "${pkgdir}/usr/bin/dumber"' \104 ' install -Dm755 dumber "${pkgdir}/usr/bin/dumber"' \
101 ' install -Dm644 "${srcdir}/dev.bnema.Dumber.desktop" "${pkgdir}/usr/share/applications/dev.bnema.Dumber.desktop"' \105 ' install -Dm644 "${srcdir}/dev.bnema.Dumber.desktop" "${pkgdir}/usr/share/applications/dev.bnema.Dumber.desktop"' \
102 ' install -Dm644 "${srcdir}/logo-512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/dev.bnema.Dumber.png"' \106 ' install -Dm644 "${srcdir}/logo-512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/dev.bnema.Dumber.png"' \
103- ' install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"' \107+ ' install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"' \
104 '}' \108 '}' \
105 > pkgbuild/dumber-browser-bin/PKGBUILD109 > pkgbuild/dumber-browser-bin/PKGBUILD
106 110
M aur/dumber-browser-bin/PKGBUILD +2 -2
@@ -26,9 +26,9 @@ sha256sums=('c8230e3a5258333fed401439b08c6ef7b0681dd14f4e97a7e837dfc2c4cc83a0'
2626 'SKIP')
2727
2828 package() {
29- cd "dumber_${pkgver}"
29+ cd "${srcdir}"
3030 install -Dm755 dumber "${pkgdir}/usr/bin/dumber"
3131 install -Dm644 "${srcdir}/dev.bnema.Dumber.desktop" "${pkgdir}/usr/share/applications/dev.bnema.Dumber.desktop"
3232 install -Dm644 "${srcdir}/logo-512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/dev.bnema.Dumber.png"
33- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
33+ install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
3434 }
@@ -26,9 +26,9 @@ sha256sums=('c8230e3a5258333fed401439b08c6ef7b0681dd14f4e97a7e837dfc2c4cc83a0'
26 'SKIP')26 'SKIP')
27 27
28 package() {28 package() {
29- cd "dumber_${pkgver}"29+ cd "${srcdir}"
30 install -Dm755 dumber "${pkgdir}/usr/bin/dumber"30 install -Dm755 dumber "${pkgdir}/usr/bin/dumber"
31 install -Dm644 "${srcdir}/dev.bnema.Dumber.desktop" "${pkgdir}/usr/share/applications/dev.bnema.Dumber.desktop"31 install -Dm644 "${srcdir}/dev.bnema.Dumber.desktop" "${pkgdir}/usr/share/applications/dev.bnema.Dumber.desktop"
32 install -Dm644 "${srcdir}/logo-512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/dev.bnema.Dumber.png"32 install -Dm644 "${srcdir}/logo-512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/dev.bnema.Dumber.png"
33- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"33+ install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
34 }34 }
M internal/infrastructure/env/manager_test.go +12 -15
@@ -183,6 +183,11 @@ func TestIsFlatpak(t *testing.T) {
183183 }
184184
185185 func TestIsPacman(t *testing.T) {
186+ // Only run these tests on Arch-based systems with pacman
187+ if _, err := os.Stat("/usr/bin/pacman"); os.IsNotExist(err) {
188+ t.Skip("pacman not found, skipping Arch-specific tests")
189+ }
190+
186191 tests := []struct {
187192 name string
188193 binary string
@@ -200,24 +205,16 @@ func TestIsPacman(t *testing.T) {
200205 },
201206 }
202207
203- // Only run these tests on Arch-based systems with pacman
204- if _, err := os.Stat("/usr/bin/pacman"); os.IsNotExist(err) {
205- t.Skip("pacman not found, skipping Arch-specific tests")
206- }
207-
208208 for _, tt := range tests {
209209 t.Run(tt.name, func(t *testing.T) {
210210 // We can't easily test IsPacman directly since it uses os.Executable()
211- // but we can test the underlying logic with exec.Command
212- if tt.binary == "/usr/bin/bash" {
213- // Verify pacman -Qo works for a known system binary
214- cmd := exec.Command("pacman", "-Qo", tt.binary)
215- err := cmd.Run()
216- if tt.expected {
217- assert.NoError(t, err, "pacman should own %s", tt.binary)
218- } else {
219- assert.Error(t, err, "pacman should not own %s", tt.binary)
220- }
211+ // but we can test the underlying pacman -Qo logic with exec.Command
212+ cmd := exec.Command("pacman", "-Qo", tt.binary)
213+ err := cmd.Run()
214+ if tt.expected {
215+ assert.NoError(t, err, "pacman should own %s", tt.binary)
216+ } else {
217+ assert.Error(t, err, "pacman should not own %s", tt.binary)
221218 }
222219 })
223220 }
@@ -183,6 +183,11 @@ func TestIsFlatpak(t *testing.T) {
183 }183 }
184 184
185 func TestIsPacman(t *testing.T) {185 func TestIsPacman(t *testing.T) {
186+ // Only run these tests on Arch-based systems with pacman
187+ if _, err := os.Stat("/usr/bin/pacman"); os.IsNotExist(err) {
188+ t.Skip("pacman not found, skipping Arch-specific tests")
189+ }
190+
186 tests := []struct {191 tests := []struct {
187 name string192 name string
188 binary string193 binary string
@@ -200,24 +205,16 @@ func TestIsPacman(t *testing.T) {
200 },205 },
201 }206 }
202 207
203- // Only run these tests on Arch-based systems with pacman
204- if _, err := os.Stat("/usr/bin/pacman"); os.IsNotExist(err) {
205- t.Skip("pacman not found, skipping Arch-specific tests")
206- }
207-
208 for _, tt := range tests {208 for _, tt := range tests {
209 t.Run(tt.name, func(t *testing.T) {209 t.Run(tt.name, func(t *testing.T) {
210 // We can't easily test IsPacman directly since it uses os.Executable()210 // We can't easily test IsPacman directly since it uses os.Executable()
211- // but we can test the underlying logic with exec.Command211+ // but we can test the underlying pacman -Qo logic with exec.Command
212- if tt.binary == "/usr/bin/bash" {212+ cmd := exec.Command("pacman", "-Qo", tt.binary)
213- // Verify pacman -Qo works for a known system binary213+ err := cmd.Run()
214- cmd := exec.Command("pacman", "-Qo", tt.binary)214+ if tt.expected {
215- err := cmd.Run()215+ assert.NoError(t, err, "pacman should own %s", tt.binary)
216- if tt.expected {216+ } else {
217- assert.NoError(t, err, "pacman should own %s", tt.binary)217+ assert.Error(t, err, "pacman should not own %s", tt.binary)
218- } else {
219- assert.Error(t, err, "pacman should not own %s", tt.binary)
220- }
221 }218 }
222 })219 })
223 }220 }

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 8

Tags 42

↑↓ moveenter openesc close