[Pkg-tcltk-devel] Bug#628442: Please disallow wish8.4 as an alternative for the wish command

Jonathan Nieder jrnieder at gmail.com
Sun May 29 00:05:16 UTC 2011


Package: tk8.4
Version: 8.4.19-4
Severity: wishlist
Tags: patch

Hi,

As discussed at Bug#628436, it would be excellent if scripts could
rely on wish pointing to the default version or something more recent.
This patch implements the relevant change in the tk8.4 package.
Actually I would be happy to remove this use of alternatives
altogether, but this proposal is more modest so as to have a chance of
happening soon.

Thoughts welcome, as always.
---
 debian/changelog      |   10 ++++++++++
 debian/control        |    8 ++++----
 debian/tk8.4.postinst |   11 -----------
 debian/tk8.4.preinst  |    9 +++++++++
 debian/tk8.4.prerm    |    3 ++-
 5 files changed, 25 insertions(+), 16 deletions(-)
 delete mode 100644 debian/tk8.4.postinst
 create mode 100644 debian/tk8.4.preinst

diff --git a/debian/changelog b/debian/changelog
index 6891c6a..3c44d4d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+tk8.4 (8.4.19-4.1) local; urgency=low
+
+  * Stopped providing the wish command through the alternatives system,
+    so scripts can rely on wish pointing to wish8.5 or newer.
+  * Changed the tk8.4 package description to emphasize that newer tk
+    exists and is better supported.
+  * Bumped standards version to 3.9.2.
+
+ -- Jonathan Nieder <jrnieder at gmail.com>  Sat, 28 May 2011 18:51:08 -0500
+
 tk8.4 (8.4.19-4) unstable; urgency=low
 
   * Removed Anselm Lingnau from uploaders list (closes: #540858).
diff --git a/debian/control b/debian/control
index 91cad5b..6ad95f5 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Tcl/Tk Packagers <pkg-tcltk-devel at lists.alioth.debian.org>
 Uploaders: Chris Waters <xtifr at debian.org>, Sergei Golovan <sgolovan at debian.org>
 Build-Depends: debhelper (>= 5.0.0), x11proto-core-dev, libx11-dev, libxt-dev, tcl8.4-dev (>= 8.4.2), quilt
-Standards-Version: 3.8.3
+Standards-Version: 3.9.2
 Homepage: http://www.tcl.tk/
 
 Package: tk8.4
@@ -14,12 +14,12 @@ Architecture: any
 Depends: ${shlibs:Depends}
 Recommends: xterm | x-terminal-emulator
 Conflicts: tk40 (<= 4.0p3-2), libtk-img (<< 1.2.5)
-Provides: wish
 Description: Tk toolkit for Tcl and X11, v8.4 - run-time files
  Tk is a cross-platform graphical toolkit which provides the Motif
  look-and-feel and is implemented using the Tcl scripting language.
- This package contains everything you need to run Tk (wish) scripts
- and Tk-enabled apps.
+ This package contains everything you need to run old Tk (wish) scripts
+ and Tk-enabled apps.  For the default Tk version (which is newer),
+ see the tk package.
 
 Package: tk8.4-dev
 Section: devel
diff --git a/debian/tk8.4.postinst b/debian/tk8.4.postinst
deleted file mode 100644
index cc0fa9e..0000000
--- a/debian/tk8.4.postinst
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "configure" ]; then
-    update-alternatives --install /usr/bin/wish wish /usr/bin/wish8.4 841 \
-			--slave /usr/share/man/man1/wish.1.gz wish.1 \
-			/usr/share/man/man1/wish8.4.1.gz
-fi
-
-#DEBHELPER#
diff --git a/debian/tk8.4.preinst b/debian/tk8.4.preinst
new file mode 100644
index 0000000..1f0d28f
--- /dev/null
+++ b/debian/tk8.4.preinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if dpkg --compare-versions "$2" lt-nl 8.4.19-4.; then
+    update-alternatives --remove wish /usr/bin/wish8.4
+fi
+
+#DEBHELPER#
diff --git a/debian/tk8.4.prerm b/debian/tk8.4.prerm
index 51d8fee..bf5e799 100644
--- a/debian/tk8.4.prerm
+++ b/debian/tk8.4.prerm
@@ -2,7 +2,8 @@
 
 set -e
 
-if [ $1 != "upgrade" ] ; then
+if [ "$1" = failed-upgrade ] &&
+   dpkg --compare-versions "$2" lt-nl 8.4.19-4.; then
     update-alternatives --remove wish /usr/bin/wish8.4
 fi
 
-- 
1.7.5.3






More information about the Pkg-tcltk-devel mailing list