diff --git a/README.md b/README.md index ec5e371..470acb7 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,11 @@ Then create a directory named after the AUR package containing: single line. - **`pkg.sh`** — bash sourced by [scripts/update-package.sh](scripts/update-package.sh), defining: - - `latest_version` — prints the latest upstream version, no `v` prefix. + - `latest_version` — prints the latest upstream version, no `v` prefix. A + channel that has stopped pointing at a release can return `75` + (`EX_TEMPFAIL`) instead: the run then warns, keeps the version the + `PKGBUILD` has and carries on, so packaging changes still reach the AUR + (`fluxer-bin`). - `refresh_checksums ` — updates the `sha256sums*` lines for that version. If the asset name carries build metadata that does not follow from `pkgver` (see `snapx-bin`, `faugus-launcher-bin`), resolve diff --git a/scripts/update-package.sh b/scripts/update-package.sh index b19141c..c455329 100644 --- a/scripts/update-package.sh +++ b/scripts/update-package.sh @@ -34,26 +34,34 @@ BUILD_DEPS=() AUR_PUBLISH=true source "$pkg/pkg.sh" +oldver="$(grep -Po '^pkgver=\K.*' "$pkg/PKGBUILD")" +oldrel="$(grep -Po '^pkgrel=\K.*' "$pkg/PKGBUILD")" + # A package whose upstream release channel is temporarily out of order - a # "latest" pointer that has stopped pointing at a release - can return 75 # (EX_TEMPFAIL) from latest_version instead of printing one. There is nothing -# to update while that lasts and nothing wrong with the package, so the run -# warns and stops rather than going red, and the next one picks it up. +# to update to while that lasts and nothing wrong with the package, so the run +# warns rather than going red, and the next one tries again. +# +# It carries on with the version the PKGBUILD already has instead of stopping: +# everything below is about the packaging, not the version, and a package +# cannot be fixed at all if a stalled upstream channel also blocks the AUR +# sync - which is exactly what happened to fluxer-bin, whose stable channel +# has been serving canary builds since 0.0.8. rc=0 ver="$(latest_version)" || rc=$? if [[ "$rc" -eq 75 ]]; then echo "::warning::$pkg: upstream has no current release to track right now -" \ - "leaving the package as it is, the next run tries again." - exit 0 + "leaving the version alone, the next run tries again." + ver="$oldver" fi if [[ -z "$ver" || "$ver" == "null" ]]; then echo "::error::$pkg: could not determine the latest upstream version" exit 1 fi -echo "$pkg: latest upstream version is $ver" - -oldver="$(grep -Po '^pkgver=\K.*' "$pkg/PKGBUILD")" -oldrel="$(grep -Po '^pkgrel=\K.*' "$pkg/PKGBUILD")" +if [[ "$rc" -ne 75 ]]; then + echo "$pkg: latest upstream version is $ver" +fi ### 2: bring the PKGBUILD up to date ########################################