-
Guillem Jover authored
The disk name while somewhat appropriate might, does not map to a URL style nomenclature, which we should be moving to, so that different protocols are clearly recognizable by the users.
Guillem Jover authoredThe disk name while somewhat appropriate might, does not map to a URL style nomenclature, which we should be moving to, so that different protocols are clearly recognizable by the users.
dselect.prerm 1.27 KiB
#!/bin/sh
# See deb-prerm(5).
set -e
: "${DPKG_ADMINDIR:=/var/lib/dpkg}"
# Rename state directories to match renamed method names.
rename_method_state_dir() {
methodoldname="$1"
methodoldopt="$2"
methodnewname="$3"
methodnewopt="$4"
methodsdir="$DPKG_ADMINDIR/methods"
if [ -d "$methodsdir/$methodoldname" ]; then
if [ -e "$methodsdir/$methodnewname" ]; then
rm -rf "$methodsdir/$methodoldname"
else
if [ -e "$methodsdir/$methodoldname/shvar.$methodoldopt" ]; then
cp -a "$methodsdir/$methodoldname/shvar.$methodoldopt" \
"$methodsdir/$methodoldname/shvar.$methodnewopt"
fi
mv "$methodsdir/$methodoldname" "$methodsdir/$methodnewname"
rm -f "$methodsdir/$methodnewname/shvar.$methodoldopt"
fi
# Update the currently selected method and option if needed.
sed -i -e "s/^$methodoldname $methodoldopt/$methodnewname $methodnewopt/" \
"$DPKG_ADMINDIR/cmethopt"
fi
}
case "$1" in
upgrade)
if dpkg --compare-versions "$2" lt 1.21.3; then
# Downgrade
rename_method_state_dir file file disk mounted
rename_method_state_dir media media multicd multi_cd
fi
;;
deconfigure|remove|failed-upgrade)
;;
*)
echo "$0 called with unknown argument '$1'" 1>&2
exit 1
;;
esac
#DEBHELPER#
exit 0