Doesn't handle empty lines in debian/pyversions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-support (Debian) |
Fix Released
|
Unknown
|
|||
python-support (Ubuntu) |
Fix Released
|
Low
|
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/
Use of uninitialized value $minversion in string ne at /usr/bin/
Use of uninitialized value $minversion in concatenation (.) or string at /usr/bin/
Use of uninitialized value $maxversion in string ne at /usr/bin/
Use of uninitialized value $version in split at /usr/bin/
Use of uninitialized value within @items in join or string at /usr/bin/
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/
Related branches
summary: |
- dh_pysupport fails to parse pyversion form X.Y- + Doesn't handle empty lines in debian/pyversions |
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 |
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: package. pyversions ?
$versions= `cat $verfile`;
if (-f $verfile) {
# TODO: debian/
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.: package. pyversions ?
$versions= `cat $verfile`;
if (-f $verfile) {
# TODO: debian/
{ local $/ = ""; chomp $versions; }