Bug#396846: Remove warning message "Odd number of elements in hash..."

Johnny Morano jmorano at moretrix.com
Fri Nov 3 10:55:43 CET 2006


Package: dh-make-perl
Version: 0.24

When dh-make-perl is invoked it always gives the warning "Odd number of
elements in hash", because of a bad regex and a bad split in the
subroutine get_perl_pkg_details.

This patch removes the warning message and will put better values in
hash!

# BEGIN OF PATCH
--- dh-make-perl.orig   2006-11-03 10:44:59.000000000 +0100
+++ dh-make-perl        2006-11-03 10:44:24.000000000 +0100
@@ -247,8 +247,8 @@
 
 sub get_perl_pkg_details {
     my (@dpkg_info);
-    @dpkg_info = map {chomp; s/\s*:\s*/:/; $_} `dpkg -p perl`;
-    return { map {split /:/, $_} @dpkg_info };
+    chomp( @dpkg_info =  grep /^\S/, `dpkg -p perl`);
+       return( { map { m/^(\S+?):\s+(.*)/; $1 => $2} @dpkg_info })  ;
 }
 
 sub setup_dir {
# END OF PATCH

I am using Debian GNU/Linux 4.0 2.6.18 #1 PREEMPT Thu Oct 26 09:47:13
CEST 2006 i686





More information about the pkg-perl-maintainers mailing list