[23239] | 1 | #!/bin/sh |
---|
| 2 | # postinst script for debathena-gdm-config |
---|
| 3 | # |
---|
| 4 | # see: dh_installdeb(1) |
---|
| 5 | |
---|
| 6 | set -e |
---|
| 7 | |
---|
| 8 | # summary of how this script can be called: |
---|
| 9 | # * <postinst> `configure' <most-recently-configured-version> |
---|
| 10 | # * <old-postinst> `abort-upgrade' <new version> |
---|
| 11 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
---|
| 12 | # <new-version> |
---|
| 13 | # * <postinst> `abort-remove' |
---|
| 14 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
---|
| 15 | # <failed-install-package> <version> `removing' |
---|
| 16 | # <conflicting-package> <version> |
---|
| 17 | # for details, see http://www.debian.org/doc/debian-policy/ or |
---|
| 18 | # the debian-policy package |
---|
| 19 | |
---|
| 20 | |
---|
[24128] | 21 | package=debathena-gdm-config |
---|
| 22 | ours=.debathena |
---|
| 23 | theirs=.debathena-orig |
---|
| 24 | |
---|
| 25 | undivert_unlink_symlink() |
---|
| 26 | { |
---|
| 27 | file="$1" |
---|
| 28 | ourfile="$2" |
---|
| 29 | theirfile="$3" |
---|
| 30 | if [ ! -L "$file" ] || \ |
---|
| 31 | [ "$(readlink "$file")" != "$(basename "$ourfile")" -a \ |
---|
| 32 | "$(readlink "$file")" != "$(basename "$theirfile")" ]; then |
---|
| 33 | echo "*** OMINOUS WARNING ***: $file is not linked to either $(basename "$ourfile") or $(basename "$theirfile")" >&2 |
---|
| 34 | else |
---|
| 35 | rm -f "$file" |
---|
| 36 | fi |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | undivert_unlink_divert() |
---|
| 40 | { |
---|
| 41 | file="$1" |
---|
| 42 | if [ ! -L "$file" ] && [ ! -e "$file" ]; then |
---|
| 43 | dpkg-divert --remove --rename --package "$package" "$file" |
---|
| 44 | else |
---|
| 45 | echo "Not removing diversion of $file by $package" >&2 |
---|
| 46 | fi |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | undivert_unlink() |
---|
| 50 | { |
---|
| 51 | prefix=$1 |
---|
| 52 | suffix=$2 |
---|
| 53 | |
---|
| 54 | file=$prefix$suffix |
---|
| 55 | ourfile=$prefix$ours$suffix |
---|
| 56 | theirfile=$prefix$theirs$suffix |
---|
| 57 | |
---|
| 58 | undivert_unlink_symlink "$file" "$ourfile" "$theirfile" |
---|
| 59 | undivert_unlink_divert "$file" "$package" |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | cleanup_old_diversion() { |
---|
| 63 | file="$1" |
---|
| 64 | if dpkg-divert --list "${file}" | grep -Fxq "diversion of ${file} to ${file}${theirs} by ${package}"; then |
---|
| 65 | undivert_unlink "$file" |
---|
| 66 | fi |
---|
| 67 | } |
---|
| 68 | |
---|
[23239] | 69 | case "$1" in |
---|
| 70 | configure) |
---|
[24128] | 71 | gdm_version="$(dpkg-query -W -f '${Version}' gdm)" |
---|
| 72 | if dpkg --compare-versions "$gdm_version" ge '2.25.2~'; then |
---|
| 73 | cleanup_old_diversion /etc/gdm/gdm.conf |
---|
| 74 | cleanup_old_diversion /etc/gdm/gdm.conf-custom |
---|
[24207] | 75 | cleanup_old_diversion /usr/share/gdm/BuiltInSessions/default.desktop |
---|
[24645] | 76 | cleanup_old_diversion /usr/share/images/xsplash/bg_2560x1600.debathena.jpg |
---|
| 77 | cleanup_old_diversion /usr/share/images/xsplash/throbber_small.debathena.png |
---|
| 78 | cleanup_old_diversion /usr/share/images/xsplash/throbber_medium.debathena.png |
---|
| 79 | cleanup_old_diversion /usr/share/images/xsplash/throbber_large.debathena.png |
---|
| 80 | cleanup_old_diversion /usr/share/images/xsplash/throbber_xtra_large.debathena.png |
---|
[24128] | 81 | fi |
---|
| 82 | |
---|
[23267] | 83 | if test -f /var/run/gdm.pid ; then |
---|
| 84 | if hash invoke-rc.d 2>/dev/null; then |
---|
[24063] | 85 | invoke-rc.d gdm reload || true |
---|
[23267] | 86 | else |
---|
[24063] | 87 | /etc/init.d/gdm reload || true |
---|
[23267] | 88 | fi |
---|
| 89 | fi |
---|
[24025] | 90 | # We don't actually want the "unknown metapackage" file, but it |
---|
| 91 | # needs to be present in case you have debathena-gdm-config and |
---|
| 92 | # nothing else, so give it priority 0. |
---|
| 93 | update-alternatives --install \ |
---|
| 94 | /usr/share/gdm/themes/debathena/metapackage.svg \ |
---|
| 95 | debathena-metapackage.svg \ |
---|
| 96 | /usr/share/gdm/themes/debathena/metapackage-unknown.svg \ |
---|
| 97 | 0 |
---|
[23239] | 98 | ;; |
---|
| 99 | |
---|
| 100 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
| 101 | ;; |
---|
| 102 | |
---|
| 103 | *) |
---|
| 104 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
| 105 | exit 1 |
---|
| 106 | ;; |
---|
| 107 | esac |
---|
| 108 | |
---|
| 109 | # dh_installdeb will replace this with shell code automatically |
---|
| 110 | # generated by other debhelper scripts. |
---|
| 111 | |
---|
| 112 | #DEBHELPER# |
---|
| 113 | |
---|
| 114 | exit 0 |
---|
| 115 | |
---|
| 116 | |
---|