Package: libdpkg-ruby1.8
Version: 0.3.1
Severity: important

The Packages and Sources classes have trouble with package names
that contain '+' characters.

/usr/lib/ruby/1.8/debian.rb:900:in `initialize': nested *?+ in regexp: 
/Package:\s(libsigc++-1.2-5c102) (RegexpError)
/       from /usr/lib/ruby/1.8/debian.rb:900:in `initialize'
        from /usr/lib/ruby/1.8/debian.rb:1031:in `initialize'
        from /usr/lib/ruby/1.8/debian.rb:59:in `listfiles'
        from ./dpkg-test:26
        from ./dpkg-test:25

The attached patch fixes it for me, but I'm new to Ruby so I'm sure 
there is a more elegant solution.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'testing'), (400, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libdpkg-ruby1.8 depends on:
ii  libruby1.8                    1.8.4-2    Libraries necessary to run Ruby 1.

libdpkg-ruby1.8 recommends no packages.

-- no debconf information

-- 
Eric Evans
[EMAIL PROTECTED]
--- /usr/lib/ruby/1.8/debian.rb 2006-05-05 22:14:12.000000000 -0500
+++ /usr/lib/ruby/1.8/debian.rb 2006-05-05 22:38:36.000000000 -0500
@@ -879,7 +879,8 @@
   class Sources < Archives
     def initialize(file = "", pkgs = [], fields = [])
       unless pkgs.empty?
-       pkgre = Regexp.new("(Package|Source):\\s(#{pkgs.join('|')})\n")
+       joined = pkgs.join('|').gsub(/[+]/, "\\\\+")
+       pkgre = Regexp.new("(Package|Source):\\s(#{joined})\n")
       end
       @lists = Archives.parseArchiveFile(file) {|info|
        if !pkgre || pkgre =~ info
@@ -897,7 +898,8 @@
   class Packages < Archives
     def initialize(file = "", pkgs = [], fields = [])
       unless pkgs.empty?
-       pkgre = Regexp.new("Package:\\s(#{pkgs.join('|')})\n")
+       joined = pkgs.join('|').gsub(/[+]/, "\\\\+")
+       pkgre = Regexp.new("Package:\\s(#{joined})\n")
       end
       @provides = {}
       @file = [file]

Attachment: signature.asc
Description: Digital signature

Reply via email to