Doesn't handle empty lines in debian/pyversions

Bug #437593 reported by TJ
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-support (Debian)
Fix Released
Unknown
python-support (Ubuntu)
Fix Released
Low
Loïc Minier
Declined for Karmic by Loïc Minier

Bug Description

Binary package hint: python-support

When building a python-xxxxx package for Jaunty and Karmic in a pbuilder the Karmic build failed with the errors:

dh_pysupport -popenshot
sh: Syntax error: "|" unexpected
Use of uninitialized value in split at /usr/bin/dh_pysupport line 325, <CONTROL> line 18.
Use of uninitialized value $minversion in string ne at /usr/bin/dh_pysupport line 327, <CONTROL> line 18.
Use of uninitialized value $minversion in concatenation (.) or string at /usr/bin/dh_pysupport line 328, <CONTROL> line 18.
Use of uninitialized value $maxversion in string ne at /usr/bin/dh_pysupport line 332.
Use of uninitialized value $version in split at /usr/bin/dh_pysupport line 79.
Use of uninitialized value within @items in join or string at /usr/bin/dh_pysupport line 81.

The package's debian/pyversions contains:

2.3-

It seems that dh_pysupport line 324, where it calls out to the shell and pipes the version to parseversions, requires the value being echoed to be quoted in order to work with X.Y- forms of the version specifier:

 my $supported=`echo "$versions" | $privdir/parseversions --minmax`;

Revision history for this message
TJ (tj) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

I really don't see the difference between:
 versions=2.3-
 echo "$versions" | something

and
 echo $versions | something

Could you attach the problematic debian/pyversions or .dsc? I suspect what happens instead is that versions isn't set properly, e.g. has a newline, so that the code becomes:
 echo $versions
| something

I can see this is an issue in debhelper/dh_pysupport that it doesn't strip empty lines from debian/pyversions:
        if (-f $verfile) {
            # TODO: debian/package.pyversions ?
            $versions=`cat $verfile`;
            chomp $versions;

You can try this out by creating a "vers" file with "2.3-" on the first line followed by some empty lines, and the running:
 perl -e 'my $v = `cat vers`; chomp $v; print "a $v b\n"'

output:
a 2.3-
 b

One fix is to set:
 local $/ = ""

e.g.:
        if (-f $verfile) {
            # TODO: debian/package.pyversions ?
            $versions=`cat $verfile`;
            { local $/ = ""; chomp $versions; }

Changed in python-support (Ubuntu):
status: New → Confirmed
Revision history for this message
Loïc Minier (lool) wrote :

If the build fails, I think we would have catched build errors for karmic, so I don't think it's SRU worthy.

Loïc Minier (lool)
summary: - dh_pysupport fails to parse pyversion form X.Y-
+ Doesn't handle empty lines in debian/pyversions
Loïc Minier (lool)
Changed in python-support (Ubuntu):
assignee: nobody → Loïc Minier (lool)
importance: Undecided → Low
status: Confirmed → Fix Committed
Changed in python-support (Debian):
status: Unknown → New
Changed in python-support (Debian):
status: New → Fix Committed
Changed in python-support (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Nigel Babu (nigelbabu) wrote :

changing to Fix Released, since the fix seems to be in maverick.

Changed in python-support (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.