[Pkg-tcltk-devel] Bug#628436: Please disallow tclsh8.4 as an alternative for the tclsh command

Jonathan Nieder jrnieder at gmail.com
Sat May 28 22:20:36 UTC 2011


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

Hi,

It would be convenient if scripts could assume the tclsh command and
virtual package provide tclsh8.5 or newer as long as tcltk-defaults is
up to date, like below.

My only worry would be that some package might be using "Depends:
tcl8.4" and expecting the tclsh command to work, when they should have
been using "Depends: tcl (>= 8.4)".  If some user does not have tcl
from tcltk-defaults or tcl8.[56] installed for some other reason, the
tclsh command would go away --- no good.  But I don't think that's a
big risk.

The weird "8.4.19-4." versions in dpkg --compare-versions expressions
are to ensure numbers like 8.4.19-4ubuntu1 and 8.4.19-4+b1 are below
and 8.4.19-4.1 is above.

Thoughts?
---
 debian/changelog       |    8 ++++++++
 debian/control         |    3 +--
 debian/tcl8.4.postinst |   11 -----------
 debian/tcl8.4.preinst  |    9 +++++++++
 debian/tcl8.4.prerm    |    3 ++-
 5 files changed, 20 insertions(+), 14 deletions(-)
 delete mode 100644 debian/tcl8.4.postinst
 create mode 100644 debian/tcl8.4.preinst

diff --git a/debian/changelog b/debian/changelog
index b7ab602..ec45ba2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+tcl8.4 (8.4.19-4.1) local; urgency=low
+
+  * Stopped providing the tclsh command through the alternatives system,
+    so scripts can rely on tclsh pointing to tclsh8.5 or newer.
+  * Bumped standards version to 3.9.2.
+
+ -- Jonathan Nieder <jrnieder at gmail.com>  Sat, 28 May 2011 17:20:30 -0500
+
 tcl8.4 (8.4.19-4) unstable; urgency=low
 
   * Removed Anselm Lingnau from uploaders list (closes: #540848).
diff --git a/debian/control b/debian/control
index 5f771a3..094dde6 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), quilt
-Standards-Version: 3.8.3
+Standards-Version: 3.9.2
 Homepage: http://www.tcl.tk/
 
 Package: tcl8.4
@@ -13,7 +13,6 @@ Priority: optional
 Architecture: any
 Depends: ${shlibs:Depends}
 Conflicts: tcl74 (<= 7.4p3-2)
-Provides: tclsh
 Suggests: tclreadline
 Description: Tcl (the Tool Command Language) v8.4 - run-time files
  Tcl is a powerful, easy to use, embeddable, cross-platform interpreted
diff --git a/debian/tcl8.4.postinst b/debian/tcl8.4.postinst
deleted file mode 100644
index d4d0bcb..0000000
--- a/debian/tcl8.4.postinst
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "configure" ]; then
-    update-alternatives --install /usr/bin/tclsh tclsh /usr/bin/tclsh8.4 841 \
-			--slave /usr/share/man/man1/tclsh.1.gz tclsh.1 \
-			/usr/share/man/man1/tclsh8.4.1.gz
-fi
-
-#DEBHELPER#
diff --git a/debian/tcl8.4.preinst b/debian/tcl8.4.preinst
new file mode 100644
index 0000000..0163c7a
--- /dev/null
+++ b/debian/tcl8.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 tclsh /usr/bin/tclsh8.4
+fi
+
+#DEBHELPER#
diff --git a/debian/tcl8.4.prerm b/debian/tcl8.4.prerm
index 997fa7f..9739995 100644
--- a/debian/tcl8.4.prerm
+++ b/debian/tcl8.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 tclsh /usr/bin/tclsh8.4
 fi
 
-- 
1.7.5.3






More information about the Pkg-tcltk-devel mailing list