~xubuntu-dev/xubuntu-default-settings/trunk

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Lionel Le Folgoc
  • Date: 2009-02-07 14:37:08 UTC
  • Revision ID: mrpouit@ubuntu.com-20090207143708-5e2cssr18ve06ote
set native mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
# Remove a no-longer used conffile
 
6
rm_conffile() {
 
7
    CONFFILE="$1"
 
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
 
 
13
        if [ "$md5sum" != "$old_md5sum" ]; then
 
14
            echo "Obsolete conffile $CONFFILE has been modified by you."
 
15
            echo "Saving as $CONFFILE.dpkg-bak ..."
 
16
            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
 
17
        else
 
18
            echo "Removing obsolete conffile $CONFFILE ..."
 
19
            rm -f "$CONFFILE"
 
20
        fi
 
21
    fi
 
22
}
 
23
 
 
24
case "$1" in
 
25
install|upgrade)
 
26
    if dpkg --compare-versions "$2" le "0.47"; then
 
27
        rm_conffile "/etc/xdg/Thunar/thunarrc"
 
28
        rm_conffile "/etc/xdg/Thunar/volmanrc"
 
29
        rm_conffile "/etc/xdg/xfce4/panel/launcher-2.rc"
 
30
        rm_conffile "/etc/xdg/xfce4/panel/launcher-3.rc"
 
31
        rm_conffile "/etc/xdg/xfce4/panel/panels.xml"
 
32
        rm_conffile "/etc/xdg/xfce4/panel/places-2.rc"
 
33
        rm_conffile "/etc/xdg/xfce4/panel/separator-3.rc"
 
34
        rm_conffile "/etc/xdg/xfce4/panel/systray-4.rc"
 
35
        rm_conffile "/etc/xdg/xfce4/panel/tasklist-2.rc"
 
36
        rm_conffile "/etc/xdg/xfce4/panel/xfce4-menu-1.rc"
 
37
        rm_conffile "/etc/xdg/xfce4/panel/xfce4-mixer-5.rc"
 
38
        rm_conffile "/etc/xdg/xfce4/mcs_settings/gtk.xml"
 
39
        rm_conffile "/etc/xdg/xfce4/mcs_settings/desktop.xml"
 
40
        rm_conffile "/etc/xdg/xfce4/mcs_settings/xfwm4.xml"
 
41
        rm_conffile "/etc/xdg/xfce4/mcs_settings/wmtweaks.xml"
 
42
        rm_conffile "/etc/xdg/xfce4/mcs_settings/workspaces.xml"
 
43
        rm_conffile "/etc/xdg/xfce4/mcs_settings/xfprint.xml"
 
44
    fi
 
45
esac
 
46
 
 
47
 
 
48
#DEBHELPER#