Skip to content

Commit

Permalink
Simplify postinst and prerm of matlab package
Browse files Browse the repository at this point in the history
  • Loading branch information
mih committed Nov 23, 2010
1 parent 7dfa4ba commit a24ccc1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
5 changes: 2 additions & 3 deletions debian/matlab-spm8.postinst
Expand Up @@ -3,9 +3,8 @@ set -e

case "$1" in
configure)
debian-matlab-mexhelper spm8 'make MEXBIN="matlab-mex"' \
--clean-cmd "make distclean" \
--install-cmd "make install DESTDIR=/usr/share/spm8"
debian-matlab-mexhelper spm8 install \
--build-cmd 'make MEXBIN="matlab-mex"'
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
23 changes: 13 additions & 10 deletions debian/matlab-spm8.prerm
@@ -1,15 +1,18 @@
#!/bin/sh
set -e

for m in /usr/lib/spm8/*.mex?*; do
mbase=$(basename $m)
# remove symlink
rm -f /usr/share/spm8/$mbase
# and actual file
rm -f /usr/lib/spm8/$mbase
done

# try removing the libdir, but don't fail if not empty
rmdir --ignore-fail-on-non-empty /usr/lib/spm8
case "$1" in
remove|upgrade|deconfigure)
debian-matlab-mexhelper spm8 clean
;;

failed-upgrade)
;;

*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac

#DEBHELPER#

0 comments on commit a24ccc1

Please sign in to comment.