diff -Nru tgif-4.2.5/debian/changelog tgif-4.2.5/debian/changelog --- tgif-4.2.5/debian/changelog 2012-04-16 07:20:31.000000000 +0000 +++ tgif-4.2.5/debian/changelog 2012-06-16 11:23:37.000000000 +0000 @@ -1,3 +1,11 @@ +tgif (1:4.2.5-1.2) unstable; urgency=low + + * Non-maintainer upload. + * debian/preinst: Also support clean installation when package was previously + removed but not purged. closes: #666227 + + -- Willi Mann Sat, 16 Jun 2012 13:05:52 +0200 + tgif (1:4.2.5-1.1) unstable; urgency=low * Non-maintainer upload. diff -Nru tgif-4.2.5/debian/preinst tgif-4.2.5/debian/preinst --- tgif-4.2.5/debian/preinst 2011-03-01 22:46:59.000000000 +0000 +++ tgif-4.2.5/debian/preinst 2012-06-16 11:13:08.000000000 +0000 @@ -3,24 +3,26 @@ #DEBHELPER# case $1 in - install|abort-upgrade ) + abort-upgrade ) exit 0 ;; - upgrade ) - # Remove old config file if upgrading from tgif <= 3.0p13-1 - rm -rf /etc/X11/tgif - # Clean up app-defaults files from previous versions of the postinst - # script tgif (< 4.2.2-4). This should restore the files to their - # pristine state unless the user has made additional alterations. - for bit in "" "/ja_JP.eucJP" "/ru"; do - file=/etc/X11$bit/app-defaults/Tgif - # Remove all instances of the - # Tgif*InitialPaperSize: - # Tgif*GridSystem: - # line pairs appended by old versions of postinst. - sed '/Tgif\*InitialPaperSize/,+1 d' $file > $file.clean - mv $file.clean $file - done + install|upgrade ) + if [ ! -z "$2" ]; then + # Remove old config file if upgrading from tgif <= 3.0p13-1 + rm -rf /etc/X11/tgif + # Clean up app-defaults files from previous versions of the postinst + # script tgif (< 4.2.2-4). This should restore the files to their + # pristine state unless the user has made additional alterations. + for bit in "" "/ja_JP.eucJP" "/ru"; do + file=/etc/X11$bit/app-defaults/Tgif + # Remove all instances of the + # Tgif*InitialPaperSize: + # Tgif*GridSystem: + # line pairs appended by old versions of postinst. + sed '/Tgif\*InitialPaperSize/,+1 d' $file > $file.clean + mv $file.clean $file + done + fi ;; * ) echo "preinst called with unknown argument \`$1'" >&2