-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathinstall_uninstall.sh
More file actions
executable file
·40 lines (34 loc) · 966 Bytes
/
install_uninstall.sh
File metadata and controls
executable file
·40 lines (34 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
install_dir=`mktemp -d`
if [ -z "$install_dir" ]; then
echo "install_uninstall error: could not create temporary directory" >&2
exit 1
fi
# test installation
if ! make install DESTDIR="$install_dir" prefix=""; then
echo "FAILED: make install" >&2
rm -rf "$install_dir"
exit 1
fi
cut -d ' ' -f 1 MANIFEST.new | while read -r installed_file; do
if [ ! -e "$install_dir/$installed_file" ]; then
echo "FAILED: make install of "$installed_file"" >&2
rm -rf "$install_dir"
exit 1
fi
done
# test uninstallation
if ! make uninstall DESTDIR="$install_dir" prefix=""; then
echo "FAILED: make uninstall" >&2
rm -rf "$install_dir"
exit 1
fi
cut -d ' ' -f 1 MANIFEST.new | while read -r installed_file; do
[ -d "$install_dir/$installed_file" ] && continue
if [ -f "$install_dir/$installed_file" ]; then
echo "FAILED: make install of "$installed_file"" >&2
rm -rf "$install_dir"
exit 1
fi
done
echo "install_uninstall tests SUCCEEDED"