--- libnet-whois-ripe-perl-1.23.orig/debian/control +++ libnet-whois-ripe-perl-1.23/debian/control @@ -0,0 +1,13 @@ +Source: libnet-whois-ripe-perl +Section: perl +Priority: optional +Maintainer: Marco d'Itri +Build-Depends: debhelper (>= 5), quilt (>= 0.40), perl +Standards-Version: 3.8.3 + +Package: libnet-whois-ripe-perl +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends}, +Description: RPSL whois client + The Net::Whois::RIPE class implements a whois client with support for + querying and parsing RPSL objects. --- libnet-whois-ripe-perl-1.23.orig/debian/changelog +++ libnet-whois-ripe-perl-1.23/debian/changelog @@ -0,0 +1,22 @@ +libnet-whois-ripe-perl (1.23-1) unstable; urgency=medium + + * New upstream release. + * Added an empty binary-arch target to debian/rules. (Closes: #395661) + * Added patch fix-plusemptyattr to fix the parsing of attributes + containing empty lines starting with a plus character. + + -- Marco d'Itri Tue, 18 Aug 2009 03:48:38 +0200 + +libnet-whois-ripe-perl (1.22-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix FTBFS with Perl 5.10. Closes: #468000 + + -- Mark Hymers Sat, 05 Apr 2008 21:09:16 +0100 + +libnet-whois-ripe-perl (1.22-1) unstable; urgency=low + + * Initial Release. + + -- Marco d'Itri Sat, 18 Jun 2005 01:27:59 +0200 + --- libnet-whois-ripe-perl-1.23.orig/debian/compat +++ libnet-whois-ripe-perl-1.23/debian/compat @@ -0,0 +1 @@ +5 --- libnet-whois-ripe-perl-1.23.orig/debian/copyright +++ libnet-whois-ripe-perl-1.23/debian/copyright @@ -0,0 +1,16 @@ +This is the Debian package for the Net-Whois-RIPE module. + +It has been packaged by Marco d'Itri . + +Original sources were obtained from CPAN. + +Copyright (C) 1998 Paul Gampe and APNIC Pty. Ltd. +Copyright (C) 2000 Kevin Baker and APNIC Pty. Ltd. +Copyright (C) 2004-2005 Paul Gampe + +This program is licensed under the terms of the GNU GPL version 1, +or (at your option) any later version. + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL . + --- libnet-whois-ripe-perl-1.23.orig/debian/watch +++ libnet-whois-ripe-perl-1.23/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://search.cpan.org/CPAN/authors/id/P/PA/PAULG/Net-Whois-RIPE-([\d\.]+)\.tar\.gz --- libnet-whois-ripe-perl-1.23.orig/debian/rules +++ libnet-whois-ripe-perl-1.23/debian/rules @@ -0,0 +1,61 @@ +#!/usr/bin/make -f +SHELL+= -e + +# If set to a true value then MakeMaker's prompt function will +# always return the default without waiting for user input. +export PERL_MM_USE_DEFAULT=1 + +ifndef PERL +PERL = /usr/bin/perl +endif + +D := $(CURDIR)/debian/libnet-whois-ripe-perl + +QUILT_STAMPFN=patched-stamp +include /usr/share/quilt/quilt.make + +############################################################################## +clean: unpatch + dh_testdir + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean build-stamp install-stamp + +build: build-stamp +build-stamp: $(QUILT_STAMPFN) + dh_testdir + $(PERL) Makefile.PL INSTALLDIRS=vendor + $(MAKE) + touch $@ + +install: build install-stamp +install-stamp: + dh_testdir + dh_testroot + dh_clean -k + + $(MAKE) install PREFIX=$D/usr + + [ ! -d $D/usr/lib/perl5 ] \ + || rmdir --ignore-fail-on-non-empty --parents $D/usr/lib/perl5 + rm $D/usr/share/perl5/Net/Whois/update.pl + + touch $@ + +binary-indep: build install + dh_testdir + dh_testroot + + dh_installchangelogs ChangeLog + dh_installdocs + dh_perl + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_builddeb + +binary-arch: + +binary: binary-indep binary-arch + +.PHONY: build clean binary-indep binary-arch binary --- libnet-whois-ripe-perl-1.23.orig/debian/patches/series +++ libnet-whois-ripe-perl-1.23/debian/patches/series @@ -0,0 +1,2 @@ +fix-emptyattr +fix-plusemptyattr --- libnet-whois-ripe-perl-1.23.orig/debian/patches/fix-emptyattr +++ libnet-whois-ripe-perl-1.23/debian/patches/fix-emptyattr @@ -0,0 +1,74 @@ +--- Net-Whois-RIPE-1.23.orig/lib/Net/Whois/RIPE/Object.pm ++++ Net-Whois-RIPE-1.23/lib/Net/Whois/RIPE/Object.pm +@@ -91,7 +91,7 @@ + $value2 =~ s/#.*$// unless exists $Free_Form{$precedent_attribute}; + $value2 =~ s/\s+$//; + $self->add($precedent_attribute, $value2); +- } elsif (my ($attribute, $value) = /^([\w\-]+|\*\w\w):\s+(.*)$/) { ++ } elsif (my ($attribute, $value) = /^([\w\-]+|\*\w\w):\s*(.*)$/) { + # strip end of line comments and trailing white space + $value =~ s/#.*$// unless exists $Free_Form{$attribute}; + $value =~ s/\s+$//; +@@ -132,7 +132,7 @@ + sub add { + my ( $self, $attr, $value ) = @_; + +- unless ( ref($self) and $attr and $value ) { ++ unless ( ref($self) and $attr and defined $value ) { + carp "add: expecting an ATTRIBUTE and a VALUE" if $self->debug; + return undef; + } +--- Net-Whois-RIPE-1.23.orig/t/13_object_emptyattr.t ++++ Net-Whois-RIPE-1.23/t/13_object_emptyattr.t +@@ -0,0 +1,31 @@ ++BEGIN { $| = 1; print "1..9\n"; } ++END {print "not ok 1\n" unless $loaded;} ++use Net::Whois::RIPE::Object; ++$loaded = 1; ++print "ok 1\n"; ++ ++sub test { ++ local($^W)=0; ++ my($num,$true,$msg)=@_; ++ print($true ? "ok $num\n" : "not ok $num $msg\n"); ++} ++ ++my $file = $0; ++$file =~ s/\.t$/\.obj/; ++test(2,open(FH,$file),"cannot open $file: $!"); ++ ++my $o = Net::Whois::RIPE::Object->new(\*FH, 0); ++my @remarks = $o->remarks; ++ ++test(3,close(FH),"error closing file: $!"); ++test(4,($o->success == 1),"object not parsed successfully"); ++test(5,($o->as_set eq 'AS-TEST'), "as-set attribute not parsed successfully"); ++test(6,(scalar $o->attributes == 9), "not all attributes parsed successfully"); ++test(7,(defined $o->members and $o->members eq ''), ++ "members attribute not parsed successfully"); ++test(8,(scalar @remarks == 5), ++ "parsed ".(@remarks)." remarks attributes instead of 5"); ++test(9,($remarks[0] eq '' and $remarks[1] =~ /^-+$/ and $remarks[4] eq ''), ++ "remarks attribute not parsed correctly"); ++ ++exit 0; +--- Net-Whois-RIPE-1.23.orig/t/13_object_emptyattr.obj ++++ Net-Whois-RIPE-1.23/t/13_object_emptyattr.obj +@@ -0,0 +1,17 @@ ++% Information related to 'AS-TEST' ++ ++as-set: AS-TEST ++descr: A dummy object used to test Net::Whois::RIPE ++remarks: ++remarks: ---------------------------------------------- ++remarks: An attribute with multiple empty lines # 2006-04-18 ++remarks: ---------------------------------------------- ++remarks: ++members: # empty attribute, but containing a comment ++members: ++admin-c: MDI-RIPE ++tech-c: MDI-RIPE ++mnt-by: MDI-MNT ++changed: md@example.net 20060418 ++source: DUMMY ++ --- libnet-whois-ripe-perl-1.23.orig/debian/patches/fix-plusemptyattr +++ libnet-whois-ripe-perl-1.23/debian/patches/fix-plusemptyattr @@ -0,0 +1,104 @@ +RFC 2622: + + An attribute's value can be split over multiple lines, by having a + space, a tab or a plus ('+') character as the first character of the + continuation lines. The character "+" for line continuation allows + attribute values to contain blank lines. More spaces may optionally + be used after the continuation character to increase readability. + +--- a/lib/Net/Whois/RIPE/Object.pm ++++ b/lib/Net/Whois/RIPE/Object.pm +@@ -87,15 +87,11 @@ sub parse { + /^WARNING:\s+(.*)/ and $self->_wrn($1), next; + + # ok, now try to match attribute value pairs +- if (my ($value2) = /^\+?\s+(.+)$/ and $precedent_attribute){ +- $value2 =~ s/#.*$// unless exists $Free_Form{$precedent_attribute}; +- $value2 =~ s/\s+$//; +- $self->add($precedent_attribute, $value2); ++ if (my ($value) = /^(\+\s*.*|\s+.+)$/ and $precedent_attribute){ ++ $value =~ s/^\+/ /; ++ $self->clean_and_add($precedent_attribute, $value); + } elsif (my ($attribute, $value) = /^([\w\-]+|\*\w\w):\s*(.*)$/) { +- # strip end of line comments and trailing white space +- $value =~ s/#.*$// unless exists $Free_Form{$attribute}; +- $value =~ s/\s+$//; +- $self->add( $attribute, $value ); ++ $self->clean_and_add($attribute, $value); + $precedent_attribute = $attribute; + $found_record = 1; + } else { +@@ -129,6 +125,17 @@ sub size { # will only work in the as + return length scalar $self->content; + } + ++sub clean_and_add { ++ my ($self, $attr, $value) = @_; ++ ++ # strip end of line comments and leading and trailing white space ++ $value =~ s/#.*$// unless exists $Free_Form{$attr}; ++ $value =~ s/^\s+//; ++ $value =~ s/\s+$//; ++ ++ return $self->add($attr, $value); ++} ++ + sub add { + my ( $self, $attr, $value ) = @_; + +--- /dev/null ++++ b/t/14_object_plusattr.obj +@@ -0,0 +1,19 @@ ++% Information related to 'AS-TEST' ++ ++as-set: AS-TEST ++descr: A dummy object used to test Net::Whois::RIPE ++remarks: And now some more lines, some of them empty: +++ +++ ---------------------------------------------- +++ An attribute with multiple empty lines # 2009-08-18 +++ ---------------------------------------------- +++ +++Lines can even have no leading blanks... ++members: # empty attribute, but containing a comment ++members: ++admin-c: MDI-RIPE ++tech-c: MDI-RIPE ++mnt-by: MDI-MNT ++changed: md@example.net 20090818 ++source: DUMMY ++ +--- /dev/null ++++ b/t/14_object_plusattr.t +@@ -0,0 +1,31 @@ ++BEGIN { $| = 1; print "1..9\n"; } ++END {print "not ok 1\n" unless $loaded;} ++use Net::Whois::RIPE::Object; ++$loaded = 1; ++print "ok 1\n"; ++ ++sub test { ++ local($^W)=0; ++ my($num,$true,$msg)=@_; ++ print($true ? "ok $num\n" : "not ok $num $msg\n"); ++} ++ ++my $file = $0; ++$file =~ s/\.t$/\.obj/; ++test(2,open(FH,$file),"cannot open $file: $!"); ++ ++my $o = Net::Whois::RIPE::Object->new(\*FH, 0); ++my @remarks = $o->remarks; ++ ++test(3,close(FH),"error closing file: $!"); ++test(4,($o->success == 1),"object not parsed successfully"); ++test(5,($o->as_set eq 'AS-TEST'), "as-set attribute not parsed successfully"); ++test(6,(scalar $o->attributes == 9), "not all attributes parsed successfully"); ++test(7,(defined $o->members and $o->members eq ''), ++ "members attribute not parsed successfully"); ++test(8,(scalar @remarks == 7), ++ "parsed ".(@remarks)." remarks attributes instead of 6"); ++test(9,($remarks[1] eq '' and $remarks[2] =~ /^-+$/ and $remarks[5] eq ''), ++ "remarks attribute not parsed correctly"); ++ ++exit 0;