Merge branch 'postremove'

This commit is contained in:
Marin Jankovski 2014-11-14 11:19:24 +01:00
commit 70c9a6e00b
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
#!/bin/sh
# WARNING: REQUIRES /bin/sh
#
# - must run on /bin/sh on solaris 9
# - must run on /bin/sh on AIX 6.x
# - if you think you are a bash wizard, you probably do not understand
# this programming language. do not touch.
# - if you are under 40, get peer review from your elders.
is_smartos() {
uname -v | grep "^joyent" 2>&1 >/dev/null
}
if is_smartos; then
PREFIX="/opt/local"
else
PREFIX="/usr"
fi
cleanup_symlinks() {
binaries="gitlab-ctl gitlab-rake gitlab-rails gitlab-ci-rake gitlab-ci-rails"
for binary in $binaries; do
rm -f $PREFIX/bin/$binary
done
}
# Clean up binary symlinks if they exist
# see: http://tickets.opscode.com/browse/CHEF-3022
if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release ]; then
# not a redhat-ish RPM-based system
cleanup_symlinks
elif [ "x$1" = "x0" ]; then
# RPM-based system and we're deinstalling rather than upgrading
cleanup_symlinks
fi