home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / bluez-gnome.preinst < prev    next >
Encoding:
Text File  |  2009-04-08  |  664 b   |  27 lines

  1. #!/bin/sh
  2.  
  3. # snip from http://www.dpkg.org/ConffileHandling
  4.  
  5. # Prepare to move a conffile without triggering a dpkg question
  6. prep_mv_conffile() {
  7.     PKGNAME="$1"
  8.     CONFFILE="$2"
  9.  
  10.     if [ -e "$CONFFILE" ]; then
  11.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  12.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
  13.         if [ "$md5sum" = "$old_md5sum" ]; then
  14.             rm -f "$CONFFILE"
  15.         fi
  16.     fi
  17. }
  18.  
  19. case "$1" in
  20. install|upgrade)
  21.     if dpkg --compare-versions "$2" le "0.5-2"; then
  22.         prep_mv_conffile "/etc/xdg/autostart/bt-applet.desktop"
  23.     fi
  24. esac
  25.         
  26.  
  27.