summaryrefslogtreecommitdiff
path: root/bin/sanity-check
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-13 15:08:22 +0100
committerErich Eckner <git@eckner.net>2020-02-13 15:08:22 +0100
commitf9d3cde04e4d7228d425cc76da76f0a96af75d36 (patch)
treeefbad3741e23317a8b2f2eb6842c68866057c231 /bin/sanity-check
parent4ff74a25a4504b1862c7ecc9eb9b5ef31434df36 (diff)
downloadbuilder-f9d3cde04e4d7228d425cc76da76f0a96af75d36.tar.xz
bin/sanity-check: remove hard-coded package suffixes
Diffstat (limited to 'bin/sanity-check')
-rwxr-xr-xbin/sanity-check12
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/sanity-check b/bin/sanity-check
index 913f5d9..5e964fb 100755
--- a/bin/sanity-check
+++ b/bin/sanity-check
@@ -7,8 +7,6 @@
# shellcheck source=../lib/load-configuration
. "${0%/*}/../lib/load-configuration"
-# TODO: remove hard-coded package suffixes
-
usage() {
>&2 echo ''
>&2 echo 'sanity-check [options] [checks]: check sanity of build master'
@@ -352,15 +350,15 @@ while [ $# -gt 0 ]; do
packages=$(
ls_master_mirror "${arch}/${repo}" | \
- grep '\.pkg\.tar\.\(xz\|zst\)\(\.sig\)\?$'
+ grep '\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\.sig\)\?$'
) || true
errors=$(
echo "${packages}" | \
grep '\S' | \
sed '
- s@^\(.*\.pkg\.tar\.\(xz\|zst\)\)$@package \1@
- s@^\(.*\.pkg\.tar\.\(xz\|zst\)\)\.sig$@signature \1@
+ s@^\(.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\)$@package \1@
+ s@^\(.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\)\.sig$@signature \1@
' | \
sort -k2 | \
uniq -cf1 | \
@@ -394,7 +392,7 @@ while [ $# -gt 0 ]; do
'
echo "${packages}" | \
sed '
- /\.pkg\.tar\.\(xz\|zst\)$/ !d
+ /\.pkg\.\('"${package_compression_suffix_regex}"'\)$/ !d
s/^/in_repository /
' | \
sort -u
@@ -480,7 +478,7 @@ while [ $# -gt 0 ]; do
while read -r repo; do
ls_master_mirror "${arch}/${repo}" | \
sed '
- /\.pkg\.tar\.\(xz\|zst\)$/!d
+ /\.pkg\.\('"${package_compression_suffix_regex}"'\)$/!d
s,^,package-file '"${arch}"'/'"${repo}"'/,
'
done