mmdebstrap/tests/merged-usr-via-setup-hook
Johannes Schauer Marin Rodrigues 4c3fddcd54
rewrite coverage.sh
- multiple individual shell scripts instead of one 3.5k line monster
 - tests driven by Python script allowing:
    * declarative test description in coverage.txt
    * collecting errors instead of aborting on first error
    * skipping tests
    * running specific tests
2022-05-28 17:49:05 +02:00

43 lines
1 KiB
Bash

#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
trap "rm -rf /tmp/debian-chroot" EXIT INT TERM
{{ CMD }} --mode=root --variant=apt \
--setup-hook=./hooks/merged-usr/setup00.sh \
--customize-hook='[ -L "$1"/bin -a -L "$1"/sbin -a -L "$1"/lib ]' \
{{ DIST }} /tmp/debian-chroot {{ MIRROR }}
tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort > tar2.txt
{
sed -e 's/^\.\/bin\//.\/usr\/bin\//;s/^\.\/lib\//.\/usr\/lib\//;s/^\.\/sbin\//.\/usr\/sbin\//;' tar1.txt | {
case {{ HOSTARCH }} in
amd64) sed -e 's/^\.\/lib32\//.\/usr\/lib32\//;s/^\.\/lib64\//.\/usr\/lib64\//;s/^\.\/libx32\//.\/usr\/libx32\//;';;
ppc64el) sed -e 's/^\.\/lib64\//.\/usr\/lib64\//;';;
*) cat;;
esac
};
echo ./bin;
echo ./lib;
echo ./sbin;
case {{ HOSTARCH }} in
amd64)
echo ./lib32;
echo ./lib64;
echo ./libx32;
echo ./usr/lib32/;
echo ./usr/libx32/;
;;
i386)
echo ./lib64;
echo ./libx32;
echo ./usr/lib64/;
echo ./usr/libx32/;
;;
ppc64el)
echo ./lib64;
;;
s390x)
echo ./lib32;
echo ./usr/lib32/;
;;
esac
} | sort -u | diff -u - tar2.txt