home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / alsa-base.preinst < prev    next >
Encoding:
Text File  |  2009-04-08  |  1.2 KB  |  47 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. # Prepare to move a conffile without triggering a dpkg question
  6. prep_mv_conffile() {
  7.     CONFFILE="$1"
  8.  
  9.     if [ -e "$CONFFILE" ]; then
  10.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  11.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`"
  12.         if [ "$md5sum" = "$old_md5sum" ]; then
  13.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  14.         fi
  15.     fi
  16. }
  17.  
  18. case "$1" in
  19.   install|upgrade)
  20.     # The following must be deleted at preinst time
  21.     # so that dpkg can remove their parent directories
  22.     # Delete obsolete dev.d symlinks
  23.     for N in 0 1 2 3 4 5 6 7 ; do
  24.         D="/etc/dev.d/snd/controlC$N"
  25.         if [ -d "$D" ] ; then
  26.             L="$D/alsa-base.dev"
  27.             rm -fv "$L"
  28.         fi
  29.     done
  30.     # Delete obsolete dev.d script
  31.     rm -fv /etc/alsa/dev.d/alsa-base
  32.     # Delete obsolete init script
  33.     rm -fv /etc/init.d/alsa
  34.     # Rename alsa-base
  35.     if dpkg --compare-versions "$2" lt "1.0.18.dfsg-1ubuntu5"; then
  36.         prep_mv_conffile /etc/modprobe.d/alsa-base \
  37.                      /etc/modprobe.d/alsa-base.conf
  38.         prep_mv_conffile /etc/modprobe.d/blacklist-modem \
  39.                      /etc/modprobe.d/blacklist-modem.conf
  40.     fi
  41.     ;;
  42. # abort-upgrade)
  43. esac
  44.  
  45.  
  46.  
  47.