-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
uninstall
executable file
·68 lines (54 loc) · 1.35 KB
/
uninstall
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
#
# POSIX shell script to uninstall oil shell from the system.
# Distributed with the source tarball.
log() {
# indent it a bit
echo " $@" 1>&2
}
die() {
echo "FATAL install error: $@" 1>&2
exit 1
}
# NOTE: The configure step
main() {
if ! . _build/detected-config.sh; then
die "Can't find _build/detected-config.sh. Run './configure'"
fi
# Now $PREFIX should be defined
#
# Remove the shell binary
#
#local exec_filename=oil.ovm-dbg
local exec_filename=oil.ovm
local bin_dest="${DESTDIR}${PREFIX}/bin/"
if ! rm "$bin_dest/$exec_filename"; then
log "Couldn't remove $exec_filename binary in $bin_dest"
else
log "Removed executable"
fi
local working_dir=$PWD # save for later
cd "$bin_dest"
for link in osh oil ysh; do
if ! rm "$bin_dest/$link"; then
log "Couldn't remove $link symlink in $bin_dest"
else
log "Removed '$link' symlink"
fi
done
#
# Remove man page
#
# Relevant:
# https://unix.stackexchange.com/questions/90759/where-should-i-install-manual-pages-in-user-directory
# https://www.freebsd.org/cgi/man.cgi?query=install
cd "$working_dir"
# e.g. /usr/local/share/man/man1
local man_dest="${DESTDIR}${DATAROOTDIR}/man/man1/"
if ! rm "$man_dest/osh.1"; then
log "Couldn't remove osh.1 in $man_dest"
else
log "Removed man page"
fi
}
main "$@"