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

[Pkg-fonts-devel] Bug#699905: fonts-vlgothic: does not remove ttf-japanese-gothic.ttf alternative on upgrades from squeeze



Followup-For: Bug #699905
Control: tag -1 patch

Hi,

updated version of my patch. Be more restrictive in the versions where
u-a remove is run. Add preinst to the transitional package to remove
the alternative there. But there is no guarantee for the transitional
being installed at all ... but if it is installed, u-a won't emit a
diagnostic about something dangling ...

Added a variant for experimental with updated version guards (and
shorter changelog entry) - the wheezy version has more details for a
possible TPU.

Successfully tested several install and upgrade paths.


Andreas
diffstat for fonts-vlgothic-20120629 fonts-vlgothic-20120629

 changelog              |   13 +++++++++++++
 fonts-vlgothic.preinst |   12 ++++++++++++
 ttf-vlgothic.preinst   |   11 +++++++++++
 3 files changed, 36 insertions(+)

diff -Nru fonts-vlgothic-20120629/debian/changelog fonts-vlgothic-20120629/debian/changelog
--- fonts-vlgothic-20120629/debian/changelog	2012-06-29 09:29:25.000000000 +0200
+++ fonts-vlgothic-20120629/debian/changelog	2013-02-06 16:54:27.000000000 +0100
@@ -1,3 +1,16 @@
+fonts-vlgothic (20120629-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * ttf-vlgothic.preinst: Unregister the ttf-japanese-gothic.ttf alternative.
+  * fonts-vlgothic.preinst: Clean up the ttf-japanese-gothic.ttf alternative
+    set up by ttf-vlgothic in squeeze. This needs to be done in fonts-vlgothic
+    as well since there is no guarantee that the transitional ttf-vlgothic
+    package was installed and has cleaned this up. Since new installations of
+    fonts-vlgothic cannot be distinguished from "upgrades" from ttf-vlgothic,
+    this needs to be run on new installations, too.  (Closes: #699905)
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 06 Feb 2013 15:13:01 +0100
+
 fonts-vlgothic (20120629-1) unstable; urgency=low
 
   * New upstream release 
diff -Nru fonts-vlgothic-20120629/debian/fonts-vlgothic.preinst fonts-vlgothic-20120629/debian/fonts-vlgothic.preinst
--- fonts-vlgothic-20120629/debian/fonts-vlgothic.preinst	2011-09-18 16:16:57.000000000 +0200
+++ fonts-vlgothic-20120629/debian/fonts-vlgothic.preinst	2013-02-06 16:30:27.000000000 +0100
@@ -72,6 +72,18 @@
       fi
   fi
 
+	# Remove the alternative set up by the old ttf-vlgothic package.
+	# Do this again here since there is no guarantee that the transitional
+	# ttf-vlgothic package was installed and has cleaned this up.
+	# Do this for new installations (as we can't distinguish them from
+	# "upgrades" from ttf-vlgothic) as well as upgrades that did not yet
+	# clean this up.
+	# (This can be removed after jessie was released with this code.)
+	if dpkg --compare-versions "$2" lt "20120629-1.1~" ; then
+		update-alternatives --remove ttf-japanese-gothic.ttf \
+			/usr/share/fonts/truetype/vlgothic/VL-Gothic-Regular.ttf
+	fi
+
 esac
 
 #DEBHELPER#
diff -Nru fonts-vlgothic-20120629/debian/ttf-vlgothic.preinst fonts-vlgothic-20120629/debian/ttf-vlgothic.preinst
--- fonts-vlgothic-20120629/debian/ttf-vlgothic.preinst	1970-01-01 01:00:00.000000000 +0100
+++ fonts-vlgothic-20120629/debian/ttf-vlgothic.preinst	2013-02-06 16:30:28.000000000 +0100
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+	if dpkg --compare-versions "$2" lt-nl "20120629-1.1~" ; then
+		update-alternatives --remove ttf-japanese-gothic.ttf \
+			/usr/share/fonts/truetype/vlgothic/VL-Gothic-Regular.ttf
+	fi
+fi
+
+#DEBHELPER#
diffstat for fonts-vlgothic-20121230 fonts-vlgothic-20121230

 changelog              |   10 ++++++++++
 fonts-vlgothic.preinst |   12 ++++++++++++
 ttf-vlgothic.preinst   |   11 +++++++++++
 3 files changed, 33 insertions(+)

diff -Nru fonts-vlgothic-20121230/debian/changelog fonts-vlgothic-20121230/debian/changelog
--- fonts-vlgothic-20121230/debian/changelog	2012-12-30 09:41:00.000000000 +0100
+++ fonts-vlgothic-20121230/debian/changelog	2013-02-06 16:49:13.000000000 +0100
@@ -1,3 +1,13 @@
+fonts-vlgothic (20121230-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * ttf-vlgothic.preinst: Unregister the ttf-japanese-gothic.ttf alternative.
+  * fonts-vlgothic.preinst: Clean up the ttf-japanese-gothic.ttf alternative
+    set up by ttf-vlgothic in squeeze in case this was not handled by the
+    transitional ttf-vlgothic package.  (Closes: #699905)
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 06 Feb 2013 15:13:01 +0100
+
 fonts-vlgothic (20121230-1) experimental; urgency=low
 
   * New upstream release
diff -Nru fonts-vlgothic-20121230/debian/fonts-vlgothic.preinst fonts-vlgothic-20121230/debian/fonts-vlgothic.preinst
--- fonts-vlgothic-20121230/debian/fonts-vlgothic.preinst	2011-09-18 16:16:57.000000000 +0200
+++ fonts-vlgothic-20121230/debian/fonts-vlgothic.preinst	2013-02-06 16:51:07.000000000 +0100
@@ -72,6 +72,18 @@
       fi
   fi
 
+	# Remove the alternative set up by the old ttf-vlgothic package.
+	# Do this again here since there is no guarantee that the transitional
+	# ttf-vlgothic package was installed and has cleaned this up.
+	# Do this for new installations (as we can't distinguish them from
+	# "upgrades" from ttf-vlgothic) as well as upgrades that did not yet
+	# clean this up.
+	# (This can be removed after jessie was released with this code.)
+	if dpkg --compare-versions "$2" lt "20121230-1.1~" ; then
+		update-alternatives --remove ttf-japanese-gothic.ttf \
+			/usr/share/fonts/truetype/vlgothic/VL-Gothic-Regular.ttf
+	fi
+
 esac
 
 #DEBHELPER#
diff -Nru fonts-vlgothic-20121230/debian/ttf-vlgothic.preinst fonts-vlgothic-20121230/debian/ttf-vlgothic.preinst
--- fonts-vlgothic-20121230/debian/ttf-vlgothic.preinst	1970-01-01 01:00:00.000000000 +0100
+++ fonts-vlgothic-20121230/debian/ttf-vlgothic.preinst	2013-02-06 16:51:27.000000000 +0100
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+	if dpkg --compare-versions "$2" lt-nl "20121230-1.1~" ; then
+		update-alternatives --remove ttf-japanese-gothic.ttf \
+			/usr/share/fonts/truetype/vlgothic/VL-Gothic-Regular.ttf
+	fi
+fi
+
+#DEBHELPER#

Reply to: