Filter stale APKs from CI package cache
Build Alpine Packages / build-and-publish (v3.24, 3.24) (push) Has been cancelled

This commit is contained in:
Joachim Schlöffel
2026-07-12 10:09:45 +02:00
parent 7781653941
commit faf7d5e404
4 changed files with 134 additions and 21 deletions
+32
View File
@@ -37,6 +37,14 @@ apk_package_dirs() {
return
fi
apk_all_package_dirs "${repo_root}"
}
apk_all_package_dirs() {
local repo_root="$1"
local package_root
package_root="$(apk_package_root "${repo_root}")"
find "${package_root}" -mindepth 2 -maxdepth 2 -name APKBUILD -print \
| sed 's#/APKBUILD$##' \
| sort
@@ -87,6 +95,30 @@ apk_package_supports_arch() {
return 1
}
apk_package_apk_names() {
local package_dir="$1"
local arch="$2"
(
set +u
local pkgname
local pkgver
local pkgrel
local subpackage
local subpackages
export CARCH="${arch}"
cd "${package_dir}"
# shellcheck source=/dev/null
. ./APKBUILD
printf '%s-%s-r%s.apk\n' "${pkgname}" "${pkgver}" "${pkgrel}"
for subpackage in ${subpackages:-}; do
subpackage="${subpackage%%:*}"
printf '%s-%s-r%s.apk\n' "${subpackage}" "${pkgver}" "${pkgrel}"
done
)
}
apk_container_package_dir() {
local repo_root="$1"
local package_dir="$2"