diff options
author | EuAndreh <eu@euandre.org> | 2023-11-13 07:25:54 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-11-13 08:00:44 -0300 |
commit | 6fb906cf213ab77eb549ef164a0bc33b6536c3fa (patch) | |
tree | ff0e85ac6c5eccf0cfbfab47eb215a0dcbae2c53 /tests/assert-uninstall.sh | |
parent | Makefile: Clean directory symlink potential leftover before recreating (diff) | |
download | papod-6fb906cf213ab77eb549ef164a0bc33b6536c3fa.tar.gz papod-6fb906cf213ab77eb549ef164a0bc33b6536c3fa.tar.xz |
tests/assert-uninstall.sh: Split from assert-install.sh
Diffstat (limited to 'tests/assert-uninstall.sh')
-rwxr-xr-x | tests/assert-uninstall.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/assert-uninstall.sh b/tests/assert-uninstall.sh new file mode 100755 index 0000000..82fc86f --- /dev/null +++ b/tests/assert-uninstall.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +. tools/lib.sh + +D="$(mkdtemp)" +trap 'rm -rf "$D"' EXIT + +{ + make -s DESTDIR="$D" install + make -s DESTDIR="$D" uninstall + printf '%s: that the "uninstall" target removes everything...' \ + "$(yellow "$0")" + if [ "$(find "$D" -not -type d | wc -l)" != 0 ]; then + printf ' ERR.\n' + cat <<-EOF + Leftover files not removed by "make uninstall": + + $(find "$D" -not -type d) + EOF + exit 1 + fi + printf ' %s\n' "$(green 'OK')" +} >&2 |