Package: python-support
Version: 1.0.6.1
Severity: normal
Tags: patch

If /usr/bin/python is not a symlink to python*, dh_pysupport always evaluates
it to be smaller than the supported versions, and so generates a dependency
like this: "Depends: python (>= 2.5) | python2.5". This is undesirable.

The attached patch avoid reinventing the wheel by using pyversions to get the
current default version. If pyversions returns an error code, so does
dh_pysupport; otherwise it uses the version that pyversions declared to be the
default. This behaviour alerts the maintainer to a problem with their build
environment.

Note: my Perl is not strong, so feel free to implement it differently, or to
change the error string.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-support depends on:
ii  dpkg                          1.15.5.6   Debian package management system
ii  python                        2.5.4-9    An interactive high-level object-o

python-support recommends no packages.

python-support suggests no packages.

-- no debconf information
--- dh_pysupport.orig   2010-03-01 22:12:56.000000000 +0000
+++ dh_pysupport        2010-03-01 22:18:27.000000000 +0000
@@ -123,9 +123,12 @@
 }
 
 # The current default python version
-my $default=`readlink /usr/bin/python`;
-$default =~ s/^python//;
-chomp $default;
+my $default=`/usr/bin/pyversions -dv`;
+unless ($? == 0) {
+       error("The default Python version cannot be read");
+} else {
+       chomp $default;
+}
 
 # Versions supported by python-defaults
 my @debian_pysupported = split(/ /, `/usr/bin/pyversions -sv`);

Reply via email to