This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=50e65267da27acf6e26bd9728e639d9acf25e275

commit 50e65267da27acf6e26bd9728e639d9acf25e275
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Sat May 2 23:15:42 2020 +0200

    Reformat shell code to follow the coding style
---
 debian/changelog                   |    1 +
 debian/dpkg.cron.daily             |   50 +-
 debian/dpkg.postrm                 |   38 +-
 dselect/methods/disk/install       |  156 +++---
 dselect/methods/disk/setup         |  317 ++++++------
 dselect/methods/disk/update        |  101 ++--
 dselect/methods/multicd/install    |  196 ++++---
 dselect/methods/multicd/setup      |  645 +++++++++++------------
 dselect/methods/multicd/update     |  129 +++--
 scripts/dpkg-maintscript-helper.sh | 1002 ++++++++++++++++++------------------
 10 files changed, 1301 insertions(+), 1334 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7bddbda09..eeb27d7d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -115,6 +115,7 @@ dpkg (1.20.1) UNRELEASED; urgency=medium
     - Use $() in shell or qx() in perl instead of ``.
     - dpkg-split: Switch part number variables from unsigned int to int.
     - scripts: Refactor shell error handling into a shell library
+    - Reformat shell code to follow the coding style.
   * Build system:
     - Handle .git being a plain file when getting the dpkg tree version.
     - Add debian/changelog as a Changes file to the CPAN distribution.
diff --git a/debian/dpkg.cron.daily b/debian/dpkg.cron.daily
index 62da81727..0a135f729 100644
--- a/debian/dpkg.cron.daily
+++ b/debian/dpkg.cron.daily
@@ -4,33 +4,33 @@ dbdir=/var/lib/dpkg
 
 # Backup the 7 last versions of dpkg databases containing user data.
 if cd /var/backups ; then
-    # We backup all relevant database files if any has changed, so that
-    # the rotation number always contains an internally consistent set.
-    dbchanged=no
-    dbfiles="arch status diversions statoverride"
+  # We backup all relevant database files if any has changed, so that
+  # the rotation number always contains an internally consistent set.
+  dbchanged=no
+  dbfiles="arch status diversions statoverride"
+  for db in $dbfiles ; do
+    if ! cmp -s "dpkg.${db}.0" "$dbdir/$db"; then
+      dbchanged=yes
+      break
+    fi
+  done
+  if [ "$dbchanged" = "yes" ] ; then
     for db in $dbfiles ; do
-        if ! cmp -s "dpkg.${db}.0" "$dbdir/$db"; then
-            dbchanged=yes
-            break;
-        fi
+      [ -e "$dbdir/$db" ] || continue
+      cp -p "$dbdir/$db" "dpkg.$db"
+      savelog -c 7 "dpkg.$db" >/dev/null
     done
-    if [ "$dbchanged" = "yes" ] ; then
-        for db in $dbfiles ; do
-            [ -e "$dbdir/$db" ] || continue
-            cp -p "$dbdir/$db" "dpkg.$db"
-            savelog -c 7 "dpkg.$db" >/dev/null
-        done
-    fi
+  fi
 
-    # The alternatives database is independent from the dpkg database.
-    dbalt=alternatives
+  # The alternatives database is independent from the dpkg database.
+  dbalt=alternatives
 
-    # XXX: Ideally we'd use --warning=none instead of discarding stderr, but
-    # as of GNU tar 1.27.1, it does not seem to work reliably (see #749307).
-    if ! test -e ${dbalt}.tar.0 ||
-       ! tar -df ${dbalt}.tar.0 -C $dbdir $dbalt >/dev/null 2>&1 ;
-    then
-        tar -cf ${dbalt}.tar -C $dbdir $dbalt >/dev/null 2>&1
-        savelog -c 7 ${dbalt}.tar >/dev/null
-    fi
+  # XXX: Ideally we'd use --warning=none instead of discarding stderr, but
+  # as of GNU tar 1.27.1, it does not seem to work reliably (see #749307).
+  if ! test -e ${dbalt}.tar.0 ||
+     ! tar -df ${dbalt}.tar.0 -C $dbdir $dbalt >/dev/null 2>&1 ;
+  then
+    tar -cf ${dbalt}.tar -C $dbdir $dbalt >/dev/null 2>&1
+    savelog -c 7 ${dbalt}.tar >/dev/null
+  fi
 fi
diff --git a/debian/dpkg.postrm b/debian/dpkg.postrm
index 175080e86..413341955 100755
--- a/debian/dpkg.postrm
+++ b/debian/dpkg.postrm
@@ -5,32 +5,28 @@ set -e
 
 # Remove log file when dpkg is purged
 remove_logfile() {
-    logdir=$DPKG_ROOT/var/log
+  logdir=$DPKG_ROOT/var/log
 
-    rm -f "$logdir"/dpkg.log "$logdir"/dpkg.log.* 2>/dev/null
-    rm -f "$logdir"/alternatives.log "$logdir"/alternatives.log.* 2>/dev/null
+  rm -f "$logdir"/dpkg.log "$logdir"/dpkg.log.* 2>/dev/null
+  rm -f "$logdir"/alternatives.log "$logdir"/alternatives.log.* 2>/dev/null
 }
 
 case "$1" in
-    remove)
-       ;;
-
-    purge)
-       remove_logfile
-       ;;
-
-    upgrade)
-       ;;
-
-    failed-upgrade|disappear|abort-install|abort-upgrade)
-       ;;
-
-
-    *)
-       echo "$0 called with unknown argument '$1'" 1>&2
-       exit 1
-       ;;
+remove)
+  ;;
+purge)
+  remove_logfile
+  ;;
+upgrade)
+  ;;
+failed-upgrade|disappear|abort-install|abort-upgrade)
+  ;;
+*)
+  echo "$0 called with unknown argument '$1'" 1>&2
+  exit 1
+  ;;
 esac
 
 #DEBHELPER#
+
 exit 0
diff --git a/dselect/methods/disk/install b/dselect/methods/disk/install
index 9ba50fa36..c74a6ca1e 100755
--- a/dselect/methods/disk/install
+++ b/dselect/methods/disk/install
@@ -24,77 +24,76 @@ cd "$vardir/methods/disk"
 
 xit=1
 trap '
-       if [ -n "$umount" ]
-       then
-               umount "$umount" >/dev/null 2>&1
-       fi
-       exit $xit
+  if [ -n "$umount" ]; then
+    umount "$umount" >/dev/null 2>&1
+  fi
+  exit $xit
 ' 0
 
-if [ -n "$p_blockdev" ]
-then
-       umount="$p_mountpoint"
-       mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint"
+if [ -n "$p_blockdev" ]; then
+  umount="$p_mountpoint"
+  mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint"
 fi
 
 predep="$vardir/predep-package"
-while true
-do
-       set +e
-       dpkg --admindir "$vardir" --predep-package >"$predep"
-       rc=$?
-       set -e
-       if test $rc = 1; then break; fi
-       test $rc = 0
+while true; do
+  set +e
+  dpkg --admindir "$vardir" --predep-package >"$predep"
+  rc=$?
+  set -e
+  if test $rc = 1; then
+    break
+  fi
+  test $rc = 0
 
-       perl -e '
-               ($binaryprefix,$predep) = @ARGV;
-               $binaryprefix =~ s,/*$,/, if length($binaryprefix);
-               open(P, "< $predep") or die "cannot open $predep: $!\n";
-               while (<P>) {
-                       s/\s*\n$//;
-                       $package= $_ if s/^Package: //i;
-                       @filename= split(/ /,$_) if s/^Filename: //i;
-                       @msdosfilename= split(/ /,$_) if s/^MSDOS-Filename: //i;
-               }
-               die "internal error - no package" if length($package) == 0;
-               die "internal error - no filename" if not @filename;
-               die "internal error - mismatch >@filename< >@msdosfilename<"
-                       if @filename && @msdosfilename &&
-                          @filename != @msdosfilename;
-               @invoke=(); $|=1;
-               for ($i=0; $i<=$#filename; $i++) {
-                       $ppart= $i+1;
-                       print "Looking for part $ppart of $package ... ";
-                       if (-f "$binaryprefix$filename[$i]") {
-                               $print= $filename[$i];
-                               $invoke= "$binaryprefix$filename[$i]";
-                       } elsif (-f "$binaryprefix$msdosfilename[$i]") {
-                               $print= $msdosfilename[$i];
-                               $invoke= "$binaryprefix$msdosfilename[$i]";
-                       } else {
-                               $base= $filename[$i]; $base =~ s,.*/,,;
-                               $msdosbase= $msdosfilename[$i]; $msdosbase =~ 
s,.*/,,;
-                               $c = open(X, "-|"));
-                               if (not defined $c) {
-                                       die "failed to fork for find: $!\n";
-                               }
-                               if (!$c) {
-                                       exec("find", "-L",
-                                            length($binaryprefix) ?
-                                            $binaryprefix : ".",
-                                            
"-name",$base,"-o","-name",$msdosbase);
-                                       die "failed to exec find: $!\n";
-                               }
-                               while (chop($invoke= <X>)) { last if -f 
$invoke; }
-                               $print= $invoke;
-                               if (substr($print,0,length($binaryprefix)+1) eq
-                                   "$binaryprefix/") {
-                                       $print= 
substr($print,length($binaryprefix));
-                               }
+  perl -e '
+       ($binaryprefix,$predep) = @ARGV;
+       $binaryprefix =~ s,/*$,/, if length($binaryprefix);
+       open(P, "< $predep") or die "cannot open $predep: $!\n";
+       while (<P>) {
+               s/\s*\n$//;
+               $package= $_ if s/^Package: //i;
+               @filename= split(/ /,$_) if s/^Filename: //i;
+               @msdosfilename= split(/ /,$_) if s/^MSDOS-Filename: //i;
+       }
+       die "internal error - no package" if length($package) == 0;
+       die "internal error - no filename" if not @filename;
+       die "internal error - mismatch >@filename< >@msdosfilename<"
+               if @filename && @msdosfilename &&
+                  @filename != @msdosfilename;
+       @invoke=(); $|=1;
+       for ($i=0; $i<=$#filename; $i++) {
+               $ppart= $i+1;
+               print "Looking for part $ppart of $package ... ";
+               if (-f "$binaryprefix$filename[$i]") {
+                       $print= $filename[$i];
+                       $invoke= "$binaryprefix$filename[$i]";
+               } elsif (-f "$binaryprefix$msdosfilename[$i]") {
+                       $print= $msdosfilename[$i];
+                       $invoke= "$binaryprefix$msdosfilename[$i]";
+               } else {
+                       $base= $filename[$i]; $base =~ s,.*/,,;
+                       $msdosbase= $msdosfilename[$i]; $msdosbase =~ s,.*/,,;
+                       $c = open(X, "-|"));
+                       if (not defined $c) {
+                               die "failed to fork for find: $!\n";
+                       }
+                       if (!$c) {
+                               exec("find", "-L",
+                                    length($binaryprefix) ?
+                                    $binaryprefix : ".",
+                                    "-name",$base,"-o","-name",$msdosbase);
+                               die "failed to exec find: $!\n";
+                       }
+                       while (chop($invoke= <X>)) { last if -f $invoke; }
+                       $print= $invoke;
+                       if (substr($print,0,length($binaryprefix)+1) eq
+                           "$binaryprefix/") {
+                               $print= substr($print,length($binaryprefix));
                        }
-                       if (!length($invoke)) {
-                               warn "
+               }
+               if (!length($invoke)) {
+                       warn "
 
 Cannot find the appropriate file(s) anywhere needed to install or upgrade
 package $package. Expecting version $version or later, as listed in the
@@ -107,23 +106,24 @@ and rerun the installation, or upgrade the package by 
using
 \"dpkg --install --auto-deconfigure" by hand.
 
 ";
-                               exit(1);
-                       }
-                       print "$print\n";
-                       push(@invoke,$invoke);
+                       exit(1);
                }
-               print "Running dpkg -iB for $package ...\n";
-               exec("dpkg","--admindir",$vardir,"-iB","--",@invoke);
-               die "failed to exec dpkg: $!\n";
-       ' -- "$p_mountpoint$p_main_binary" "$predep"
+               print "$print\n";
+               push(@invoke,$invoke);
+       }
+       print "Running dpkg -iB for $package ...\n";
+       exec("dpkg","--admindir",$vardir,"-iB","--",@invoke);
+       die "failed to exec dpkg: $!\n";
+  ' -- "$p_mountpoint$p_main_binary" "$predep"
 done
 
-for f in main ctb nf lcl
-do
-       eval 'this_binary=$p_'$f'_binary'
-       if [ -z "$this_binary" ]; then continue; fi
-       echo Running dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
-       dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
+for f in main ctb nf lcl; do
+  eval 'this_binary=$p_'$f'_binary'
+  if [ -z "$this_binary" ]; then
+    continue
+  fi
+  echo Running dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
+  dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
 done
 
 echo -n 'Installation OK.  Hit RETURN.  '
diff --git a/dselect/methods/disk/setup b/dselect/methods/disk/setup
index 9be7daac0..8ca898c0e 100755
--- a/dselect/methods/disk/setup
+++ b/dselect/methods/disk/setup
@@ -25,37 +25,39 @@ iarch=$(dpkg --admindir $vardir --print-architecture)
 
 xit=1
 trap '
-       rm -f $tp.?
-       if [ -n "$umount" ]
-       then
-               umount "$umount" >/dev/null 2>&1
-       fi
-       exit $xit
+  rm -f $tp.?
+  if [ -n "$umount" ]; then
+    umount "$umount" >/dev/null 2>&1
+  fi
+  exit $xit
 ' 0
 
-if ls -d "$tp.?" >/dev/null 2>&1
-then
-       rm $tp.?
+if ls -d "$tp.?" >/dev/null 2>&1; then
+  rm $tp.?
 fi
 
 yesno () {
-       while true
-       do
-               echo -n "$2 [$1]  "
-               read response
-               if [ -z "$response" ]
-               then
-                       response="$1"
-               fi
-               case "$response" in
-               [Nn]*)  yesno=no ; return ;;
-               [Yy]*)  yesno=yes ; return ;;
-               esac
-       done
+  while true; do
+    echo -n "$2 [$1]  "
+    read response
+    if [ -z "$response" ]; then
+      response="$1"
+    fi
+    case "$response" in
+    [Nn]*)
+      yesno=no
+      return
+      ;;
+    [Yy]*)
+      yesno=yes
+      return
+      ;;
+    esac
+  done
 }
 
 outputparam () {
-       echo "$2" | sed -e "s/'/'\\\\''/; s/^/$1='/; s/$/'/" >&3
+  echo "$2" | sed -e "s/'/'\\\\''/; s/^/$1='/; s/$/'/" >&3
 }
 
 intrkey="$(stty -a | sed -n 's/.*intr = \([^;]*\);.*/\1/p')"
@@ -81,24 +83,21 @@ If you make a mistake, use the interrupt key ($intrkey) to 
abort.
 #  defaultdevice
 #   The default block device to mount.
 
-if [ -f shvar.$option ]
-then
-       . ./shvar.$option
-       defaultdevice="$p_blockdev"
+if [ -f shvar.$option ]; then
+  . ./shvar.$option
+  defaultdevice="$p_blockdev"
 fi
 
-if [ -n "$mountpoint" ]
-then
-       # We must have $mountpoint
-       echo \
+if [ -n "$mountpoint" ]; then
+  # We must have $mountpoint
+  echo \
 "All directory names should be entered relative to the root of the
 $fstype filesystem on $blockdevice.
 "
 fi
 
-while true
-do
-       echo \
+while true; do
+  echo \
 "In order to make it easy to find the relevant files, it is preferred
 to install from a straightforward copy of the Debian distribution.
 To use this, it is required to know where the top level of that copy of
@@ -107,145 +106,130 @@ contains the Packages-Master file.
 
 If you do not have a straightforward copy of the distribution available
 just answer 'none' and each needed part will be prompted individually."
-       defhierbase=none
-# maybe ask for debian/dists and then show and ask for available dists
-# eg. {stable,frozen,unstable,bo,hamm,slink}
-       if [ -n "$p_hierbase" ]
-       then
-               if [ -d "$mountpoint/$p_hierbase/main/binary-$iarch" ]
-               then
-                       echo "
+  defhierbase=none
+  # maybe ask for debian/dists and then show and ask for available dists
+  # eg. {stable,frozen,unstable,bo,hamm,slink}
+  if [ -n "$p_hierbase" ]; then
+    if [ -d "$mountpoint/$p_hierbase/main/binary-$iarch" ]; then
+      echo "
 Last time you said '$p_hierbase', and that looks plausible."
-                       defhierbase="$p_hierbase"
-               else
-                       echo "
+      defhierbase="$p_hierbase"
+    else
+      echo "
 Last time you said '$p_hierbase', but that doesn't look plausible,
 since '$p_hierbase/main/binary-$iarch' doesn't seem to exist."
-               fi
-       fi
-       if [ none = "$defhierbase" ]
-       then
-               if [ -d "$mountpoint/debian/dists/stable/main/binary-$iarch" ]
-               then
-                       echo "
+    fi
+  fi
+  if [ none = "$defhierbase" ]; then
+    if [ -d "$mountpoint/debian/dists/stable/main/binary-$iarch" ]; then
+      echo "
 '/debian/dists/stable' exists and looks plausible, so that's the default."
-                       defhierbase=/debian/dists/stable
-               elif [ -d "$mountpoint/dists/stable/main/binary-$iarch" ]
-               then
-                       echo "
+      defhierbase=/debian/dists/stable
+    elif [ -d "$mountpoint/dists/stable/main/binary-$iarch" ]; then
+      echo "
 '/dists/stable' exists and looks plausible, so that's the default."
-                       defhierbase=/dists/stable
-               fi
-       fi
-       echo -n \
+      defhierbase=/dists/stable
+    fi
+  fi
+  echo -n \
 "Distribution top level ? [$defhierbase]  "
-       read response
-       if [ -z "$response" ]
-       then
-               response="$defhierbase"
-       fi
-       if [ none = "$response" ]
-       then
-               hierbase=""
-               break
-       elif [ -d "$mountpoint/$response/main/binary-$iarch" ]
-       then
-               hierbase="$(echo \"$response\" | sed -e 's:/*$::; s:^/*:/:')"
-               break
-       fi
-       echo \
+  read response
+  if [ -z "$response" ]; then
+    response="$defhierbase"
+  fi
+  if [ none = "$response" ]; then
+    hierbase=""
+    break
+  elif [ -d "$mountpoint/$response/main/binary-$iarch" ]; then
+    hierbase="$(echo \"$response\" | sed -e 's:/*$::; s:^/*:/:')"
+    break
+  fi
+  echo \
 "$response/main/binary-$iarch does not exist.
 "
 done
 
-
 case "$hierbase" in
-/* )   ;;
-'' )   ;;
-* )    hierbase="/$hierbase" ;;
+/* )
+  ;;
+'' )
+  ;;
+* )
+  hierbase="/$hierbase"
+  ;;
 esac
 
 check_binary () {
-       # args: area-in-messages directory
-       # eg:   main             "$hierbase/main/binary-$iarch"
-       # checks whether $2 contains *.deb
-       if ! [ -d "$mountpoint$2/" ]
-       then
-               echo "'$2' does not exist."
-               return
-       fi
+  # args: area-in-messages directory
+  # eg:   main             "$hierbase/main/binary-$iarch"
+  # checks whether $2 contains *.deb
+  if ! [ -d "$mountpoint$2/" ]; then
+    echo "'$2' does not exist."
+    return
+  fi
 
-       if ! ( find -L "$mountpoint$2/" -name '*.deb' -print \
-               | head -n 1 ) 2>/dev/null  | grep . >/dev/null
-       then
-               echo "'$2' does not contain any *.deb packages.  Hmmpf."
-               return
-       fi
-       echo "Using '$2' as $1 binary dir."
-       this_binary="$2"
+  if ! ( find -L "$mountpoint$2/" -name '*.deb' -print \
+       | head -n 1 ) 2>/dev/null  | grep . >/dev/null; then
+    echo "'$2' does not contain any *.deb packages.  Hmmpf."
+    return
+  fi
+  echo "Using '$2' as $1 binary dir."
+  this_binary="$2"
 }
 
 find_area () {
-       # args: area-in-messages area-in-vars subdirectory-in-hier
-       #       last-time-binary last-time-packages
-       # eg:   main             main         main
-       #       "$p_main_binary" "$p_main_packages"
+  # args: area-in-messages area-in-vars subdirectory-in-hier
+  #       last-time-binary last-time-packages
+  # eg:   main             main         main
+  #       "$p_main_binary" "$p_main_packages"
 
-       this_binary=''
-       this_packages=''
-       if [ -n "$hierbase" ]
-       then
-               check_binary $1 "$hierbase/$3/binary-$iarch"
-       fi
+  this_binary=''
+  this_packages=''
+  if [ -n "$hierbase" ]; then
+    check_binary $1 "$hierbase/$3/binary-$iarch"
+  fi
 
-       if [ $2 = lcl ] && [ -z "$this_binary" ]
-       then
-               echo "
+  if [ $2 = lcl ] && [ -z "$this_binary" ]; then
+    echo "
 Note: By default there is no 'local' directory. It is intended for
 packages you made yourself."
-       fi
-       while [ -z "$this_binary" ]
-       do
-               defaultbinary="$4"
-               echo "
+  fi
+  while [ -z "$this_binary" ]; do
+    defaultbinary="$4"
+    echo "
 Which directory contains the *.deb packages from the $1 distribution
 area (this directory is named '$3/binary-$iarch' on the distribution site) ?
 Say 'none' if this area is not available."
-               if [ $2 != main ] && [ -z "$defaultbinary" ]
-               then
-                       defaultbinary=none
-               fi
-               echo -n \
+    if [ $2 != main ] && [ -z "$defaultbinary" ]; then
+      defaultbinary=none
+    fi
+    echo -n \
 "Enter _$1_ binary dir. [$4]
  ?  "
-               read response
-               if [ -z "$response" ] && [ -n "$defaultbinary" ]
-               then
-                       response="$defaultbinary"
-               fi
-               if [ none = "$response" ]
-               then
-                       break
-               fi
-               case "$response" in
-               '' | none)      continue                ;;
-               esac
-               check_binary $1 "$(echo \"$response\" | sed -e 's:/$::; 
s:^/*:/:')"
-       done
-       if [ -n "$this_binary" ]
-       then
-               for f in Packages.gz packages.gz Packages packages
-               do
-                       if [ -f "$mountpoint/$this_binary/$f" ]
-                       then
-                               echo "Using '$this_binary/$f' for $1."
-                               this_packages="$this_binary/$f"
-                               break
-                       fi
-               done
-               while [ -z "$this_packages" ]
-               do
-                       echo -n "
+    read response
+    if [ -z "$response" ] && [ -n "$defaultbinary" ]; then
+      response="$defaultbinary"
+    fi
+    if [ none = "$response" ]; then
+      break
+    fi
+    case "$response" in
+    '' | none)
+      continue
+      ;;
+    esac
+    check_binary $1 "$(echo \"$response\" | sed -e 's:/$::; s:^/*:/:')"
+  done
+  if [ -n "$this_binary" ]; then
+    for f in Packages.gz packages.gz Packages packages; do
+      if [ -f "$mountpoint/$this_binary/$f" ]; then
+        echo "Using '$this_binary/$f' for $1."
+        this_packages="$this_binary/$f"
+        break
+      fi
+    done
+    while [ -z "$this_packages" ]; do
+      echo -n "
 Cannot find the $1 'Packages' file. The information in the
 'Packages' file is important for package selection during new
 installations, and is very useful for upgrades.
@@ -263,22 +247,31 @@ you wish to install.
 Where is the _$1_ 'Packages' file (if none is available, say 'none')
 [$5]
  ?  "
-                       read response
-                       if [ -z "$response" ] && [ -n "$5" ]
-                       then
-                               response="$5"
-                       fi
-                       case "$response" in
-                       '')             continue                        ;;
-                       none)           break                           ;;
-                       scan)           this_packages=scan              ;;
-                       /*)             this_packages="$response"       ;;
-                       *)              this_packages="/$response"      ;;
-                       esac
-               done
-       fi
-       eval $2'_binary="$this_binary"'
-       eval $2'_packages="$this_packages"'
+      read response
+      if [ -z "$response" ] && [ -n "$5" ]; then
+        response="$5"
+      fi
+      case "$response" in
+      '')
+        continue
+        ;;
+      none)
+        break
+        ;;
+      scan)
+        this_packages=scan
+        ;;
+      /*)
+        this_packages="$response"
+        ;;
+      *)
+        this_packages="/$response"
+        ;;
+      esac
+    done
+  fi
+  eval $2'_binary="$this_binary"'
+  eval $2'_packages="$this_packages"'
 }
 
 find_area main main main "$p_main_binary" "$p_main_packages"
diff --git a/dselect/methods/disk/update b/dselect/methods/disk/update
index b77ce27a7..a5a1f3dac 100755
--- a/dselect/methods/disk/update
+++ b/dselect/methods/disk/update
@@ -23,70 +23,67 @@ cd "$vardir/methods/disk"
 . ./shvar.$option
 
 if [ -z "$p_main_packages" ] && [ -z "$p_ctb_packages" ] && \
-   [ -z "$p_nf_packages" ] && [ -z "$p_lcl_packages" ]
-then
-       echo '
+   [ -z "$p_nf_packages" ] && [ -z "$p_lcl_packages" ]; then
+  echo '
 No Packages files available, cannot update available packages list.
 Hit RETURN to continue.  '
-       read response
-       exit 0
+  read response
+  exit 0
 fi
 
 xit=1
 trap '
-       rm -f packages-main packages-ctb packages-nf packages-lcl
-       if [ -n "$umount" ]
-       then
-               umount "$umount" >/dev/null 2>&1
-       fi
-       exit $xit
+  rm -f packages-main packages-ctb packages-nf packages-lcl
+  if [ -n "$umount" ]; then
+    umount "$umount" >/dev/null 2>&1
+  fi
+  exit $xit
 ' 0
 
-if [ -n "$p_blockdev" ]
-then
-       umount="$p_mountpoint"
-       mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint"
+if [ -n "$p_blockdev" ]; then
+  umount="$p_mountpoint"
+  mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint"
 fi
 
 updatetype=update
 
-for f in main ctb nf lcl
-do
-       eval 'this_packages=$p_'$f'_packages'
-       case "$this_packages" in
-       '')
-               continue
-               ;;
-       scan)
-               eval 'this_binary=$p_'$f'_binary'
-               if [ -z "$this_binary" ]; then continue; fi
-               if [ "$updatetype" = update ]
-               then
-                       dpkg --admindir $vardir --clear-avail
-                       updatetype=merge
-               fi
-               echo Running dpkg --record-avail -R "$p_mountpoint$this_binary"
-               dpkg --admindir $vardir --record-avail -R 
"$p_mountpoint$this_binary"
-               ;;
-       *)
-               packagesfile="$p_mountpoint$this_packages"
-               case "$packagesfile" in
-               *.gz | *.Z | *.GZ | *.z)
-                       echo -n "Uncompressing $packagesfile ... "
-                       zcat <"$packagesfile" >packages-$f
-                       echo done.
-                       dpkg --admindir $vardir --$updatetype-avail packages-$f
-                       updatetype=merge
-                       ;;
-               '')
-                       ;;
-               *)
-                       dpkg --admindir $vardir --$updatetype-avail 
"$packagesfile"
-                       updatetype=merge
-                       ;;
-               esac
-               ;;
-       esac
+for f in main ctb nf lcl; do
+  eval 'this_packages=$p_'$f'_packages'
+  case "$this_packages" in
+  '')
+    continue
+    ;;
+  scan)
+    eval 'this_binary=$p_'$f'_binary'
+    if [ -z "$this_binary" ]; then
+      continue
+    fi
+    if [ "$updatetype" = update ]; then
+      dpkg --admindir $vardir --clear-avail
+      updatetype=merge
+    fi
+    echo Running dpkg --record-avail -R "$p_mountpoint$this_binary"
+    dpkg --admindir $vardir --record-avail -R "$p_mountpoint$this_binary"
+    ;;
+  *)
+    packagesfile="$p_mountpoint$this_packages"
+    case "$packagesfile" in
+    *.gz | *.Z | *.GZ | *.z)
+      echo -n "Uncompressing $packagesfile ... "
+      zcat <"$packagesfile" >packages-$f
+      echo done.
+      dpkg --admindir $vardir --$updatetype-avail packages-$f
+      updatetype=merge
+      ;;
+    '')
+      ;;
+    *)
+      dpkg --admindir $vardir --$updatetype-avail "$packagesfile"
+      updatetype=merge
+      ;;
+    esac
+  ;;
+  esac
 done
 
 echo -n 'Update OK.  Hit RETURN.  '
diff --git a/dselect/methods/multicd/install b/dselect/methods/multicd/install
index e4187d496..59227028b 100755
--- a/dselect/methods/multicd/install
+++ b/dselect/methods/multicd/install
@@ -21,54 +21,50 @@ vardir="$1"
 method=$2
 option=$3
 
-
 cd "$vardir/methods/$method"
 
 . ./shvar.$option
 
-
 #debug() { echo "DEBUG: $@"; }
-debug() { true; }
+debug() {
+  true
+}
 iarch=$(dpkg --print-architecture)
-ismulti() { test -e "$1/.disk/info" || test -e "$1$2/.disk/info"; }
+ismulti() {
+  test -e "$1/.disk/info" || test -e "$1$2/.disk/info"
+}
 
 # 1/ mountpoint
 # 2/ hierarchy
 getdisklabel () {
-    debug "$1" "$2"
-    if [ -f $1/.disk/info ]
-    then
-        echo -n $(head -1 "$1/.disk/info")
-    else
-        if [ -f $1$2/.disk/info ]
-       then
-            echo -n $(head -1 "$1$2/.disk/info")
-       else
-            echo -n 'Non-Debian disc'
-       fi
-    fi
+  debug "$1" "$2"
+  if [ -f $1/.disk/info ]; then
+   echo -n $(head -1 "$1/.disk/info")
+  elif [ -f $1$2/.disk/info ]; then
+    echo -n $(head -1 "$1$2/.disk/info")
+  else
+    echo -n 'Non-Debian disc'
+  fi
 }
 
 xit=1
 
 do_umount() {
-       if [ -n "$umount" ]; then
-               echo umount "$umount"
-               #">/dev/null" "2>&1"
-       fi
+  if [ -n "$umount" ]; then
+    echo umount "$umount"
+    #">/dev/null" "2>&1"
+  fi
 }
 
 do_mount() {
-       if [ ! -b "$p_blockdev" ]
-       then
-               loop=",loop"
-       fi
-
-       if [ -n "$p_blockdev" ]
-       then
-               umount="$p_mountpoint"
-               echo mount -rt iso9660 -o nosuid,nodev${loop} "$p_blockdev" 
"$p_mountpoint"\; umount="$p_mountpoint"
-       fi
+  if [ ! -b "$p_blockdev" ]; then
+    loop=",loop"
+  fi
+
+  if [ -n "$p_blockdev" ]; then
+    umount="$p_mountpoint"
+    echo mount -rt iso9660 -o nosuid,nodev${loop} "$p_blockdev" 
"$p_mountpoint"\; umount="$p_mountpoint"
+  fi
 }
 
 trap 'eval $(do_umount); exit $xit' 0
@@ -76,33 +72,34 @@ trap 'eval $(do_umount); exit $xit' 0
 eval $(do_mount)
 
 predep="$vardir/predep-package"
-while true
-do
-       thisdisk="$(getdisklabel ${p_mountpoint} ${p_hierbase})"
-       set +e
-       dpkg --predep-package >"$predep"
-       rc=$?
-       set -e
-       if test $rc = 1; then break; fi
-       test $rc = 0
-
-       perl -e '
-               ($binaryprefix,$predep,$thisdisk) = @ARGV;
-               open(P, "< $predep") or die "cannot open $predep: $!\n";
-               while (<P>) {
-                       s/\s*\n$//;
-                       $package= $_ if s/^Package: //i;
-                       /^X-Medium:\s+(.*)\s*/ and $medium = $1;
-                       @filename= split(/ /,$_) if s/^Filename: //i;
-                       @msdosfilename= split(/ /,$_) if s/^MSDOS-Filename: //i;
-               }
-               die "internal error - no package" if length($package) == 0;
-               die "internal error - no filename" if not @filename;
-               die "internal error - mismatch >@filename< >@msdosfilename<"
-                       if @filename && @msdosfilename &&
-                          @filename != @msdosfilename;
-               if ($medium && ($medium ne $thisdisk)) {
-                       print "
+while true; do
+  thisdisk="$(getdisklabel ${p_mountpoint} ${p_hierbase})"
+  set +e
+  dpkg --predep-package >"$predep"
+  rc=$?
+  set -e
+  if test $rc = 1; then
+    break
+  fi
+  test $rc = 0
+
+  perl -e '
+       ($binaryprefix,$predep,$thisdisk) = @ARGV;
+       open(P, "< $predep") or die "cannot open $predep: $!\n";
+       while (<P>) {
+               s/\s*\n$//;
+               $package= $_ if s/^Package: //i;
+               /^X-Medium:\s+(.*)\s*/ and $medium = $1;
+               @filename= split(/ /,$_) if s/^Filename: //i;
+               @msdosfilename= split(/ /,$_) if s/^MSDOS-Filename: //i;
+       }
+       die "internal error - no package" if length($package) == 0;
+       die "internal error - no filename" if not @filename;
+       die "internal error - mismatch >@filename< >@msdosfilename<"
+               if @filename && @msdosfilename &&
+                  @filename != @msdosfilename;
+       if ($medium && ($medium ne $thisdisk)) {
+               print "
 
 This is
     $thisdisk
@@ -111,40 +108,40 @@ However, $package is expected on disc:
 Please change the discs and press <RETURN>.
 
 ";
-                       exit(1);
-               }
-               @invoke=(); $|=1;
-               for ($i=0; $i<=$#filename; $i++) {
-                       $ppart= $i+1;
-                       print "Looking for part $ppart of $package ... ";
-                       if (-f "$binaryprefix$filename[$i]") {
-                               $print= $filename[$i];
-                               $invoke= "$binaryprefix$filename[$i]";
-                       } elsif (-f "$binaryprefix$msdosfilename[$i]") {
-                               $print= $msdosfilename[$i];
-                               $invoke= "$binaryprefix$msdosfilename[$i]";
-                       } else {
-                               $base= $filename[$i]; $base =~ s,.*/,,;
-                               $msdosbase= $msdosfilename[$i]; $msdosbase =~ 
s,.*/,,;
-                               $c = open(X, "-|"));
-                               if (not defined $c) {
-                                       die "failed to fork for find: $!\n";
-                               }
-                               if (!$c) {
-                                       exec("find", "-L",
-                                            length($binaryprefix) ? 
$binaryprefix : ".",
-                                            
"-name",$base,"-o","-name",$msdosbase);
-                                       die "failed to exec find: $!\n";
-                               }
-                               while (chop($invoke= <X>)) { last if -f 
$invoke; }
-                               $print= $invoke;
-                               if (substr($print,0,length($binaryprefix)+1) eq
-                                   "$binaryprefix/") {
-                                       $print= 
substr($print,length($binaryprefix));
-                               }
+               exit(1);
+       }
+       @invoke=(); $|=1;
+       for ($i=0; $i<=$#filename; $i++) {
+               $ppart= $i+1;
+               print "Looking for part $ppart of $package ... ";
+               if (-f "$binaryprefix$filename[$i]") {
+                       $print= $filename[$i];
+                       $invoke= "$binaryprefix$filename[$i]";
+               } elsif (-f "$binaryprefix$msdosfilename[$i]") {
+                       $print= $msdosfilename[$i];
+                       $invoke= "$binaryprefix$msdosfilename[$i]";
+               } else {
+                       $base= $filename[$i]; $base =~ s,.*/,,;
+                       $msdosbase= $msdosfilename[$i]; $msdosbase =~ s,.*/,,;
+                       $c = open(X, "-|"));
+                       if (not defined $c) {
+                               die "failed to fork for find: $!\n";
+                       }
+                       if (!$c) {
+                               exec("find", "-L",
+                                    length($binaryprefix) ? $binaryprefix : 
".",
+                                    "-name",$base,"-o","-name",$msdosbase);
+                               die "failed to exec find: $!\n";
                        }
-                       if (!length($invoke)) {
-                               warn "
+                       while (chop($invoke= <X>)) { last if -f $invoke; }
+                       $print= $invoke;
+                       if (substr($print,0,length($binaryprefix)+1) eq
+                           "$binaryprefix/") {
+                               $print= substr($print,length($binaryprefix));
+                       }
+               }
+               if (!length($invoke)) {
+                       warn "
 
 Cannot find the appropriate file(s) anywhere needed to install or upgrade
 package $package. Expecting version $version or later, as listed in the
@@ -157,18 +154,18 @@ and rerun the installation, or upgrade the package by 
using
 \"dpkg --install --auto-deconfigure" by hand.
 
 ";
-                               exit(1);
-                       }
-                       print "$print\n";
-                       push(@invoke,$invoke);
+                       exit(1);
                }
-               print "Running dpkg -iB for $package ...\n";
-               exec("dpkg","-iB","--",@invoke);
-               die "failed to exec dpkg: $!\n";
-       ' -- "$p_mountpoint$p_hierbase" "$predep" "$thisdisk"
+               print "$print\n";
+               push(@invoke,$invoke);
+       }
+       print "Running dpkg -iB for $package ...\n";
+       exec("dpkg","-iB","--",@invoke);
+       die "failed to exec dpkg: $!\n";
+  ' -- "$p_mountpoint$p_hierbase" "$predep" "$thisdisk"
 done
 
-       perl -e '
+perl -e '
        $SIG{INT} = sub { cd $vardir; unlink <tmp/*>; exit 1; };
        $| = 1;
        my ($vardir, $mountpoint, $hierbase, $mount, $umount) = @ARGV;
@@ -282,7 +279,6 @@ done
 
 ' "$vardir" "$p_mountpoint" "$p_hierbase" "$(do_mount)" "$(do_umount)"
 
-
 echo -n 'Installation OK.  Hit RETURN.  '
 read response
 
diff --git a/dselect/methods/multicd/setup b/dselect/methods/multicd/setup
index 46c89af2d..4ed0956a4 100755
--- a/dselect/methods/multicd/setup
+++ b/dselect/methods/multicd/setup
@@ -31,100 +31,94 @@ dist=stable
 
 xit=1
 trap '
-       rm -f $tp.?
-       if [ -n "$umount" ]
-       then
-               umount "$umount" >/dev/null 2>&1
-       fi
-       exit $xit
+  rm -f $tp.?
+  if [ -n "$umount" ]; then
+    umount "$umount" >/dev/null 2>&1
+  fi
+  exit $xit
 ' 0
 
-if ls -d "$tp.?" >/dev/null 2>&1
-then
-       rm $tp.?
+if ls -d "$tp.?" >/dev/null 2>&1; then
+  rm $tp.?
 fi
 
 #debug() { echo "DEBUG: $@"; }
-debug() { true; }
-ismulti() { debug $1 $2; test -e "$1/.disk/info" || test -e "$1$2/.disk/info"; 
}
+debug() {
+  true
+}
+ismulti() {
+  debug $1 $2; test -e "$1/.disk/info" || test -e "$1$2/.disk/info"
+}
 
 # 1/ mountpoint
 # 2/ hierarchy
 getdisklabel () {
-    debug "$1" "$2"
-    if [ -f $1/.disk/info ]
-    then
-        echo -n $(head -1 "$1/.disk/info")
-    else
-        if [ -f $1$2/.disk/info ]
-       then
-            echo -n $(head -1 "$1$2/.disk/info")
-       else
-            echo -n 'Non-Debian disc'
-       fi
-    fi
+  debug "$1" "$2"
+  if [ -f $1/.disk/info ]; then
+    echo -n $(head -1 "$1/.disk/info")
+  elif [ -f $1$2/.disk/info ]; then
+    echo -n $(head -1 "$1$2/.disk/info")
+  else
+    echo -n 'Non-Debian disc'
+  fi
 }
 
 yesno () {
-       while true
-       do
-               echo -n "$2 [$1]  "
-               read response
-               if [ -z "$response" ]
-               then
-                       response="$1"
-               fi
-               case "$response" in
-               [Nn]*)  yesno=no ; return ;;
-               [Yy]*)  yesno=yes ; return ;;
-               esac
-       done
+  while true; do
+    echo -n "$2 [$1]  "
+    read response
+    if [ -z "$response" ]; then
+      response="$1"
+    fi
+    case "$response" in
+    [Nn]*)
+      yesno=no
+      return
+      ;;
+    [Yy]*)
+      yesno=yes
+      return
+      ;;
+    esac
+  done
 }
 
 getblockdev () {
-       mountpoint="$vardir/methods/mnt"
-       if [ -z "$defaultdevice" ]
-       then
-               defaultdevice="$newdefaultdevice"
-       elif [ "$defaultdevice" != "$newdefaultdevice" ]
-       then
-               echo \
-       "Last time you specified installation from $defaultdevice."
-       fi
-       promptstring="$1"
-       while [ -z "$blockdevice" ]
-       do
-               echo -n "$promptstring [$defaultdevice]:  "
-               read response
-               if [ -z "$response" ]
-               then
-                       response="$defaultdevice"
-               fi
-               if [ ! -b "$response" ]
-               then
-                       echo "$response is not a block device - will try as 
loopback.";
-                       loop=",loop"
-               fi
-               tryblockdevice="$response"
-               if [ $option = multi_cd ]
-               then
-                       fstype=iso9660
-               fi
-               umount="$mountpoint"
-               if mount -rt "$fstype" -o nosuid,nodev$loop "$tryblockdevice" 
"$mountpoint"
-               then
-                       echo
-                       blockdevice="$tryblockdevice"
-               else
-                       umount=""
-                       echo \
-       "Unable to mount $tryblockdevice on $mountpoint, type $fstype."
-               fi
-       done
+  mountpoint="$vardir/methods/mnt"
+  if [ -z "$defaultdevice" ]; then
+    defaultdevice="$newdefaultdevice"
+  elif [ "$defaultdevice" != "$newdefaultdevice" ]; then
+    echo "Last time you specified installation from $defaultdevice."
+  fi
+  promptstring="$1"
+  while [ -z "$blockdevice" ]; do
+    echo -n "$promptstring [$defaultdevice]:  "
+    read response
+    if [ -z "$response" ]; then
+      response="$defaultdevice"
+    fi
+    if [ ! -b "$response" ]; then
+      echo "$response is not a block device - will try as loopback."
+      loop=",loop"
+    fi
+    tryblockdevice="$response"
+    if [ $option = multi_cd ]; then
+      fstype=iso9660
+    fi
+    umount="$mountpoint"
+    if mount -rt "$fstype" -o nosuid,nodev$loop "$tryblockdevice" "$mountpoint"
+    then
+      echo
+      blockdevice="$tryblockdevice"
+    else
+      umount=""
+      echo "Unable to mount $tryblockdevice on $mountpoint, type $fstype."
+    fi
+  done
 }
 
 outputparam () {
-       echo "$2" | sed -e "s/'/'\\\\''/; s/^/$1='/; s/$/'/" >&3
+  echo "$2" | sed -e "s/'/'\\\\''/; s/^/$1='/; s/$/'/" >&3
 }
 
 ## MAIN
@@ -151,117 +145,97 @@ If you make a mistake, use the interrupt key ($intrkey) 
to abort.
 #   The default block device to mount.
 
 p_usedevel=no
-if [ -f shvar.$option ]
-then
-       . ./shvar.$option
-       defaultdevice="$p_blockdev"
-       usedevel="$p_usedevel"
+if [ -f shvar.$option ]; then
+  . ./shvar.$option
+  defaultdevice="$p_blockdev"
+  usedevel="$p_usedevel"
 fi
 
-if [ $option = multi_cd ]
-then
-       mount >$tp.m
-       sed -n 's/ ([^)]*)$//; s/^[^ ]* on //; s/ type iso9660$//p' <$tp.m 
>$tp.l
-       ncdroms=$(wc -l <$tp.l)
-       if [ $ncdroms -gt 1 ]
-       then
-               response=""
-               while [ -z "$response" ]
-               do
-                       echo \
-       'Several CD-ROMs (or other ISO9660 filesystems) are mounted:'
-                       egrep 'type iso9660 \([^)]*\)$' <$tp.m | nl
-                       echo -n \
-       "Is it any of these ?  Type a number, or 'n' for none.  "
-                       read response
-                        response="$(echo \"$response\" | sed -e 's/[   ]*$//')"
-                       if expr "$response" : '[0-9][0-9]*$' >/dev/null && \
-                          [ $response -ge 1 -a $response -le $ncdroms ]
-                       then
-                                mountpoint="$(sed -n $response'p' <$tp.l)"
-                               echo
-                       elif expr "$response" : '[Nn]' >/dev/null
-                       then
-                               mountpoint=""
-                       else
-                               response=""
-                       fi
-               done
-       elif [ $ncdroms = 1 ]
-       then
-               mountpoint="$(cat $tp.l)"
-               perl -ne 'print if s/ type iso9660 \([^)]*\)$// && s/ on 
.*$//;' \
-                       <$tp.m >$tp.d
-               blockdevice="$(cat $tp.d)"
-               yesno yes \
-       "Found a CD-ROM: $blockdevice, mounted on $mountpoint. Is it the right 
one?"
-               if [ $yesno = no ]
-               then
-                       echo 'Unmounting it ...'
-                       umount="$mountpoint"
-                       while true
-                       do
-                               echo -n \
-       'Please insert the right disc, and hit return:  '
-                               read response
-                               if mount -rt iso9660 -o nosuid,nodev \
-                                       "$blockdevice" "$mountpoint"
-                               then
-                                       echo
-                                       break
-                               fi
-                       done
-               fi
-       fi
-       if [ -z "$mountpoint" ]
-       then
-               if [ -b /dev/cdrom ]
-               then
-                       echo \
-       'Found that /dev/cdrom exists and is a block device.'
-                       newdefaultdevice=/dev/cdrom
-               fi
-               getblockdev 'Insert the CD-ROM and enter the block device name'
-       fi
+if [ $option = multi_cd ]; then
+  mount >$tp.m
+  sed -n 's/ ([^)]*)$//; s/^[^ ]* on //; s/ type iso9660$//p' <$tp.m >$tp.l
+  ncdroms=$(wc -l <$tp.l)
+  if [ $ncdroms -gt 1 ]; then
+    response=""
+    while [ -z "$response" ]; do
+      echo 'Several CD-ROMs (or other ISO9660 filesystems) are mounted:'
+      egrep 'type iso9660 \([^)]*\)$' <$tp.m | nl
+      echo -n "Is it any of these ?  Type a number, or 'n' for none.  "
+      read response
+      response="$(echo \"$response\" | sed -e 's/[     ]*$//')"
+      if expr "$response" : '[0-9][0-9]*$' >/dev/null && \
+         [ $response -ge 1 -a $response -le $ncdroms ]; then
+               mountpoint="$(sed -n $response'p' <$tp.l)"
+        echo
+      elif expr "$response" : '[Nn]' >/dev/null; then
+        mountpoint=""
+      else
+        response=""
+      fi
+    done
+  elif [ $ncdroms = 1 ]; then
+    mountpoint="$(cat $tp.l)"
+    perl -ne 'print if s/ type iso9660 \([^)]*\)$// && s/ on .*$//;' \
+      <$tp.m >$tp.d
+    blockdevice="$(cat $tp.d)"
+    yesno yes \
+      "Found a CD-ROM: $blockdevice, mounted on $mountpoint. Is it the right 
one?"
+    if [ $yesno = no ]; then
+      echo 'Unmounting it ...'
+      umount="$mountpoint"
+      while true; do
+        echo -n 'Please insert the right disc, and hit return:  '
+        read response
+        if mount -rt iso9660 -o nosuid,nodev \
+           "$blockdevice" "$mountpoint"; then
+          echo
+          break
+        fi
+      done
+    fi
+  fi
+  if [ -z "$mountpoint" ]; then
+    if [ -b /dev/cdrom ]; then
+      echo 'Found that /dev/cdrom exists and is a block device.'
+      newdefaultdevice=/dev/cdrom
+    fi
+    getblockdev 'Insert the CD-ROM and enter the block device name'
+  fi
 fi
 
-if [ -n "$mountpoint" ]
-then
-       # We must have $mountpoint
-       if [ $option = multi_cd ]
-       then
-               echo \
+if [ -n "$mountpoint" ]; then
+  # We must have $mountpoint
+  if [ $option = multi_cd ]; then
+    echo \
 'All directory names should be entered relative to the root of the CD-ROM.
 '
-       else
-               echo \
+  else
+    echo \
 "All directory names should be entered relative to the root of the
 $fstype filesystem on $blockdevice.
 "
-       fi
+  fi
 fi
 
 # now try to get the users idea where the debian
 # hierarchy start below the mointpoint
 
 debug "mountpoint: $mountpoint"
-while true
-do
-       if ismulti "${mountpoint}" "${hierbase}"; then
-               multi=yes
-       fi
-
-       if [ $option = multi_cd ]
-       then
-               echo \
+while true; do
+  if ismulti "${mountpoint}" "${hierbase}"; then
+    multi=yes
+  fi
+
+  if [ $option = multi_cd ]; then
+    echo \
 "Need to know where on the CD-ROM the top level of the Debian
 distribution is - this will usually contain the 'dists' directory.
 
 If the CD-ROM is badly organized and doesn't have a straightforward copy of
 the distribution you may answer 'none' and the needed parts will be prompted
 individually."
-       else
-               echo \
+  else
+    echo \
 "In order to make it easy to find the relevant files, it is preferred
 to install from a straightforward copy of the Debian distribution.
 To use this, it is required to know where the top level of that copy of the
@@ -269,197 +243,189 @@ distribution is - this directory usually contains the 
Packages-Master file.
 
 If you do not have a straightforward copy of the distribution available
 just answer 'none' and the needed parts will be prompted individually."
-       fi
-
-       defhierbase=none
-       if [ -n "$p_hierbase" ]; then
-               if [ -d 
"$mountpoint/$p_hierbase/dists/$dist/main/binary-$iarch" \
-                       -o -n "$multi" ]; then
-                       echo "Last time you said '$p_hierbase', and that looks 
plausible."
-                       defhierbase="$p_hierbase"
-               else
-                       echo "
+  fi
+
+  defhierbase=none
+  if [ -n "$p_hierbase" ]; then
+    if [ -d "$mountpoint/$p_hierbase/dists/$dist/main/binary-$iarch" \
+         -o -n "$multi" ]; then
+      echo "Last time you said '$p_hierbase', and that looks plausible."
+      defhierbase="$p_hierbase"
+    else
+      echo "
 Last time you said '$p_hierbase', but that doesn't look plausible,
 since '$p_hierbase/dists/$dist/main/binary-$iarch' doesn't seem to exist.
 And it does not appear that you're using a multi-CD set."
-               fi
-       fi
-
-       # at this point defhierbase is set if it looks plausible
-       # if ‘none’ was entered, we assume a CD with a debian/ directory
-
-       if [ none = "$defhierbase" -a -d 
"$mountpoint/debian/dists/$dist/main/binary-$iarch" ]
-       then
-               echo "'/debian' exists and looks plausible, so that's the 
default."
-               defhierbase=/debian
-       fi
-
-       echo -n "Distribution top level ? [$defhierbase]  "
-       read response
-       if [ -z "$response" ]; then response="$defhierbase"; fi
-       if [ none = "$response" ]; then
-               hierbase=""
-               break
-       elif ismulti "$mountpoint" "$response" && [ -z "$multi" ]; then
-               multi=yes
-       fi
-
-       if ! [ -d "$mountpoint/$response/dists/$dist/main/binary-$iarch" \
-                       -o -n "$multi" ]; then
-               echo \
+    fi
+  fi
+
+  # at this point defhierbase is set if it looks plausible
+  # if ‘none’ was entered, we assume a CD with a debian/ directory
+
+  if [ none = "$defhierbase" -a -d 
"$mountpoint/debian/dists/$dist/main/binary-$iarch" ]
+  then
+    echo "'/debian' exists and looks plausible, so that's the default."
+    defhierbase=/debian
+  fi
+
+  echo -n "Distribution top level ? [$defhierbase]  "
+  read response
+  if [ -z "$response" ]; then
+    response="$defhierbase"
+  fi
+  if [ none = "$response" ]; then
+    hierbase=""
+    break
+  elif ismulti "$mountpoint" "$response" && [ -z "$multi" ]; then
+    multi=yes
+  fi
+
+  if ! [ -d "$mountpoint/$response/dists/$dist/main/binary-$iarch" \
+         -o -n "$multi" ]; then
+    echo \
 "Neither $response/dists/$dist/main/binary-$iarch does not exist,
 nor are you using a multi-CD set"
-               break
-       fi
-
-       hierbase="$(echo \"$response\" | sed -e 's:/$::; s:^/*:/:; s:/\+:/:g;')"
-       debug "hierbase: [$hierbase]"
-
-       if [ -n "$multi" ]; then
-               disklabel=$(getdisklabel "$mountpoint" "/$response")
-               echo "Ok, this is disc"
-               echo "    $disklabel"
-               #echo "Updating multi CD contents file cache ..."
-               
#multi_contentsfile="${mountpoint}/${response}/.disk/contents.gz"
-               #zcat "$multi_contentsfile" > disk-contents.$option
-       fi
-
-       break;
+    break
+  fi
+
+  hierbase="$(echo \"$response\" | sed -e 's:/$::; s:^/*:/:; s:/\+:/:g;')"
+  debug "hierbase: [$hierbase]"
+
+  if [ -n "$multi" ]; then
+    disklabel=$(getdisklabel "$mountpoint" "/$response")
+    echo "Ok, this is disc"
+    echo "    $disklabel"
+    #echo "Updating multi CD contents file cache ..."
+    #multi_contentsfile="${mountpoint}/${response}/.disk/contents.gz"
+    #zcat "$multi_contentsfile" > disk-contents.$option
+  fi
+
+  break;
 done
 
 distribution=$dist
-if [ -n "$hierbase" ]
-then
-       if [ -d "$mountpoint/$hierbase/dists/unstable/binary-$iarch" ]
-       then
-               echo \
+if [ -n "$hierbase" ]; then
+  if [ -d "$mountpoint/$hierbase/dists/unstable/binary-$iarch" ]; then
+    echo \
 '
 Both a stable released distribution and a work-in-progress
 development tree are available for installation.  Would you like to
 use the unreleased development tree (this is only recommended for
 experts who like to live dangerously and want to help with testing) ?'
-               yesno "$p_usedevel" 'Use unreleased development distribution ?'
-               usedevel="$yesno"
-               if [ "$usedevel" = yes ]
-               then
-                       distribution=development
-               fi
-       else
-               usedevel=no
-       fi
-       echo
+    yesno "$p_usedevel" 'Use unreleased development distribution ?'
+    usedevel="$yesno"
+    if [ "$usedevel" = yes ]; then
+      distribution=development
+    fi
+  else
+    usedevel=no
+  fi
+  echo
 fi
 
 case "$hierbase" in
-/* )   ;;
-'' )   ;;
-* )    hierbase="/$hierbase" ;;
+/* )
+  ;;
+'' )
+  ;;
+* )
+  hierbase="/$hierbase"
+  ;;
 esac
 
 check_binary () {
-       # args: area-in-messages directory
-       debug "check_binary($@)"
+  # args: area-in-messages directory
+  debug "check_binary($@)"
 
-       if [ ! -d "${mountpoint}$2" -a -z "$multi" ]
-       then
-               echo "'$2' does not exist."
-               return
-       fi
+  if [ ! -d "${mountpoint}$2" -a -z "$multi" ]; then
+    echo "'$2' does not exist."
+    return
+  fi
 
 # In this special case it is ok for a sub-distribution to not contain any
 # .deb files.  Each CD should contain all Packages.cd files but doesn't
 # need to contain the .deb files.
 #
-#      if ! { find -L "$mountpoint$2" -name '*.deb' -print \
-#              | head -1 | grep . ; } >/dev/null 2>&1 && [ -z "$multi" ];
-#      then
-#              echo "'$2' does not contain any *.deb packages."
-#              return
-#      fi
-
-       this_binary="$2"
-       echo -n "Using '$this_binary' as $1 binary directory"
-
-       if [ -n "$multi" ]; then
-               this_disk=$(getdisklabel ${mountpoint} "/$hierbase")
-               echo " from disc"
-               echo "    '$this_disk'"
-       else
-               echo ""
-       fi
+#   if ! { find -L "$mountpoint$2" -name '*.deb' -print \
+#     | head -1 | grep . ; } >/dev/null 2>&1 && [ -z "$multi" ];
+#   then
+#     echo "'$2' does not contain any *.deb packages."
+#     return
+#   fi
+
+  this_binary="$2"
+  echo -n "Using '$this_binary' as $1 binary directory"
+
+  if [ -n "$multi" ]; then
+    this_disk=$(getdisklabel ${mountpoint} "/$hierbase")
+    echo " from disc"
+    echo "    '$this_disk'"
+  else
+    echo ""
+  fi
 }
 
 find_area () {
-       # args: area-in-messages area-in-vars subdirectory-in-hier
-       #       last-time-binary last-time-packages
-       debug "find_area($@)"
-       this_binary=''
-       this_packages=''
-       this_disk=''
-       if [ -n "$hierbase" ]
-       then
-               check_binary $1 $(echo "$hierbase/dists/$3/$1/binary-$iarch" | 
sed 's:/\+:/:g')
-               debug "THIS_BINARY $this_binary"
-       fi
-       if [ $option = multi_cd -a $2 = nf -a -z "$this_binary" ]
-       then
-               echo "
+  # args: area-in-messages area-in-vars subdirectory-in-hier
+  #       last-time-binary last-time-packages
+  debug "find_area($@)"
+  this_binary=''
+  this_packages=''
+  this_disk=''
+  if [ -n "$hierbase" ]; then
+    check_binary $1 $(echo "$hierbase/dists/$3/$1/binary-$iarch" | sed 
's:/\+:/:g')
+    debug "THIS_BINARY $this_binary"
+  fi
+  if [ $option = multi_cd -a $2 = nf -a -z "$this_binary" ]; then
+    echo "
 Note: most CD-ROM distributions of Debian do not include programs
 available in the 'non-free' directory of the distribution site.
 This is because these programs have copyrights that prevent
 distribution for profit on a CD-ROM - ie they are not free software.
 If you wish to install these programs you'll have to get them from an
 alternative source."
-       fi
-       while [ -z "$this_binary" ]
-       do
-               defaultbinary="$4"
-               echo "
+  fi
+  while [ -z "$this_binary" ]; do
+    defaultbinary="$4"
+    echo "
 Which directory contains the *.deb packages from the $1 distribution
 area (this directory is named '$3/binary' on the distribution site) ?
 Say 'none' if this area is not available."
-               if [ $2 != main -a -z "$defaultbinary" ]
-               then
-                       defaultbinary=none
-               fi
-               echo -n \
+    if [ $2 != main -a -z "$defaultbinary" ]; then
+      defaultbinary=none
+    fi
+    echo -n \
 "Enter _$1_ binary directory. [$4]
  ?  "
-               read response
-               if [ -z "$response" -a -n "$defaultbinary" ]
-               then
-                       response="$defaultbinary"
-               fi
-               if [ none = "$response" ]
-               then
-                       break
-               fi
-               case "$response" in
-               '' | none)      continue                ;;
-               esac
-               check_binary $1 "$(echo \"$response\" | sed -e 's:/$::; 
s:^/*:/:')"
-       done
-       if [ -n "$this_binary" ]
-       then
-               if [ "$multi" = "yes" ]; then
-                       for f in Packages.cd.gz packages.cd.gz Packages.cd 
packages.cd
-                       do
-                               if [ -f "$mountpoint/$this_binary/$f" ]
-                               then
-                                       this_packages="$this_binary/$f"
-                                       echo "Using '$this_packages' for $1."
-                                       break
-                               fi
-                       done
-               else
-                       if [ -f 
"${mountpoint}${hierbase}/.disk/packages/$1/Packages.gz" ]; then
-                               this_packages=$(echo 
"${hierbase}/.disk/packages/$1/Packages.gz"|sed 's:/\+:/:g')
-                               echo "Using '${this_packages}' for $1."
-                       fi
-               fi
-               while [ -z "$this_packages" ]
-               do
-                       echo -n "
+    read response
+    if [ -z "$response" -a -n "$defaultbinary" ]; then
+      response="$defaultbinary"
+    fi
+    if [ none = "$response" ]; then
+      break
+    fi
+    case "$response" in
+    '' | none)
+      continue
+      ;;
+    esac
+    check_binary $1 "$(echo \"$response\" | sed -e 's:/$::; s:^/*:/:')"
+  done
+  if [ -n "$this_binary" ]; then
+    if [ "$multi" = "yes" ]; then
+      for f in Packages.cd.gz packages.cd.gz Packages.cd packages.cd; do
+        if [ -f "$mountpoint/$this_binary/$f" ]; then
+          this_packages="$this_binary/$f"
+          echo "Using '$this_packages' for $1."
+          break
+        fi
+      done
+    elif [ -f "${mountpoint}${hierbase}/.disk/packages/$1/Packages.gz" ]; then
+      this_packages=$(echo "${hierbase}/.disk/packages/$1/Packages.gz"|sed 
's:/\+:/:g')
+      echo "Using '${this_packages}' for $1."
+    fi
+    while [ -z "$this_packages" ]; do
+      echo -n "
 Cannot find the $1 'Packages.cd' file. The information in the
 'Packages.cd' file is important for package selection during new
 installations, and is very useful for upgrades.
@@ -477,23 +443,32 @@ you wish to install.
 Where is the _$1_ 'Packages.cd' file (if none is available, say 'none')
 [$5]
  ?  "
-                       read response
-                       if [ -z "$response" -a -n "$5" ]
-                       then
-                               response="$5"
-                       fi
-                       case "$response" in
-                       '')             break                           ;;
-                       none)           break                           ;;
-                       scan)           this_packages=scan              ;;
-                       /*)             this_packages="$response"       ;;
-                       *)              this_packages="/$response"      ;;
-                       esac
-               done
-       fi
-       eval $2'_binary="$this_binary"'
-       eval $2'_packages="$this_packages"'
-       eval $2'_disk="$this_disk"'
+      read response
+      if [ -z "$response" -a -n "$5" ]; then
+        response="$5"
+      fi
+      case "$response" in
+      '')
+        break
+        ;;
+      none)
+        break
+        ;;
+      scan)
+        this_packages=scan
+        ;;
+      /*)
+        this_packages="$response"
+        ;;
+      *)
+        this_packages="/$response"
+        ;;
+      esac
+    done
+  fi
+  eval $2'_binary="$this_binary"'
+  eval $2'_packages="$this_packages"'
+  eval $2'_disk="$this_disk"'
 }
 
 find_area main main "$distribution" "$p_main_binary" "$p_main_packages"
diff --git a/dselect/methods/multicd/update b/dselect/methods/multicd/update
index e32683907..0cbcf8527 100755
--- a/dselect/methods/multicd/update
+++ b/dselect/methods/multicd/update
@@ -27,93 +27,92 @@ cd "$vardir/methods/$method"
 . ./shvar.$option
 
 #debug() { echo "DEBUG: $@"; }
-debug() { true; }
-ismulti() { debug $1 $2; test -e "$1/.disk/info" || test -e "$1$2/.disk/info"; 
}
+debug() {
+  true
+}
+ismulti() {
+  debug $1 $2
+  test -e "$1/.disk/info" || test -e "$1$2/.disk/info"
+}
 
 packages=0
-for f in main ctb nf lcl
-do
-    eval 'this_packages=$p_'$f'_packages'
+for f in main ctb nf lcl; do
+  eval 'this_packages=$p_'$f'_packages'
 
-    if [ -n "$this_packages" ]
-    then
-       packages=1
-    fi
+  if [ -n "$this_packages" ]; then
+    packages=1
+  fi
 done
 
-if [ $packages eq 0 ]
-then
-       echo '
+if [ $packages eq 0 ]; then
+  echo '
 No Packages files available, cannot update available packages list.
 Hit RETURN to continue.  '
-       read response
-       exit 0
+  read response
+  exit 0
 fi
 
 xit=1
 trap '
-       rm -f packages-{main,ctb,nf,lcl}
-       if [ -n "$umount" ]
-       then
-               umount "$umount" >/dev/null 2>&1
-       fi
-       exit $xit
+  rm -f packages-{main,ctb,nf,lcl}
+  if [ -n "$umount" ]; then
+    umount "$umount" >/dev/null 2>&1
+  fi
+  exit $xit
 ' 0
 
-if [ ! -b "$p_blockdev" ]
-then
-       loop=",loop"
+if [ ! -b "$p_blockdev" ]; then
+  loop=",loop"
 fi
 
-if [ -n "$p_blockdev" ]
-then
-       umount="$p_mountpoint"
-       mount -rt "$p_fstype" -o nosuid,nodev${loop} "$p_blockdev" 
"$p_mountpoint"
+if [ -n "$p_blockdev" ]; then
+  umount="$p_mountpoint"
+  mount -rt "$p_fstype" -o nosuid,nodev${loop} "$p_blockdev" "$p_mountpoint"
 fi
 
 updatetype=update
 
 if [ -z "$p_multi" ]; then
-       exit 1
+  exit 1
 fi
 
-for f in main ctb nf lcl
-do
-       eval 'this_packages=$p_'$f'_packages'
-       case "$this_packages" in
-       '')
-               continue
-               ;;
-       scan)
-               eval 'this_binary=$p_'$f'_binary'
-               if [ -z "$this_binary" ]; then continue; fi
-               if [ "$updatetype" = update ]
-               then
-                       dpkg --clear-avail
-                       updatetype=merge
-               fi
-               echo Running dpkg --record-avail -R "$p_mountpoint$this_binary"
-               dpkg --record-avail -R "$p_mountpoint$this_binary"
-               ;;
-       *)
-               packagesfile="$p_mountpoint$this_packages"
-               case "$packagesfile" in
-               *.gz | *.Z | *.GZ | *.z)
-                       echo -n "Uncompressing $packagesfile ... "
-                       zcat <"$packagesfile" >packages-$f
-                       echo done.
-                       dpkg --$updatetype-avail packages-$f
-                       updatetype=merge
-                       ;;
-               '')
-                       ;;
-               *)
-                       dpkg --$updatetype-avail "$packagesfile"
-                       updatetype=merge
-                       ;;
-               esac
-               ;;
-       esac
+for f in main ctb nf lcl; do
+  eval 'this_packages=$p_'$f'_packages'
+  case "$this_packages" in
+  '')
+    continue
+    ;;
+  scan)
+    eval 'this_binary=$p_'$f'_binary'
+    if [ -z "$this_binary" ]; then
+      continue
+    fi
+    if [ "$updatetype" = update ]; then
+      dpkg --clear-avail
+      updatetype=merge
+    fi
+    echo Running dpkg --record-avail -R "$p_mountpoint$this_binary"
+    dpkg --record-avail -R "$p_mountpoint$this_binary"
+    ;;
+  *)
+    packagesfile="$p_mountpoint$this_packages"
+    case "$packagesfile" in
+    *.gz | *.Z | *.GZ | *.z)
+      echo -n "Uncompressing $packagesfile ... "
+      zcat <"$packagesfile" >packages-$f
+      echo done.
+      dpkg --$updatetype-avail packages-$f
+      updatetype=merge
+      ;;
+    '')
+      ;;
+    *)
+      dpkg --$updatetype-avail "$packagesfile"
+      updatetype=merge
+      ;;
+    esac
+  ;;
+  esac
 done
 
 cp -f $vardir/available $vardir/methods/$method
diff --git a/scripts/dpkg-maintscript-helper.sh 
b/scripts/dpkg-maintscript-helper.sh
index 07290735c..476cbcf7c 100755
--- a/scripts/dpkg-maintscript-helper.sh
+++ b/scripts/dpkg-maintscript-helper.sh
@@ -27,554 +27,564 @@
 ## Functions to remove an obsolete conffile during upgrade
 ##
 rm_conffile() {
-       local CONFFILE="$1"
-       local LASTVERSION="$2"
-       local PACKAGE="$3"
-       if [ "$LASTVERSION" = "--" ]; then
-               LASTVERSION=""
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-       if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-       # Skip remaining parameters up to --
-       while [ "$1" != "--" -a $# -gt 0 ]; do shift; done
-       [ $# -gt 0 ] || badusage "missing arguments after --"
-       shift
-
-       [ -n "$PACKAGE" ] || error "couldn't identify the package"
-       [ -n "$1" ] || error "maintainer script parameters are missing"
-       [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_NAME is required"
-       [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_PACKAGE is 
required"
-       [ "${CONFFILE}" != "${CONFFILE#/}" ] || \
-               error "conffile '$CONFFILE' is not an absolute path"
-       validate_optional_version "$LASTVERSION"
-
-       debug "Executing $0 rm_conffile in $DPKG_MAINTSCRIPT_NAME" \
-             "of $DPKG_MAINTSCRIPT_PACKAGE"
-       debug "CONFFILE=$CONFFILE PACKAGE=$PACKAGE" \
-             "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
-       case "$DPKG_MAINTSCRIPT_NAME" in
-       preinst)
-               if [ "$1" = "install" -o "$1" = "upgrade" ] && [ -n "$2" ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       prepare_rm_conffile "$CONFFILE" "$PACKAGE"
-               fi
-               ;;
-       postinst)
-               if [ "$1" = "configure" ] && [ -n "$2" ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       finish_rm_conffile "$CONFFILE"
-               fi
-               ;;
-       postrm)
-               if [ "$1" = "purge" ]; then
-                       rm -f "$DPKG_ROOT$CONFFILE.dpkg-bak" \
-                             "$DPKG_ROOT$CONFFILE.dpkg-remove" \
-                             "$DPKG_ROOT$CONFFILE.dpkg-backup"
-               fi
-               if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
-                  [ -n "$2" ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       abort_rm_conffile "$CONFFILE" "$PACKAGE"
-               fi
-               ;;
-       *)
-               debug "$0 rm_conffile not required in $DPKG_MAINTSCRIPT_NAME"
-               ;;
-       esac
+  local CONFFILE="$1"
+  local LASTVERSION="$2"
+  local PACKAGE="$3"
+
+  if [ "$LASTVERSION" = "--" ]; then
+    LASTVERSION=""
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+  if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+  # Skip remaining parameters up to --
+  while [ "$1" != "--" -a $# -gt 0 ]; do
+    shift
+  done
+  [ $# -gt 0 ] || badusage "missing arguments after --"
+  shift
+
+  [ -n "$PACKAGE" ] || error "couldn't identify the package"
+  [ -n "$1" ] || error "maintainer script parameters are missing"
+  [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_NAME is required"
+  [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_PACKAGE is required"
+  [ "${CONFFILE}" != "${CONFFILE#/}" ] || \
+    error "conffile '$CONFFILE' is not an absolute path"
+  validate_optional_version "$LASTVERSION"
+
+  debug "Executing $0 rm_conffile in $DPKG_MAINTSCRIPT_NAME" \
+        "of $DPKG_MAINTSCRIPT_PACKAGE"
+  debug "CONFFILE=$CONFFILE PACKAGE=$PACKAGE" \
+        "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
+  case "$DPKG_MAINTSCRIPT_NAME" in
+  preinst)
+    if [ "$1" = "install" -o "$1" = "upgrade" ] && [ -n "$2" ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      prepare_rm_conffile "$CONFFILE" "$PACKAGE"
+    fi
+    ;;
+  postinst)
+    if [ "$1" = "configure" ] && [ -n "$2" ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      finish_rm_conffile "$CONFFILE"
+    fi
+    ;;
+  postrm)
+    if [ "$1" = "purge" ]; then
+      rm -f "$DPKG_ROOT$CONFFILE.dpkg-bak" \
+            "$DPKG_ROOT$CONFFILE.dpkg-remove" \
+            "$DPKG_ROOT$CONFFILE.dpkg-backup"
+    fi
+    if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
+       [ -n "$2" ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      abort_rm_conffile "$CONFFILE" "$PACKAGE"
+    fi
+    ;;
+  *)
+    debug "$0 rm_conffile not required in $DPKG_MAINTSCRIPT_NAME"
+    ;;
+  esac
 }
 
 prepare_rm_conffile() {
-       local CONFFILE="$1"
-       local PACKAGE="$2"
-
-       [ -e "$DPKG_ROOT$CONFFILE" ] || return 0
-       ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
-
-       local md5sum old_md5sum
-       md5sum="$(md5sum "$DPKG_ROOT$CONFFILE" | sed -e 's/ .*//')"
-       old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$PACKAGE" | \
-               sed -n -e "\\'^ $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
-       if [ "$md5sum" != "$old_md5sum" ]; then
-               mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-backup"
-       else
-               mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-remove"
-       fi
+  local CONFFILE="$1"
+  local PACKAGE="$2"
+
+  [ -e "$DPKG_ROOT$CONFFILE" ] || return 0
+  ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
+
+  local md5sum old_md5sum
+  md5sum="$(md5sum "$DPKG_ROOT$CONFFILE" | sed -e 's/ .*//')"
+  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$PACKAGE" | \
+    sed -n -e "\\'^ $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+  if [ "$md5sum" != "$old_md5sum" ]; then
+    mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-backup"
+  else
+    mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-remove"
+  fi
 }
 
 finish_rm_conffile() {
-       local CONFFILE="$1"
-
-       if [ -e "$DPKG_ROOT$CONFFILE.dpkg-backup" ]; then
-               echo "Obsolete conffile $DPKG_ROOT$CONFFILE has been modified 
by you."
-               echo "Saving as $DPKG_ROOT$CONFFILE.dpkg-bak ..."
-               mv -f "$DPKG_ROOT$CONFFILE.dpkg-backup" 
"$DPKG_ROOT$CONFFILE.dpkg-bak"
-       fi
-       if [ -e "$DPKG_ROOT$CONFFILE.dpkg-remove" ]; then
-               echo "Removing obsolete conffile $DPKG_ROOT$CONFFILE ..."
-               rm -f "$DPKG_ROOT$CONFFILE.dpkg-remove"
-       fi
+  local CONFFILE="$1"
+
+  if [ -e "$DPKG_ROOT$CONFFILE.dpkg-backup" ]; then
+    echo "Obsolete conffile $DPKG_ROOT$CONFFILE has been modified by you."
+    echo "Saving as $DPKG_ROOT$CONFFILE.dpkg-bak ..."
+    mv -f "$DPKG_ROOT$CONFFILE.dpkg-backup" "$DPKG_ROOT$CONFFILE.dpkg-bak"
+  fi
+  if [ -e "$DPKG_ROOT$CONFFILE.dpkg-remove" ]; then
+    echo "Removing obsolete conffile $DPKG_ROOT$CONFFILE ..."
+    rm -f "$DPKG_ROOT$CONFFILE.dpkg-remove"
+  fi
 }
 
 abort_rm_conffile() {
-       local CONFFILE="$1"
-       local PACKAGE="$2"
-
-       ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
-
-       if [ -e "$DPKG_ROOT$CONFFILE.dpkg-remove" ]; then
-               echo "Reinstalling $DPKG_ROOT$CONFFILE that was moved away"
-               mv "$DPKG_ROOT$CONFFILE.dpkg-remove" "$DPKG_ROOT$CONFFILE"
-       fi
-       if [ -e "$DPKG_ROOT$CONFFILE.dpkg-backup" ]; then
-               echo "Reinstalling $DPKG_ROOT$CONFFILE that was backed-up"
-               mv "$DPKG_ROOT$CONFFILE.dpkg-backup" "$DPKG_ROOT$CONFFILE"
-       fi
+  local CONFFILE="$1"
+  local PACKAGE="$2"
+
+  ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
+
+  if [ -e "$DPKG_ROOT$CONFFILE.dpkg-remove" ]; then
+    echo "Reinstalling $DPKG_ROOT$CONFFILE that was moved away"
+    mv "$DPKG_ROOT$CONFFILE.dpkg-remove" "$DPKG_ROOT$CONFFILE"
+  fi
+  if [ -e "$DPKG_ROOT$CONFFILE.dpkg-backup" ]; then
+    echo "Reinstalling $DPKG_ROOT$CONFFILE that was backed-up"
+    mv "$DPKG_ROOT$CONFFILE.dpkg-backup" "$DPKG_ROOT$CONFFILE"
+  fi
 }
 
 ##
 ## Functions to rename a conffile during upgrade
 ##
 mv_conffile() {
-       local OLDCONFFILE="$1"
-       local NEWCONFFILE="$2"
-       local LASTVERSION="$3"
-       local PACKAGE="$4"
-       if [ "$LASTVERSION" = "--" ]; then
-               LASTVERSION=""
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-       if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-       # Skip remaining parameters up to --
-       while [ "$1" != "--" -a $# -gt 0 ]; do shift; done
-       [ $# -gt 0 ] || badusage "missing arguments after --"
-       shift
-
-       [ -n "$PACKAGE" ] || error "couldn't identify the package"
-       [ -n "$1" ] || error "maintainer script parameters are missing"
-       [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_NAME is required"
-       [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_PACKAGE is 
required"
-       [ "${OLDCONFFILE}" != "${OLDCONFFILE#/}" ] || \
-               error "old-conffile '$OLDCONFFILE' is not an absolute path"
-       [ "${NEWCONFFILE}" != "${NEWCONFFILE#/}" ] || \
-               error "new-conffile '$NEWCONFFILE' is not an absolute path"
-       validate_optional_version "$LASTVERSION"
-
-       debug "Executing $0 mv_conffile in $DPKG_MAINTSCRIPT_NAME" \
-             "of $DPKG_MAINTSCRIPT_PACKAGE"
-       debug "CONFFILE=$OLDCONFFILE -> $NEWCONFFILE PACKAGE=$PACKAGE" \
-             "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
-       case "$DPKG_MAINTSCRIPT_NAME" in
-       preinst)
-               if [ "$1" = "install" -o "$1" = "upgrade" ] && [ -n "$2" ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       prepare_mv_conffile "$OLDCONFFILE" "$PACKAGE"
-               fi
-               ;;
-       postinst)
-               if [ "$1" = "configure" ] && [ -n "$2" ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       finish_mv_conffile "$OLDCONFFILE" "$NEWCONFFILE" 
"$PACKAGE"
-               fi
-               ;;
-       postrm)
-               if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
-                  [ -n "$2" ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       abort_mv_conffile "$OLDCONFFILE" "$PACKAGE"
-               fi
-               ;;
-       *)
-               debug "$0 mv_conffile not required in $DPKG_MAINTSCRIPT_NAME"
-               ;;
-       esac
+  local OLDCONFFILE="$1"
+  local NEWCONFFILE="$2"
+  local LASTVERSION="$3"
+  local PACKAGE="$4"
+
+  if [ "$LASTVERSION" = "--" ]; then
+    LASTVERSION=""
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+  if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+  # Skip remaining parameters up to --
+  while [ "$1" != "--" -a $# -gt 0 ]; do
+    shift
+  done
+  [ $# -gt 0 ] || badusage "missing arguments after --"
+  shift
+
+  [ -n "$PACKAGE" ] || error "couldn't identify the package"
+  [ -n "$1" ] || error "maintainer script parameters are missing"
+  [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_NAME is required"
+  [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_PACKAGE is required"
+  [ "${OLDCONFFILE}" != "${OLDCONFFILE#/}" ] || \
+    error "old-conffile '$OLDCONFFILE' is not an absolute path"
+  [ "${NEWCONFFILE}" != "${NEWCONFFILE#/}" ] || \
+    error "new-conffile '$NEWCONFFILE' is not an absolute path"
+  validate_optional_version "$LASTVERSION"
+
+  debug "Executing $0 mv_conffile in $DPKG_MAINTSCRIPT_NAME" \
+        "of $DPKG_MAINTSCRIPT_PACKAGE"
+  debug "CONFFILE=$OLDCONFFILE -> $NEWCONFFILE PACKAGE=$PACKAGE" \
+        "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
+  case "$DPKG_MAINTSCRIPT_NAME" in
+  preinst)
+    if [ "$1" = "install" -o "$1" = "upgrade" ] && [ -n "$2" ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      prepare_mv_conffile "$OLDCONFFILE" "$PACKAGE"
+    fi
+    ;;
+  postinst)
+    if [ "$1" = "configure" ] && [ -n "$2" ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      finish_mv_conffile "$OLDCONFFILE" "$NEWCONFFILE" "$PACKAGE"
+    fi
+    ;;
+  postrm)
+    if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
+       [ -n "$2" ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      abort_mv_conffile "$OLDCONFFILE" "$PACKAGE"
+    fi
+    ;;
+  *)
+    debug "$0 mv_conffile not required in $DPKG_MAINTSCRIPT_NAME"
+    ;;
+  esac
 }
 
 prepare_mv_conffile() {
-       local CONFFILE="$1"
-       local PACKAGE="$2"
+  local CONFFILE="$1"
+  local PACKAGE="$2"
 
-       [ -e "$DPKG_ROOT$CONFFILE" ] || return 0
+  [ -e "$DPKG_ROOT$CONFFILE" ] || return 0
 
-       ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
+  ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
 
-       local md5sum old_md5sum
-       md5sum="$(md5sum "$DPKG_ROOT$CONFFILE" | sed -e 's/ .*//')"
-       old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$PACKAGE" | \
-               sed -n -e "\\'^ $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
-       if [ "$md5sum" = "$old_md5sum" ]; then
-               mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-remove"
-       fi
+  local md5sum old_md5sum
+  md5sum="$(md5sum "$DPKG_ROOT$CONFFILE" | sed -e 's/ .*//')"
+  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$PACKAGE" | \
+    sed -n -e "\\'^ $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+  if [ "$md5sum" = "$old_md5sum" ]; then
+    mv -f "$DPKG_ROOT$CONFFILE" "$DPKG_ROOT$CONFFILE.dpkg-remove"
+  fi
 }
 
 finish_mv_conffile() {
-       local OLDCONFFILE="$1"
-       local NEWCONFFILE="$2"
-       local PACKAGE="$3"
+  local OLDCONFFILE="$1"
+  local NEWCONFFILE="$2"
+  local PACKAGE="$3"
 
-       rm -f "$DPKG_ROOT$OLDCONFFILE.dpkg-remove"
+  rm -f "$DPKG_ROOT$OLDCONFFILE.dpkg-remove"
 
-       [ -e "$DPKG_ROOT$OLDCONFFILE" ] || return 0
-       ensure_package_owns_file "$PACKAGE" "$OLDCONFFILE" || return 0
+  [ -e "$DPKG_ROOT$OLDCONFFILE" ] || return 0
+  ensure_package_owns_file "$PACKAGE" "$OLDCONFFILE" || return 0
 
-       echo "Preserving user changes to $DPKG_ROOT$NEWCONFFILE (renamed from 
$DPKG_ROOT$OLDCONFFILE)..."
-       if [ -e "$DPKG_ROOT$NEWCONFFILE" ]; then
-               mv -f "$DPKG_ROOT$NEWCONFFILE" "$DPKG_ROOT$NEWCONFFILE.dpkg-new"
-       fi
-       mv -f "$DPKG_ROOT$OLDCONFFILE" "$DPKG_ROOT$NEWCONFFILE"
+  echo "Preserving user changes to $DPKG_ROOT$NEWCONFFILE (renamed from 
$DPKG_ROOT$OLDCONFFILE)..."
+  if [ -e "$DPKG_ROOT$NEWCONFFILE" ]; then
+    mv -f "$DPKG_ROOT$NEWCONFFILE" "$DPKG_ROOT$NEWCONFFILE.dpkg-new"
+  fi
+  mv -f "$DPKG_ROOT$OLDCONFFILE" "$DPKG_ROOT$NEWCONFFILE"
 }
 
 abort_mv_conffile() {
-       local CONFFILE="$1"
-       local PACKAGE="$2"
+  local CONFFILE="$1"
+  local PACKAGE="$2"
 
-       ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
+  ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
 
-       if [ -e "$DPKG_ROOT$CONFFILE.dpkg-remove" ]; then
-               echo "Reinstalling $DPKG_ROOT$CONFFILE that was moved away"
-               mv "$DPKG_ROOT$CONFFILE.dpkg-remove" "$DPKG_ROOT$CONFFILE"
-       fi
+  if [ -e "$DPKG_ROOT$CONFFILE.dpkg-remove" ]; then
+    echo "Reinstalling $DPKG_ROOT$CONFFILE that was moved away"
+    mv "$DPKG_ROOT$CONFFILE.dpkg-remove" "$DPKG_ROOT$CONFFILE"
+  fi
 }
 
 ##
 ## Functions to replace a symlink with a directory
 ##
 symlink_to_dir() {
-       local SYMLINK="$1"
-       local SYMLINK_TARGET="$2"
-       local LASTVERSION="$3"
-       local PACKAGE="$4"
-
-       if [ "$LASTVERSION" = "--" ]; then
-               LASTVERSION=""
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-       if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-
-       # Skip remaining parameters up to --
-       while [ "$1" != "--" -a $# -gt 0 ]; do shift; done
-       [ $# -gt 0 ] || badusage "missing arguments after --"
-       shift
-
-       [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_NAME is required"
-       [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_PACKAGE is 
required"
-       [ -n "$PACKAGE" ] || error "cannot identify the package"
-       [ -n "$SYMLINK" ] || error "symlink parameter is missing"
-       [ "${SYMLINK#/}" = "$SYMLINK" ] && \
-               error "symlink pathname is not an absolute path"
-       [ "${SYMLINK%/}" = "$SYMLINK" ] || \
-               error "symlink pathname ends with a slash"
-       [ -n "$SYMLINK_TARGET" ] || error "original symlink target is missing"
-       [ -n "$1" ] || error "maintainer script parameters are missing"
-       validate_optional_version "$LASTVERSION"
-
-       debug "Executing $0 symlink_to_dir in $DPKG_MAINTSCRIPT_NAME" \
-             "of $DPKG_MAINTSCRIPT_PACKAGE"
-       debug "SYMLINK=$SYMLINK -> $SYMLINK_TARGET PACKAGE=$PACKAGE" \
-             "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
-
-       case "$DPKG_MAINTSCRIPT_NAME" in
-       preinst)
-               if [ "$1" = "install" -o "$1" = "upgrade" ] &&
-                  [ -n "$2" ] && [ -h "$DPKG_ROOT$SYMLINK" ] &&
-                  symlink_match "$SYMLINK" "$SYMLINK_TARGET" &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       mv -f "$DPKG_ROOT$SYMLINK" 
"$DPKG_ROOT${SYMLINK}.dpkg-backup"
-               fi
-               ;;
-       postinst)
-               # We cannot bail depending on the version, as here we only
-               # know what was the last configured version, and we might
-               # have been unpacked, then upgraded with an unpack and thus
-               # never been configured before.
-               if [ "$1" = "configure" ] &&
-                  [ -h "$DPKG_ROOT${SYMLINK}.dpkg-backup" ] &&
-                  symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET"
-               then
-                       rm -f "$DPKG_ROOT${SYMLINK}.dpkg-backup"
-               fi
-               ;;
-       postrm)
-               if [ "$1" = "purge" ] && [ -h 
"$DPKG_ROOT${SYMLINK}.dpkg-backup" ]; then
-                       rm -f "$DPKG_ROOT${SYMLINK}.dpkg-backup"
-               fi
-               if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
-                  [ -n "$2" ] &&
-                  [ ! -e "$DPKG_ROOT$SYMLINK" ] &&
-                  [ -h "$DPKG_ROOT${SYMLINK}.dpkg-backup" ] &&
-                  symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET" &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       echo "Restoring backup of $DPKG_ROOT$SYMLINK ..."
-                       mv "$DPKG_ROOT${SYMLINK}.dpkg-backup" 
"$DPKG_ROOT$SYMLINK"
-               fi
-               ;;
-       *)
-               debug "$0 symlink_to_dir not required in $DPKG_MAINTSCRIPT_NAME"
-               ;;
-       esac
+  local SYMLINK="$1"
+  local SYMLINK_TARGET="$2"
+  local LASTVERSION="$3"
+  local PACKAGE="$4"
+
+  if [ "$LASTVERSION" = "--" ]; then
+    LASTVERSION=""
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+  if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+
+  # Skip remaining parameters up to --
+  while [ "$1" != "--" -a $# -gt 0 ]; do
+    shift
+  done
+  [ $# -gt 0 ] || badusage "missing arguments after --"
+  shift
+
+  [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_NAME is required"
+  [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_PACKAGE is required"
+  [ -n "$PACKAGE" ] || error "cannot identify the package"
+  [ -n "$SYMLINK" ] || error "symlink parameter is missing"
+  [ "${SYMLINK#/}" = "$SYMLINK" ] && \
+    error "symlink pathname is not an absolute path"
+  [ "${SYMLINK%/}" = "$SYMLINK" ] || \
+    error "symlink pathname ends with a slash"
+  [ -n "$SYMLINK_TARGET" ] || error "original symlink target is missing"
+  [ -n "$1" ] || error "maintainer script parameters are missing"
+  validate_optional_version "$LASTVERSION"
+
+  debug "Executing $0 symlink_to_dir in $DPKG_MAINTSCRIPT_NAME" \
+        "of $DPKG_MAINTSCRIPT_PACKAGE"
+  debug "SYMLINK=$SYMLINK -> $SYMLINK_TARGET PACKAGE=$PACKAGE" \
+        "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
+
+  case "$DPKG_MAINTSCRIPT_NAME" in
+  preinst)
+    if [ "$1" = "install" -o "$1" = "upgrade" ] &&
+       [ -n "$2" ] && [ -h "$DPKG_ROOT$SYMLINK" ] &&
+       symlink_match "$SYMLINK" "$SYMLINK_TARGET" &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      mv -f "$DPKG_ROOT$SYMLINK" "$DPKG_ROOT${SYMLINK}.dpkg-backup"
+    fi
+    ;;
+  postinst)
+    # We cannot bail depending on the version, as here we only
+    # know what was the last configured version, and we might
+    # have been unpacked, then upgraded with an unpack and thus
+    # never been configured before.
+    if [ "$1" = "configure" ] &&
+       [ -h "$DPKG_ROOT${SYMLINK}.dpkg-backup" ] &&
+       symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET"
+    then
+      rm -f "$DPKG_ROOT${SYMLINK}.dpkg-backup"
+    fi
+    ;;
+  postrm)
+    if [ "$1" = "purge" ] && [ -h "$DPKG_ROOT${SYMLINK}.dpkg-backup" ]; then
+      rm -f "$DPKG_ROOT${SYMLINK}.dpkg-backup"
+    fi
+    if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
+       [ -n "$2" ] &&
+       [ ! -e "$DPKG_ROOT$SYMLINK" ] &&
+       [ -h "$DPKG_ROOT${SYMLINK}.dpkg-backup" ] &&
+       symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET" &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      echo "Restoring backup of $DPKG_ROOT$SYMLINK ..."
+      mv "$DPKG_ROOT${SYMLINK}.dpkg-backup" "$DPKG_ROOT$SYMLINK"
+    fi
+    ;;
+  *)
+    debug "$0 symlink_to_dir not required in $DPKG_MAINTSCRIPT_NAME"
+    ;;
+  esac
 }
 
 ##
 ## Functions to replace a directory with a symlink
 ##
 dir_to_symlink() {
-       local PATHNAME="${1%/}"
-       local SYMLINK_TARGET="$2"
-       local LASTVERSION="$3"
-       local PACKAGE="$4"
-
-       if [ "$LASTVERSION" = "--" ]; then
-               LASTVERSION=""
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-       if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
-               
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
-       fi
-
-       # Skip remaining parameters up to --
-       while [ "$1" != "--" -a $# -gt 0 ]; do shift; done
-       [ $# -gt 0 ] || badusage "missing arguments after --"
-       shift
-
-       [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_NAME is required"
-       [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
-               error "environment variable DPKG_MAINTSCRIPT_PACKAGE is 
required"
-       [ -n "$PACKAGE" ] || error "cannot identify the package"
-       [ -n "$PATHNAME" ] || error "directory parameter is missing"
-       [ "${PATHNAME#/}" = "$PATHNAME" ] && \
-               error "directory parameter is not an absolute path"
-       [ -n "$SYMLINK_TARGET" ] || error "new symlink target is missing"
-       [ -n "$1" ] || error "maintainer script parameters are missing"
-       validate_optional_version "$LASTVERSION"
-
-       debug "Executing $0 dir_to_symlink in $DPKG_MAINTSCRIPT_NAME" \
-             "of $DPKG_MAINTSCRIPT_PACKAGE"
-       debug "PATHNAME=$PATHNAME SYMLINK_TARGET=$SYMLINK_TARGET" \
-             "PACKAGE=$PACKAGE LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
-
-       case "$DPKG_MAINTSCRIPT_NAME" in
-       preinst)
-               if [ "$1" = "install" -o "$1" = "upgrade" ] &&
-                  [ -n "$2" ] &&
-                  [ ! -h "$DPKG_ROOT$PATHNAME" ] &&
-                  [ -d "$DPKG_ROOT$PATHNAME" ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       prepare_dir_to_symlink "$PACKAGE" "$PATHNAME"
-               fi
-               ;;
-       postinst)
-               # We cannot bail depending on the version, as here we only
-               # know what was the last configured version, and we might
-               # have been unpacked, then upgraded with an unpack and thus
-               # never been configured before.
-               if [ "$1" = "configure" ] &&
-                  [ -d "$DPKG_ROOT${PATHNAME}.dpkg-backup" ] &&
-                  [ ! -h "$DPKG_ROOT$PATHNAME" ] &&
-                  [ -d "$DPKG_ROOT$PATHNAME" ] &&
-                  [ -f "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir" ]; then
-                       finish_dir_to_symlink "$PATHNAME" "$SYMLINK_TARGET"
-               fi
-               ;;
-       postrm)
-               if [ "$1" = "purge" ] &&
-                  [ -d "$DPKG_ROOT${PATHNAME}.dpkg-backup" ]; then
-                       rm -rf "$DPKG_ROOT${PATHNAME}.dpkg-backup"
-               fi
-               if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
-                  [ -n "$2" ] &&
-                  [ -d "$DPKG_ROOT${PATHNAME}.dpkg-backup" ] &&
-                  [ \( ! -h "$DPKG_ROOT$PATHNAME" -a \
-                       -d "$DPKG_ROOT$PATHNAME" -a \
-                       -f "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir" \) -o \
-                    \( -h "$DPKG_ROOT$PATHNAME" -a \
-                       \( "$(readlink "$DPKG_ROOT$PATHNAME")" = 
"$SYMLINK_TARGET" -o \
-                          "$(dpkg-realpath "$DPKG_ROOT$PATHNAME")" = 
"$SYMLINK_TARGET" \) \) ] &&
-                  dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
-                       abort_dir_to_symlink "$PATHNAME"
-               fi
-               ;;
-       *)
-               debug "$0 dir_to_symlink not required in $DPKG_MAINTSCRIPT_NAME"
-               ;;
-       esac
+  local PATHNAME="${1%/}"
+  local SYMLINK_TARGET="$2"
+  local LASTVERSION="$3"
+  local PACKAGE="$4"
+
+  if [ "$LASTVERSION" = "--" ]; then
+    LASTVERSION=""
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+  if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
+    
PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
+  fi
+
+  # Skip remaining parameters up to --
+  while [ "$1" != "--" -a $# -gt 0 ]; do
+    shift
+  done
+  [ $# -gt 0 ] || badusage "missing arguments after --"
+  shift
+
+  [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_NAME is required"
+  [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] || \
+    error "environment variable DPKG_MAINTSCRIPT_PACKAGE is required"
+  [ -n "$PACKAGE" ] || error "cannot identify the package"
+  [ -n "$PATHNAME" ] || error "directory parameter is missing"
+  [ "${PATHNAME#/}" = "$PATHNAME" ] && \
+    error "directory parameter is not an absolute path"
+  [ -n "$SYMLINK_TARGET" ] || error "new symlink target is missing"
+  [ -n "$1" ] || error "maintainer script parameters are missing"
+  validate_optional_version "$LASTVERSION"
+
+  debug "Executing $0 dir_to_symlink in $DPKG_MAINTSCRIPT_NAME" \
+        "of $DPKG_MAINTSCRIPT_PACKAGE"
+  debug "PATHNAME=$PATHNAME SYMLINK_TARGET=$SYMLINK_TARGET" \
+        "PACKAGE=$PACKAGE LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"
+
+  case "$DPKG_MAINTSCRIPT_NAME" in
+  preinst)
+    if [ "$1" = "install" -o "$1" = "upgrade" ] &&
+       [ -n "$2" ] &&
+       [ ! -h "$DPKG_ROOT$PATHNAME" ] &&
+       [ -d "$DPKG_ROOT$PATHNAME" ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      prepare_dir_to_symlink "$PACKAGE" "$PATHNAME"
+    fi
+    ;;
+  postinst)
+    # We cannot bail depending on the version, as here we only
+    # know what was the last configured version, and we might
+    # have been unpacked, then upgraded with an unpack and thus
+    # never been configured before.
+    if [ "$1" = "configure" ] &&
+       [ -d "$DPKG_ROOT${PATHNAME}.dpkg-backup" ] &&
+       [ ! -h "$DPKG_ROOT$PATHNAME" ] &&
+       [ -d "$DPKG_ROOT$PATHNAME" ] &&
+       [ -f "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir" ]; then
+      finish_dir_to_symlink "$PATHNAME" "$SYMLINK_TARGET"
+    fi
+    ;;
+  postrm)
+    if [ "$1" = "purge" ] &&
+       [ -d "$DPKG_ROOT${PATHNAME}.dpkg-backup" ]; then
+      rm -rf "$DPKG_ROOT${PATHNAME}.dpkg-backup"
+    fi
+    if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
+       [ -n "$2" ] &&
+       [ -d "$DPKG_ROOT${PATHNAME}.dpkg-backup" ] &&
+       [ \( ! -h "$DPKG_ROOT$PATHNAME" -a \
+            -d "$DPKG_ROOT$PATHNAME" -a \
+            -f "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir" \) -o \
+         \( -h "$DPKG_ROOT$PATHNAME" -a \
+            \( "$(readlink "$DPKG_ROOT$PATHNAME")" = "$SYMLINK_TARGET" -o \
+               "$(dpkg-realpath "$DPKG_ROOT$PATHNAME")" = "$SYMLINK_TARGET" \) 
\) ] &&
+       dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+      abort_dir_to_symlink "$PATHNAME"
+    fi
+    ;;
+  *)
+    debug "$0 dir_to_symlink not required in $DPKG_MAINTSCRIPT_NAME"
+    ;;
+  esac
 }
 
 prepare_dir_to_symlink()
 {
-       local PACKAGE="$1"
-       local PATHNAME="$2"
-
-       local LINE
-       # If there are conffiles we should not perform the switch.
-       dpkg-query -W -f='${Conffiles}\n' "$PACKAGE" | while read -r LINE; do
-               case "$LINE" in
-               "$PATHNAME"/*)
-                       error "directory '$PATHNAME' contains conffiles," \
-                             "cannot switch to symlink"
-                       ;;
-               esac
-       done
-
-       # If there are locally created files or files owned by another package
-       # we should not perform the switch.
-       export DPKG_MAINTSCRIPT_HELPER_INTERNAL_API="$version"
-       find "$DPKG_ROOT$PATHNAME" -print0 | \
-               xargs -0 -n1 "$0" _internal_pkg_must_own_file "$PACKAGE" || \
-               error "directory '$PATHNAME' contains files not owned by" \
-                     "package $PACKAGE, cannot switch to symlink"
-       unset DPKG_MAINTSCRIPT_HELPER_INTERNAL_API
-
-       # At this point, we know that the directory either contains no files,
-       # or only non-conffiles owned by the package.
-       #
-       # To do the switch we cannot simply replace it with the final symlink
-       # just yet, because dpkg needs to remove any file present in the old
-       # package that have disappeared in the new one, and we do not want to
-       # lose files resolving to the same pathname in the symlink target.
-       #
-       # We cannot replace the directory with a staging symlink either,
-       # because dpkg will update symlinks to their new target.
-       #
-       # So we need to create a staging directory, to avoid removing files
-       # from other packages, and to trap any new files in the directory
-       # to move them to their correct place later on.
-       mv -f "$DPKG_ROOT$PATHNAME" "$DPKG_ROOT${PATHNAME}.dpkg-backup"
-       mkdir "$DPKG_ROOT$PATHNAME"
-
-       # Mark it as a staging directory, so that we can track things.
-       touch "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir"
+  local PACKAGE="$1"
+  local PATHNAME="$2"
+
+  local LINE
+  # If there are conffiles we should not perform the switch.
+  dpkg-query -W -f='${Conffiles}\n' "$PACKAGE" | while read -r LINE; do
+    case "$LINE" in
+    "$PATHNAME"/*)
+      error "directory '$PATHNAME' contains conffiles," \
+            "cannot switch to symlink"
+      ;;
+    esac
+  done
+
+  # If there are locally created files or files owned by another package
+  # we should not perform the switch.
+  export DPKG_MAINTSCRIPT_HELPER_INTERNAL_API="$version"
+  find "$DPKG_ROOT$PATHNAME" -print0 | \
+    xargs -0 -n1 "$0" _internal_pkg_must_own_file "$PACKAGE" || \
+    error "directory '$PATHNAME' contains files not owned by" \
+          "package $PACKAGE, cannot switch to symlink"
+  unset DPKG_MAINTSCRIPT_HELPER_INTERNAL_API
+
+  # At this point, we know that the directory either contains no files,
+  # or only non-conffiles owned by the package.
+  #
+  # To do the switch we cannot simply replace it with the final symlink
+  # just yet, because dpkg needs to remove any file present in the old
+  # package that have disappeared in the new one, and we do not want to
+  # lose files resolving to the same pathname in the symlink target.
+  #
+  # We cannot replace the directory with a staging symlink either,
+  # because dpkg will update symlinks to their new target.
+  #
+  # So we need to create a staging directory, to avoid removing files
+  # from other packages, and to trap any new files in the directory
+  # to move them to their correct place later on.
+  mv -f "$DPKG_ROOT$PATHNAME" "$DPKG_ROOT${PATHNAME}.dpkg-backup"
+  mkdir "$DPKG_ROOT$PATHNAME"
+
+  # Mark it as a staging directory, so that we can track things.
+  touch "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir"
 }
 
 finish_dir_to_symlink()
 {
-       local PATHNAME="$1"
-       local SYMLINK_TARGET="$2"
-
-       # Move the contents of the staging directory to the symlink target,
-       # as those are all new files installed between this package being
-       # unpacked and configured.
-       local ABS_SYMLINK_TARGET
-       if [ "${SYMLINK_TARGET#/}" = "$SYMLINK_TARGET" ]; then
-               ABS_SYMLINK_TARGET="$(dirname "$PATHNAME")/$SYMLINK_TARGET"
-       else
-               ABS_SYMLINK_TARGET="$SYMLINK_TARGET"
-       fi
-       rm "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir"
-       find "$DPKG_ROOT$PATHNAME" -mindepth 1 -maxdepth 1 -print0 | \
-               xargs -0 -i% mv -f "%" "$DPKG_ROOT$ABS_SYMLINK_TARGET/"
-
-       # Remove the staging directory.
-       rmdir "$DPKG_ROOT$PATHNAME"
-
-       # Do the actual switch.
-       ln -s "$SYMLINK_TARGET" "$DPKG_ROOT$PATHNAME"
-
-       # We are left behind the old files owned by this package in the backup
-       # directory, just remove it.
-       rm -rf "$DPKG_ROOT${PATHNAME}.dpkg-backup"
+  local PATHNAME="$1"
+  local SYMLINK_TARGET="$2"
+
+  # Move the contents of the staging directory to the symlink target,
+  # as those are all new files installed between this package being
+  # unpacked and configured.
+  local ABS_SYMLINK_TARGET
+  if [ "${SYMLINK_TARGET#/}" = "$SYMLINK_TARGET" ]; then
+    ABS_SYMLINK_TARGET="$(dirname "$PATHNAME")/$SYMLINK_TARGET"
+  else
+    ABS_SYMLINK_TARGET="$SYMLINK_TARGET"
+  fi
+  rm "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir"
+  find "$DPKG_ROOT$PATHNAME" -mindepth 1 -maxdepth 1 -print0 | \
+    xargs -0 -i% mv -f "%" "$DPKG_ROOT$ABS_SYMLINK_TARGET/"
+
+  # Remove the staging directory.
+  rmdir "$DPKG_ROOT$PATHNAME"
+
+  # Do the actual switch.
+  ln -s "$SYMLINK_TARGET" "$DPKG_ROOT$PATHNAME"
+
+  # We are left behind the old files owned by this package in the backup
+  # directory, just remove it.
+  rm -rf "$DPKG_ROOT${PATHNAME}.dpkg-backup"
 }
 
 abort_dir_to_symlink()
 {
-       local PATHNAME="$1"
-
-       echo "Restoring backup of $DPKG_ROOT$PATHNAME ..."
-       if [ -h "$DPKG_ROOT$PATHNAME" ]; then
-               rm -f "$DPKG_ROOT$PATHNAME"
-       else
-               # The staging directory must be empty, as no other package
-               # should have been unpacked in between.
-               rm -f "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir"
-               rmdir "$DPKG_ROOT$PATHNAME"
-       fi
-
-       mv "$DPKG_ROOT${PATHNAME}.dpkg-backup" "$DPKG_ROOT$PATHNAME"
+  local PATHNAME="$1"
+
+  echo "Restoring backup of $DPKG_ROOT$PATHNAME ..."
+  if [ -h "$DPKG_ROOT$PATHNAME" ]; then
+    rm -f "$DPKG_ROOT$PATHNAME"
+  else
+    # The staging directory must be empty, as no other package
+    # should have been unpacked in between.
+    rm -f "$DPKG_ROOT$PATHNAME/.dpkg-staging-dir"
+    rmdir "$DPKG_ROOT$PATHNAME"
+  fi
+
+  mv "$DPKG_ROOT${PATHNAME}.dpkg-backup" "$DPKG_ROOT$PATHNAME"
 }
 
 # Common functions
 validate_optional_version() {
-       local VERSION="$1"
+  local VERSION="$1"
 
-       if [ -z "$VERSION" ]; then
-               return
-       fi
+  if [ -z "$VERSION" ]; then
+    return
+  fi
 
-       if ! VERSIONCHECK=$(dpkg --validate-version -- "$VERSION" 2>&1); then
-               error "$VERSIONCHECK"
-       fi
+  if ! VERSIONCHECK=$(dpkg --validate-version -- "$VERSION" 2>&1); then
+    error "$VERSIONCHECK"
+  fi
 }
 
 ensure_package_owns_file() {
-       local PACKAGE="$1"
-       local FILE="$2"
-
-       if ! dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"; then
-               debug "File '$FILE' not owned by package " \
-                     "'$PACKAGE', skipping $command"
-               return 1
-       fi
-       return 0
+  local PACKAGE="$1"
+  local FILE="$2"
+
+  if ! dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"; then
+    debug "File '$FILE' not owned by package " \
+          "'$PACKAGE', skipping $command"
+    return 1
+  fi
+  return 0
 }
 
 internal_pkg_must_own_file()
 {
-       local PACKAGE="$1"
-       local FILE="${2##$DPKG_ROOT}"
+  local PACKAGE="$1"
+  local FILE="${2##$DPKG_ROOT}"
 
-       if [ "$DPKG_MAINTSCRIPT_HELPER_INTERNAL_API" != "$version" ]; then
-               error "internal API used by external command"
-       fi
+  if [ "$DPKG_MAINTSCRIPT_HELPER_INTERNAL_API" != "$version" ]; then
+    error "internal API used by external command"
+  fi
 
-       if ! ensure_package_owns_file "$PACKAGE" "$FILE"; then
-               error "file '$FILE' not owned by package '$PACKAGE'"
-       fi
-       return 0
+  if ! ensure_package_owns_file "$PACKAGE" "$FILE"; then
+    error "file '$FILE' not owned by package '$PACKAGE'"
+  fi
+  return 0
 }
 
 symlink_match()
 {
-       local SYMLINK="$1"
-       local SYMLINK_TARGET="$2"
+  local SYMLINK="$1"
+  local SYMLINK_TARGET="$2"
 
-       [ "$(readlink "$DPKG_ROOT$SYMLINK")" = "$SYMLINK_TARGET" ] || \
-       [ "$(dpkg-realpath "$DPKG_ROOT$SYMLINK")" = "$SYMLINK_TARGET" ]
+  [ "$(readlink "$DPKG_ROOT$SYMLINK")" = "$SYMLINK_TARGET" ] || \
+  [ "$(dpkg-realpath "$DPKG_ROOT$SYMLINK")" = "$SYMLINK_TARGET" ]
 }
 
 usage() {
-       cat <<END
+  cat <<END
 Usage: $PROGNAME <command> <parameter>... -- <maintainer-script-parameter>...
 
 Commands:
   supports <command>
-       Returns 0 (success) if the given command is supported, 1 otherwise.
+        Returns 0 (success) if the given command is supported, 1 otherwise.
   rm_conffile <conffile> [<last-version> [<package>]]
-       Remove obsolete conffile. Must be called in preinst, postinst and
-       postrm.
+        Remove obsolete conffile. Must be called in preinst, postinst and
+        postrm.
   mv_conffile <old-conf> <new-conf> [<last-version> [<package>]]
-       Rename a conffile. Must be called in preinst, postinst and postrm.
+        Rename a conffile. Must be called in preinst, postinst and postrm.
   symlink_to_dir <pathname> <old-symlink-target> [<last-version> [<package>]]
-       Replace a symlink with a directory. Must be called in preinst,
-       postinst and postrm.
+        Replace a symlink with a directory. Must be called in preinst,
+        postinst and postrm.
   dir_to_symlink <pathname> <new-symlink-target> [<last-version> [<package>]]
-       Replace a directory with a symlink. Must be called in preinst,
-       postinst and postrm.
+        Replace a directory with a symlink. Must be called in preinst,
+        postinst and postrm.
   help
   -?, --help
-       Show this help message.
+        Show this help message.
       --version
-       Show the version.
+        Show the version.
 END
 }
 
@@ -597,53 +607,53 @@ shift
 
 case "$command" in
 supports)
-       case "$1" in
-       rm_conffile|mv_conffile|symlink_to_dir|dir_to_symlink)
-               code=0
-               ;;
-       *)
-               code=1
-               ;;
-       esac
-       if [ -z "$DPKG_MAINTSCRIPT_NAME" ]; then
-               warning "environment variable DPKG_MAINTSCRIPT_NAME missing"
-               code=1
-       fi
-       if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
-               warning "environment variable DPKG_MAINTSCRIPT_PACKAGE missing"
-               code=1
-       fi
-       exit $code
-       ;;
+  case "$1" in
+  rm_conffile|mv_conffile|symlink_to_dir|dir_to_symlink)
+    code=0
+    ;;
+  *)
+    code=1
+    ;;
+  esac
+  if [ -z "$DPKG_MAINTSCRIPT_NAME" ]; then
+    warning "environment variable DPKG_MAINTSCRIPT_NAME missing"
+    code=1
+  fi
+  if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
+    warning "environment variable DPKG_MAINTSCRIPT_PACKAGE missing"
+    code=1
+  fi
+  exit $code
+  ;;
 rm_conffile)
-       rm_conffile "$@"
-       ;;
+  rm_conffile "$@"
+  ;;
 mv_conffile)
-       mv_conffile "$@"
-       ;;
+  mv_conffile "$@"
+  ;;
 symlink_to_dir)
-       symlink_to_dir "$@"
-       ;;
+  symlink_to_dir "$@"
+  ;;
 dir_to_symlink)
-       dir_to_symlink "$@"
-       ;;
+  dir_to_symlink "$@"
+  ;;
 _internal_pkg_must_own_file)
-       # This is an internal command, must not be used outside this program.
-       internal_pkg_must_own_file "$@"
-       ;;
+  # This is an internal command, must not be used outside this program.
+  internal_pkg_must_own_file "$@"
+  ;;
 --help|help|-?)
-       usage
-       ;;
+  usage
+  ;;
 --version)
-       cat <<-END
-       Debian $PROGNAME version $version.
+  cat <<END
+Debian $PROGNAME version $version.
 
-       This is free software; see the GNU General Public License version 2 or
-       later for copying conditions. There is NO warranty.
-       END
-       ;;
+This is free software; see the GNU General Public License version 2 or
+later for copying conditions. There is NO warranty.
+END
+  ;;
 *)
-       badusage "command $command is unknown
+  badusage "command $command is unknown
 Hint: upgrading dpkg to a newer version might help."
 esac
 

-- 
Dpkg.Org's dpkg

Reply via email to