summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-06-05 09:10:45 +0200
committerErich Eckner <git@eckner.net>2020-06-05 09:10:45 +0200
commitc3bc19db7e2614466474abfdb8a11999361f6eea (patch)
tree8474ef192c6e3528d305a73fed9e174563ebc1c7
parent5c64cab8500976cd3817589705af9f571be50ca0 (diff)
downloadarchlinuxewe-c3bc19db7e2614466474abfdb8a11999361f6eea.tar.xz
manually-check-pinned-dependencies new
-rwxr-xr-xmanually-check-pinned-dependencies59
1 files changed, 59 insertions, 0 deletions
diff --git a/manually-check-pinned-dependencies b/manually-check-pinned-dependencies
new file mode 100755
index 000000000..a07f860c2
--- /dev/null
+++ b/manually-check-pinned-dependencies
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+set -e
+
+if [ $# -ne 1 ]; then
+ >&2 printf 'usage: %s $package\n' "${0##*/}"
+ exit 1
+fi
+
+my_dir=$(dirname $(readlink -e "$0"))
+
+cd "$1"
+. PKGBUILD
+
+tmp_dir=$(mktemp -d)
+trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
+
+err=0
+check_it() {
+ eval "$(
+ {
+ declare -f "package_${name}" || declare -f package
+ } \
+ | sed -n '
+ /^\s*_pinned_dependencies/p
+ '
+ )"
+ pkgdir="${tmp_dir}/pkg"
+ eval "$(
+ sed '
+ s/\${FUNCNAME\[1]}/package_'"${name}"'/
+ ' "${my_dir}/pin-dependencies.PKGBUILDpatch"
+ )"
+}
+
+for name in "${pkgname[@]}"; do
+ for prel in ${pkgrel} $((pkgrel-1)); do
+ for r in \
+ "/mnt/archlinuxewe/os/x86_64" \
+ "/mnt/archlinux32/releng/x86_64"; do
+ for a in x86_64 any; do
+ pkgfile="${r}/${name}-${epoch:+${epoch}:}${pkgver}-${prel}-${a}.pkg.tar.zst"
+ [ -e "${pkgfile}" ] && break
+ done
+ [ -e "${pkgfile}" ] && break
+ done
+ [ -e "${pkgfile}" ] && break
+ done
+ if [ ! -e "${pkgfile}" ]; then
+ >&2 printf 'cannot find package %s\n' "${name}-${epoch:+${epoch}:}${pkgver}-${pkgrel}"
+ exit 1
+ fi
+ mkdir "${tmp_dir}/pkg"
+ bsdtar -C "${tmp_dir}/pkg" -xf "${pkgfile}"
+ check_it || err=$?
+ rm -rf --one-file-system "${tmp_dir}/pkg"
+done
+
+exit ${err}