index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2017-06-29 09:42:18 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-06-29 09:42:18 +0200 |
commit | 9be8e4ad69cfceb9fc7e13dd78a3b23310575f38 (patch) | |
tree | 9aa686d95ca3aaaad85b2e52113dcf3f0609ea57 /bin | |
parent | c6984b98277071bd0e2830adaac7e5925ed4130c (diff) |
-rwxr-xr-x | bin/sanity-check | 66 |
diff --git a/bin/sanity-check b/bin/sanity-check index 4700ed9..8913f9f 100755 --- a/bin/sanity-check +++ b/bin/sanity-check @@ -107,11 +107,12 @@ while [ $# -gt 0 ]; do errors="$( ( - printf '%s\n' ${repos} - ls_master_mirror 'i686' + printf 'expected %s\n' ${repos} + ls_master_mirror 'i686' | \ + sed 's|^|found |' ) | \ - sort | \ - uniq -u + sort -k2 | \ + uniq -uf1 )" if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then @@ -141,16 +142,21 @@ while [ $# -gt 0 ]; do errors="$( echo "${packages}" | \ - sed 's|\.sig$||' | \ - uniq -c | \ + grep '\S' | \ + sed ' + s|^\(.*\.pkg\.tar\.xz\)$|package \1| + s|^\(.*\.pkg\.tar\.xz\)\.sig$|signature \1| + ' | \ + sort -k2 | \ + uniq -cf1 | \ grep -v '^\s*2\s' | \ - awk '{print $2}' - )" + awk '{print $2 " " $3}' + )" || true if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo echo "The following packages in ${repo} are missing a signature or vice versa:" - echo "${errors}" + echo "'${errors}'" fi exit 1 fi @@ -164,13 +170,20 @@ while [ $# -gt 0 ]; do ( tar -tzf "${tmp_dir}/${repo}.db.tar.gz" | \ grep '/$' | \ - sed 's|/$||' + sed ' + s|/$|| + s|^|in_database | + ' echo "${packages}" | \ - sed 's|-[^-]\+$||' | \ + grep '\S' | \ + sed ' + s|-[^-]\+$|| + s|^|in_repository | + ' | \ sort -u ) | \ - sort | \ - uniq -u + sort -k2 | \ + uniq -uf1 )" if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then @@ -185,13 +198,20 @@ while [ $# -gt 0 ]; do ( tar -tzf "${tmp_dir}/${repo}.files.tar.gz" | \ grep '/$' | \ - sed 's|/$||' + sed ' + s|/$|| + s|^|in_database | + ' echo "${packages}" | \ - sed 's|-[^-]\+$||' | \ + grep '\S' | \ + sed ' + s|-[^-]\+$|| + s|^|in_repository | + ' | \ sort -u ) | \ - sort | \ - uniq -u + sort -k2 | \ + uniq -uf1 )" if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then @@ -223,18 +243,20 @@ while [ $# -gt 0 ]; do ls "${work_dir}/package-states" | \ grep "\.${status#*:}\$" | \ sed "s|^|${work_dir}/package-states/|" | \ - xargs -r cat + xargs -r cat | \ + sed 's|^|package-state-file |' ls_master_mirror 'i686' | \ grep "${status%:*}\$" | \ while read -r repo; do ls_master_mirror "i686/${repo}" done | \ - grep '\.pkg\.tar\.xz$' + grep '\.pkg\.tar\.xz$' | \ + sed 's|^|package-file |' ) | \ - sort | \ - uniq -c | \ + sort -k2 | \ + uniq -cf1 | \ grep -v '^\s*2\s' | \ - awk '{print $2}' + awk '{print $2 " " $3}' )" if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then |