Commit b082971e authored by Bastien ROUCARIÈS's avatar Bastien ROUCARIÈS

Postinst and prerm are more automatic

parent f6acb68f
......@@ -2,6 +2,9 @@
set -e
IM_QUANTUMDEPTH=$(echo $DPKG_MAINTSCRIPT_PACKAGE |sed 's/^.*[.]//g')
IM_VERSION=$(echo $DPKG_MAINTSCRIPT_PACKAGE |sed 's/^.*[-]im\([^.]*\)[.].*/\1/g')
if [ "$1" = "configure" ]
then
# Setup alternatives for each program separately along with their
......@@ -12,18 +15,18 @@ then
# We first remove previous alternatives to -im6, that
# disappeared because the binaries disappeared
update-alternatives --remove $prog /usr/bin/$prog-im6
update-alternatives --remove $prog /usr/bin/$prog-im$IM_VERSION
update-alternatives --install /usr/bin/$prog \
$prog /usr/bin/$prog-im6.q16 100 \
$prog /usr/bin/$prog-im$IM_VERSION.$IM_QUANTUMDEPTH 100 \
--slave /usr/share/man/man1/$prog.1.gz \
$prog.1.gz /usr/share/man/man1/$prog-im6.q16.1.gz
$prog.1.gz /usr/share/man/man1/$prog-im$IM_VERSION.$IM_QUANTUMDEPTH.1.gz
update-alternatives --install /usr/bin/$prog-im6 \
$prog-im6 /usr/bin/$prog-im6.q16 100 \
--slave /usr/share/man/man1/$prog-im6.1.gz \
$prog-im6.1.gz /usr/share/man/man1/$prog-im6.q16.1.gz
update-alternatives --install /usr/bin/$prog-im$IM_VERSION.$IM_QUANTUMDEPTH \
$prog-im$IM_VERSION /usr/bin/$prog-im$IM_VERSION.$IM_QUANTUMDEPTH 100 \
--slave /usr/share/man/man1/$prog-im$IM_VERSION.1.gz \
$prog-im$IM_VERSION.1.gz /usr/share/man/man1/$prog-im$IM_VERSION.$IM_QUANTUMDEPTH.1.gz
# We also remove previous
done
......
......@@ -2,12 +2,15 @@
set -e
IM_QUANTUMDEPTH=$(echo $DPKG_MAINTSCRIPT_PACKAGE |sed 's/^.*[.]//g')
IM_VERSION=$(echo $DPKG_MAINTSCRIPT_PACKAGE |sed 's/^.*[-]im\([^.]*\)[.].*/\1/g')
if [ "$1" = "remove" ]
then
# remove all alternatives
for prog in compare animate convert composite conjure \
import identify stream display montage mogrify; do
update-alternatives --remove $prog /usr/bin/$prog-im6.q16
update-alternatives --remove $prog /usr/bin/$prog-im$IM_VERSION.$IM_QUANTUMDEPTH
done
fi
......@@ -16,7 +19,7 @@ then
# remove all alternatives
for prog in compare animate convert composite conjure \
import identify stream display montage mogrify; do
update-alternatives --remove $prog-im6 /usr/bin/$prog-im6.q16
update-alternatives --remove $prog-im$IM_VERSION /usr/bin/$prog-im$IM_VERSION.$IM_QUANTUMDEPTH
done
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment