~ubuntu-desktop/gvfs/ubuntu

« back to all changes in this revision

Viewing changes to debian/gvfs-bin.preinst

  • Committer: Martin Pitt
  • Date: 2010-03-23 20:00:29 UTC
  • Revision ID: martin.pitt@canonical.com-20100323200029-7bl7ok6wefwvpuuh
abandon branch in favor of lp:ubuntu/gvfs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
set -e
3
 
 
4
 
# Remove a no-longer used conffile
5
 
rm_conffile() {
6
 
    PKGNAME="$1"
7
 
    CONFFILE="$2"
8
 
 
9
 
    if [ -e "$CONFFILE" ]; then
10
 
        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
11
 
        old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
12
 
        if [ "$md5sum" != "$old_md5sum" ]; then
13
 
            echo "Obsolete conffile $CONFFILE has been modified by you."
14
 
            echo "Saving as $CONFFILE.dpkg-bak ..."
15
 
            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
16
 
        else
17
 
            echo "Removing obsolete conffile $CONFFILE ..."
18
 
            rm -f "$CONFFILE"
19
 
        fi
20
 
    fi
21
 
}
22
 
 
23
 
if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt-nl 1.5.1-0ubuntu2; then
24
 
    rm_conffile gvfs-bin /etc/profile.d/gvfs-bash-completion.sh
25
 
fi
26
 
 
27
 
 
28
 
#DEBHELPER#