Package: dpkg-dev
Version: 1.13.10
Severity: normal
Tags: patch

While creating a unit testing suite for dpkg-dev I found a bug in
parsedep(): Due to some unclean variable definitions (not detected
since the script doesn't use "use strict" *shudder*) sometimes it
generates wrong lists of architecture requirements.
When using $reduce_arch the effect is probably not visible which
might explain the error wasn't found earlier.

Example:
not ok 84 - showdep(parsedep(foo, bar, baz [i386 ia64],1),1) == foo, bar, baz 
[i386 ia64]

#     Failed test (t/scripts_controllib.t at line 244)
#          got: 'foo [i386 ia64], bar [i386 ia64], baz [i386 ia64]'
#     expected: 'foo, bar, baz [i386 ia64]'
# $VAR1 = [
#           [
#             [
#               'foo',
#               undef,
#               undef,
#               [
#                 'i386',
#                 'ia64'
#               ]
#             ]
#           ],
#           [
#             [
#               'bar',
#               undef,
#               undef,
#               $VAR1->[0][0][3]
#             ]
#           ],
#           [
#             [
#               'baz',
#               undef,
#               undef,
#               $VAR1->[0][0][3]
#             ]
#           ]
#         ];


Patch:
--- orig/scripts/controllib.pl
+++ mod/scripts/controllib.pl
@@ -180,7 +180,8 @@
             $package = $1 if ($dep_or =~ 
s/^([a-zA-Z0-9][a-zA-Z0-9+._-]*)\s*//m);
             ($relation, $version) = ($1, $2)
                if ($dep_or =~ s/^\(\s*(=|<=|>=|<<?|>>?)\s*([^)]+).*\)\s*//m);
-            my @arches = split(/\s+/m, $1) if ($use_arch && $dep_or =~ 
s/^\[([^]]+)\]\s*//m);
+            my @arches;
+           @arches = split(/\s+/m, $1) if ($use_arch && $dep_or =~ 
s/^\[([^]]+)\]\s*//m);
             if ($reduce_arch && @arches) {

                 my $seen_arch='';

(without changelog entries yet since I don't know the bugnumber)

Gruesse,
        Frank Lichtenheld

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-powerpc
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages dpkg-dev depends on:
ii  binutils                      2.16.1-2   The GNU assembler, linker and bina
ii  cpio                          2.5-1.2    GNU cpio -- a program to manage ar
ii  dpkg                          1.13.10    Package maintenance system for Deb
ii  make                          3.80-9     The GNU version of the "make" util
ii  patch                         2.5.9-2    Apply a diff file to an original
ii  perl [perl5]                  5.8.7-4    Larry Wall's Practical Extraction 
ii  perl-modules                  5.8.7-4    Core Perl modules

Versions of packages dpkg-dev recommends:
ii  bzip2                         1.0.2-7    high-quality block-sorting file co
ii  gcc [c-compiler]              4:4.0.0-2  The GNU C compiler
ii  gcc-3.3 [c-compiler]          1:3.3.6-7  The GNU C compiler
ii  gcc-4.0 [c-compiler]          4.0.1-2    The GNU C compiler

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to