6 : "${DPKG_ADMINDIR:=/var/lib/dpkg}"
8 # Rename state directories to match renamed method names.
9 rename_method_state_dir
() {
14 methodsdir
="$DPKG_ADMINDIR/methods"
16 if [ -d "$methodsdir/$methodoldname" ]; then
17 if [ -e "$methodsdir/$methodnewname" ]; then
18 rm -rf "$methodsdir/$methodoldname"
20 if [ -e "$methodsdir/$methodoldname/shvar.$methodoldopt" ]; then
21 cp -a "$methodsdir/$methodoldname/shvar.$methodoldopt" \
22 "$methodsdir/$methodoldname/shvar.$methodnewopt"
24 mv "$methodsdir/$methodoldname" "$methodsdir/$methodnewname"
25 rm -f "$methodsdir/$methodnewname/shvar.$methodoldopt"
27 # Update the currently selected method and option if needed.
28 sed -i -e "s/^$methodoldname $methodoldopt/$methodnewname $methodnewopt/" \
29 "$DPKG_ADMINDIR/cmethopt"
35 if dpkg
--compare-versions "$2" lt
1.21.3; then
37 rename_method_state_dir
file file disk mounted
38 rename_method_state_dir media media multicd multi_cd
41 deconfigure|remove|failed-upgrade
)
44 echo "$0 called with unknown argument '$1'" 1>&2