From 076d035f6557ae87cad0d66ee32d6a7d6092a308 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Thu, 27 Dec 2018 14:38:00 +0100 Subject: [PATCH] coverage.sh: check requirement for disk image and debootstrap tarballs before running --- coverage.sh | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/coverage.sh b/coverage.sh index f33a87e..408938c 100755 --- a/coverage.sh +++ b/coverage.sh @@ -14,6 +14,31 @@ rm -f shared/cover_db.img if [ "$HAVE_QEMU" = "yes" ]; then # prepare image for cover_db guestfish -N shared/cover_db.img=disk:100M -- mkfs vfat /dev/sda + + if [ ! -e "./shared/cache/debian-unstable.qcow" ]; then + echo "./shared/cache/debian-unstable.qcow does not exist" >&2 + exit 1 + fi +fi + +# check if all required debootstrap tarballs exist +notfound=0 +for dist in stable testing unstable; do + for variant in minbase buildd -; do + # skip because of different userids for apt/systemd + if [ "$dist" = 'stable' ] && [ "$variant" = '-' ]; then + continue + fi + + if [ ! -e "shared/cache/debian-$dist-$variant.tar" ]; then + echo "shared/cache/debian-$dist-$variant.tar does not exist" >&2 + notfound=1 + fi + done +done +if [ "$notfound" -ne 0 ]; then + echo "not all required debootstrap tarballs are present" >&2 + exit 1 fi # only copy if necessary @@ -70,11 +95,6 @@ for dist in stable testing unstable; do fi print_header "mode=root,variant=$variant: check against debootstrap $dist" - if [ ! -e "shared/cache/debian-$dist-$variant.tar" ]; then - echo "shared/cache/debian-$dist-$variant.tar does not exist. Skipping..." - continue - fi - cat << END > shared/test.sh #!/bin/sh set -eu