[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-fonts-devel] Bug#700054: fonts-takao: does not remove ttf-japanese-*.ttf alternatives on upgrades from squeeze



Followup-For: Bug #700054

Attaching the patch. This patch uses versions for a maintainer upload of
-8, for a NMU I'd do s/-8/-7.1/.

Andreas
diffstat for fonts-takao-003.02.01 fonts-takao-003.02.01

 changelog                  |   14 ++++++++++++++
 fonts-takao-gothic.preinst |    8 ++++++--
 fonts-takao-mincho.preinst |   12 +++++++-----
 ttf-takao-gothic.preinst   |   13 +++++++++++++
 ttf-takao-mincho.preinst   |   13 +++++++++++++
 5 files changed, 53 insertions(+), 7 deletions(-)

diff -Nru fonts-takao-003.02.01/debian/changelog fonts-takao-003.02.01/debian/changelog
--- fonts-takao-003.02.01/debian/changelog	2012-06-12 21:14:12.000000000 +0200
+++ fonts-takao-003.02.01/debian/changelog	2013-02-07 23:35:38.000000000 +0100
@@ -1,3 +1,17 @@
+fonts-takao (003.02.01-8) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * fonts-takao-mincho.preinst: Fix OTF alternative cleanup.
+  * ttf-takao-*.preinst: Unregister the ttf-japanese-*.ttf alternatives.
+  * fonts-takao-*.preinst: Clean up the ttf-japanese-*.ttf alternatives set up
+    by ttf-takao-* in squeeze. This needs to be done in fonts-takao-* as well
+    since there is no guarantee that the transitional ttf-takao-* packages
+    were installed and did clean this up. Since new installations of
+    fonts-takao-* cannot be distinguished from "upgrades" from ttf-takao-*
+    this needs to be run on new installations, too.  (Closes: #700054)
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 07 Feb 2013 23:35:28 +0100
+
 fonts-takao (003.02.01-7) unstable; urgency=low
 
   * debian/rules
diff -Nru fonts-takao-003.02.01/debian/fonts-takao-gothic.preinst fonts-takao-003.02.01/debian/fonts-takao-gothic.preinst
--- fonts-takao-003.02.01/debian/fonts-takao-gothic.preinst	2011-09-23 06:47:55.000000000 +0200
+++ fonts-takao-003.02.01/debian/fonts-takao-gothic.preinst	2013-02-07 23:33:20.000000000 +0100
@@ -7,9 +7,10 @@
 OLD_ALT_NAME="ttf-japanese-gothic"
 FONT_ENTRY_OTF="/usr/share/fonts/opentype/takao/TakaoPGothic.otf"
 
-CHECK_VERSION=003.02.01-5
+CHECK_VERSION=003.02.01-8
 FONT_ENTRY="/usr/share/fonts/truetype/takao/TakaoPGothic.ttf"
 
+
 check_broken_ttf_japanese_gothic()
 {
         update-alternatives --remove \
@@ -17,13 +18,16 @@
          $FONT_ENTRY_OTF
 }
 
+
 case "$1" in
     install|upgrade)
 	if [ -f $FONT_ENTRY_OTF ]; then
 	  check_broken_ttf_japanese_gothic
 	fi
 
-        if dpkg --compare-versions "$2" lt-nl "$CHECK_VERSION"; then
+        # do this on new installations, too, as these could be "upgrades"
+        # from ttf-takao-gothic
+        if dpkg --compare-versions "$2" lt "$CHECK_VERSION~"; then
           update-alternatives --remove $OLD_ALT_NAME.ttf $FONT_ENTRY
         fi
 
diff -Nru fonts-takao-003.02.01/debian/fonts-takao-mincho.preinst fonts-takao-003.02.01/debian/fonts-takao-mincho.preinst
--- fonts-takao-003.02.01/debian/fonts-takao-mincho.preinst	2011-09-23 06:47:55.000000000 +0200
+++ fonts-takao-003.02.01/debian/fonts-takao-mincho.preinst	2013-02-07 23:33:01.000000000 +0100
@@ -7,8 +7,8 @@
 OLD_ALT_NAME="ttf-japanese-mincho"
 FONT_ENTRY_OTF="/usr/share/fonts/opentype/takao/TakaoPMincho.otf"
 
-CHECK_VERSION=003.02.01-5
-FONT_ENTRY="/usr/share/fonts/opentype/takao/TakaoPMincho.ttf"
+CHECK_VERSION=003.02.01-8
+FONT_ENTRY="/usr/share/fonts/truetype/takao/TakaoPMincho.ttf"
 
 
 check_broken_ttf_japanese_mincho()
@@ -19,16 +19,18 @@
 }
 
 
-
 case "$1" in
     install|upgrade)
-	if [ -f $FONT_ENTRY ]; then
+	if [ -f $FONT_ENTRY_OTF ]; then
 	  check_broken_ttf_japanese_mincho
 	fi
 
-        if dpkg --compare-versions "$2" lt-nl "$CHECK_VERSION"; then
+        # do this on new installations, too, as these could be "upgrades"
+        # from ttf-takao-mincho
+        if dpkg --compare-versions "$2" lt "$CHECK_VERSION~"; then
           update-alternatives --remove $OLD_ALT_NAME.ttf $FONT_ENTRY
         fi
+
     ;;
 
     abort-upgrade)
diff -Nru fonts-takao-003.02.01/debian/ttf-takao-gothic.preinst fonts-takao-003.02.01/debian/ttf-takao-gothic.preinst
--- fonts-takao-003.02.01/debian/ttf-takao-gothic.preinst	1970-01-01 01:00:00.000000000 +0100
+++ fonts-takao-003.02.01/debian/ttf-takao-gothic.preinst	2013-02-07 23:05:46.000000000 +0100
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+OLD_ALT_NAME="ttf-japanese-gothic"
+FONT_ENTRY="/usr/share/fonts/truetype/takao/TakaoPGothic.ttf"
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+	if dpkg --compare-versions "$2" lt-nl "003.02.01-8~" ; then
+		update-alternatives --remove $OLD_ALT_NAME.ttf $FONT_ENTRY
+	fi
+fi
+
+#DEBHELPER#
diff -Nru fonts-takao-003.02.01/debian/ttf-takao-mincho.preinst fonts-takao-003.02.01/debian/ttf-takao-mincho.preinst
--- fonts-takao-003.02.01/debian/ttf-takao-mincho.preinst	1970-01-01 01:00:00.000000000 +0100
+++ fonts-takao-003.02.01/debian/ttf-takao-mincho.preinst	2013-02-07 23:07:13.000000000 +0100
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+OLD_ALT_NAME="ttf-japanese-mincho"
+FONT_ENTRY="/usr/share/fonts/truetype/takao/TakaoPMincho.ttf"
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+	if dpkg --compare-versions "$2" lt-nl "003.02.01-8~" ; then
+		update-alternatives --remove $OLD_ALT_NAME.ttf $FONT_ENTRY
+	fi
+fi
+
+#DEBHELPER#

Reply to: