Files
spotifast/packaging/test-arch-source.sh
T
Carmine Paolino ce469046ba Use Spotifast package and download names with upgrade compatibility
Publish canonical AUR, Homebrew and native package names while retaining existing application identities and updater-compatible archives. Announce the AUR move in packaging-only revisions of the old packages.

Keep 0.8.0 application bytes unchanged. Cover both release filename sets in checksums and validate native Linux package replacement against pinned old-package fixtures.
2026-09-14 17:21:50 +02:00

36 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# Check source-recipe directory handling without recompiling the release.
set -euo pipefail
archive=$(realpath "${1:?usage: test-arch-source.sh SOURCE_ARCHIVE VERSION}")
version=${2:?release version is required}
recipe=$(dirname "$(realpath "$0")")/arch/spotifast/PKGBUILD.in
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
mkdir "$work/src"
tar -xzf "$archive" -C "$work/src"
sed -e "s/@VERSION@/$version/g" -e 's/@PKGREL@/1/g' \
-e 's/@SOURCE_SHA256@/unused/g' "$recipe" > "$work/PKGBUILD"
srcdir="$work/src"
if [[ -d "$srcdir/spotifast-$version" ]]; then
expected="$srcdir/spotifast-$version"
else
expected="$srcdir/fastpotify-$version"
fi
test -f "$expected/Cargo.toml"
test -f "$expected/Cargo.lock"
# Exercise the real recipe phases; only the expensive Cargo subprocess is
# replaced. A wrong cd fails before this function, reproducing the 0.8.0 bug.
cargo() {
test "$PWD" = "$expected"
case "$1" in fetch|build|test) ;; *) return 1 ;; esac
}
# shellcheck source=/dev/null
source "$work/PKGBUILD"
prepare
build
check
printf 'Source recipe phases passed for %s\n' "$version"