diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 05:24:26 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 05:24:26 +0000 |
| commit | fcd0e6697038e5959df733e389124f6ccfa4a6d5 (patch) | |
| tree | 32271436944e3bdee677d9e1eccf8786c1758155 | |
| parent | 34cb6e65f171251ad331bdd67f33511904f36fb2 (diff) | |
build: let appimagetool's exit status decide, and check the artefact
The appimage recipe piped the tool through grep ... || true, so a
failed run still ended with an unconditional "Built:" echo and make
reported success with no AppImage on disk. Run appimagetool bare so
its status propagates, then require the artefact to exist, be
non-empty, and be newer than src/bitflash before announcing it.
Closes #29
| -rw-r--r-- | Makefile | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -200,8 +200,17 @@ d + '/usr/share/icons/hicolor/256x256/apps/bitflash.png')" | |||
| 200 | [ -z "$$path" ] && path=$$(find /usr/lib /lib -name "$$lib" 2>/dev/null | head -1); \ | 200 | [ -z "$$path" ] && path=$$(find /usr/lib /lib -name "$$lib" 2>/dev/null | head -1); \ |
| 201 | [ -n "$$path" ] && cp -L "$$path" $(APPDIR)/usr/lib/ && echo " bundled $$lib" || echo " missing $$lib"; \ | 201 | [ -n "$$path" ] && cp -L "$$path" $(APPDIR)/usr/lib/ && echo " bundled $$lib" || echo " missing $$lib"; \ |
| 202 | done | 202 | done |
| 203 | # appimagetool's output used to be piped through grep ... || true, which | ||
| 204 | # discarded its exit status: the target succeeded and announced "Built:" | ||
| 205 | # even when no AppImage existed. Run the tool bare so its status decides, | ||
| 206 | # then require the artefact to exist, be non-empty, and be newer than the | ||
| 207 | # binary it was packaged from before saying so. | ||
| 203 | @ARCH=x86_64 $(APPIMAGETOOL) --no-appstream $(APPDIR) \ | 208 | @ARCH=x86_64 $(APPIMAGETOOL) --no-appstream $(APPDIR) \ |
| 204 | $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage 2>&1 | grep -E "^Built|^Error" || true | 209 | $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage |
| 210 | @test -s $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage || \ | ||
| 211 | { echo "ERROR: Bitflash-$(VERSION)-x86_64.AppImage missing or empty"; exit 1; } | ||
| 212 | @test $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage -nt src/bitflash || \ | ||
| 213 | { echo "ERROR: Bitflash-$(VERSION)-x86_64.AppImage is not newer than src/bitflash"; exit 1; } | ||
| 205 | @echo "Built: Bitflash-$(VERSION)-x86_64.AppImage" | 214 | @echo "Built: Bitflash-$(VERSION)-x86_64.AppImage" |
| 206 | 215 | ||
| 207 | # ---- Windows (MSYS2 UCRT64) ----------------------------------------------- | 216 | # ---- Windows (MSYS2 UCRT64) ----------------------------------------------- |