summaryrefslogtreecommitdiff
path: root/bin/clean-cache
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-13 20:32:46 +0100
committerErich Eckner <git@eckner.net>2020-02-13 20:32:46 +0100
commit883239ac2f0b8545cb63d899a0725a8b40b78784 (patch)
tree357a7549e1d5f8f8e9c76d268e14fbd5161ae0ad /bin/clean-cache
parentbb3c1be9fee3f67b28fa0447345ce80bd0a6deb5 (diff)
downloadbuilder-883239ac2f0b8545cb63d899a0725a8b40b78784.tar.xz
revert "remove hard-coded package suffixes" commits where they were unappropriate
Diffstat (limited to 'bin/clean-cache')
-rwxr-xr-xbin/clean-cache31
1 files changed, 13 insertions, 18 deletions
diff --git a/bin/clean-cache b/bin/clean-cache
index eda926f..8e6fb3c 100755
--- a/bin/clean-cache
+++ b/bin/clean-cache
@@ -5,6 +5,8 @@
# shellcheck source=../lib/load-configuration
. "${0%/*}/../lib/load-configuration"
+# TODO: remove hard-coded package suffixes
+
if [ $# -eq 0 ]; then
dummynator='sudo'
elif [ $# -eq 1 ] && [ "x$1" = 'x-n' ]; then
@@ -51,24 +53,17 @@ find "${tmp_dir}" -type f -name desc \
' | \
sort -k2,2 | \
uniq -uf1 | \
- sed -n '
- h
- '"$(
- # shellcheck disable=SC2016
- {
- printf 'SELECT'
- printf ' CONCAT('
- printf '"g;s@$@-",'
- printf '`architectures`.`name`,'
- printf '".pkg.",'
- printf '`compressions`.`suffix`,'
- printf '"@;p"'
- printf ')'
- printf ' FROM `compressions`'
- printf ' JOIN `architectures`;\n'
- } \
- | mysql_run_query
- )" \
+ while read -r s; do
+ printf '%s%s\n' \
+ "${s}" '-i486.pkg.tar.xz' \
+ "${s}" '-i686.pkg.tar.xz' \
+ "${s}" '-pentium4.pkg.tar.xz' \
+ "${s}" '-any.pkg.tar.xz' \
+ "${s}" '-i486.pkg.tar.zst' \
+ "${s}" '-i686.pkg.tar.zst' \
+ "${s}" '-pentium4.pkg.tar.zst' \
+ "${s}" '-any.pkg.tar.zst'
+ done | \
sha256sum -c --ignore-missing --quiet 2> /dev/null | \
sed -n '
s|: FAILED$||