r60922 - in /NMUs/libparse-debianchangelog-perl: debian/changelog debian/control lib/Parse/DebianChangelog.pm t/parse-in-for-loop.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Fri Jul 30 10:04:34 UTC 2010


Author: ansgar-guest
Date: Fri Jul 30 10:04:14 2010
New Revision: 60922

URL: http://svn.debian.org/wsvn/?sc=1&rev=60922
Log:
* Non-maintainer upload.
* Filter duplicate bug numbers in Closes field. (Closes: #560634)
* Localize $_ in for loop. (Closes: #584943)
  - Add build-dep on perl (>= 5.10.1) | libtest-simple-perl (>= 0.88)
    and libtest-exception-perl for new test.

Added:
    NMUs/libparse-debianchangelog-perl/t/parse-in-for-loop.t
Modified:
    NMUs/libparse-debianchangelog-perl/debian/changelog
    NMUs/libparse-debianchangelog-perl/debian/control
    NMUs/libparse-debianchangelog-perl/lib/Parse/DebianChangelog.pm

Modified: NMUs/libparse-debianchangelog-perl/debian/changelog
URL: http://svn.debian.org/wsvn/NMUs/libparse-debianchangelog-perl/debian/changelog?rev=60922&op=diff
==============================================================================
--- NMUs/libparse-debianchangelog-perl/debian/changelog (original)
+++ NMUs/libparse-debianchangelog-perl/debian/changelog Fri Jul 30 10:04:14 2010
@@ -1,3 +1,13 @@
+libparse-debianchangelog-perl (1.1.1-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Filter duplicate bug numbers in Closes field. (Closes: #560634)
+  * Localize $_ in for loop. (Closes: #584943)
+    - Add build-dep on perl (>= 5.10.1) | libtest-simple-perl (>= 0.88)
+      and libtest-exception-perl for new test.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Fri, 30 Jul 2010 19:01:12 +0900
+
 libparse-debianchangelog-perl (1.1.1-2) unstable; urgency=low
 
   * Add liblocale-gettext-perl to Build-Depends-Indep: Fix FTBFS (LP:

Modified: NMUs/libparse-debianchangelog-perl/debian/control
URL: http://svn.debian.org/wsvn/NMUs/libparse-debianchangelog-perl/debian/control?rev=60922&op=diff
==============================================================================
--- NMUs/libparse-debianchangelog-perl/debian/control (original)
+++ NMUs/libparse-debianchangelog-perl/debian/control Fri Jul 30 10:04:14 2010
@@ -2,7 +2,7 @@
 Section: perl
 Priority: optional
 Build-Depends: debhelper (>= 5)
-Build-Depends-Indep: perl (>= 5.8.0-7), po4a, libtimedate-perl, libhtml-parser-perl, libhtml-template-perl, libclass-accessor-perl, liblocale-gettext-perl, tidy, libxml-simple-perl, libio-string-perl, libmodule-build-perl, libtest-pod-perl, libtest-pod-coverage-perl
+Build-Depends-Indep: perl (>= 5.8.0-7), po4a, libtimedate-perl, libhtml-parser-perl, libhtml-template-perl, libclass-accessor-perl, liblocale-gettext-perl, tidy, libxml-simple-perl, libio-string-perl, libmodule-build-perl, libtest-pod-perl, libtest-pod-coverage-perl, perl (>= 5.10.1) | libtest-simple-perl (>= 0.88), libtest-exception-perl
 Maintainer: Frank Lichtenheld <djpig at debian.org>
 Standards-Version: 3.7.3
 Vcs-git: git://source.djpig.de/git/Parse-DebianChangelog.git

Modified: NMUs/libparse-debianchangelog-perl/lib/Parse/DebianChangelog.pm
URL: http://svn.debian.org/wsvn/NMUs/libparse-debianchangelog-perl/lib/Parse/DebianChangelog.pm?rev=60922&op=diff
==============================================================================
--- NMUs/libparse-debianchangelog-perl/lib/Parse/DebianChangelog.pm (original)
+++ NMUs/libparse-debianchangelog-perl/lib/Parse/DebianChangelog.pm Fri Jul 30 10:04:14 2010
@@ -309,6 +309,7 @@
     my $blanklines = 0;
     my $unknowncounter = 1; # to make version unique, e.g. for using as id
 
+    local $_;
     while (<$fh>) {
 	s/\s*\n$//;
 #	printf(STDERR "%-39.39s %-39.39s\n",$expect,$_);
@@ -709,7 +710,7 @@
     }
 
     $f{Changes} = get_dpkg_changes( $data->[0] );
-    $f{Closes} = [ @{$data->[0]{Closes}} ];
+    my %closes = map { $_ => 1 } @{$data->[0]{Closes}};
 
     my $first = 1; my $urg_comment = '';
     foreach my $entry (@$data) {
@@ -723,10 +724,10 @@
 	$urg_comment .= $entry->{Urgency_Comment};
 
 	$f{Changes} .= "\n .".get_dpkg_changes( $entry );
-	push @{$f{Closes}}, @{$entry->{Closes}};
-    }
-
-    $f{Closes} = join " ", sort { $a <=> $b } @{$f{Closes}};
+	$closes{ $_ } = 1 for @{$entry->{Closes}};
+    }
+
+    $f{Closes} = join " ", sort { $a <=> $b } keys %closes;
     $f{Urgency} .= $urg_comment;
 
     return %f if wantarray;

Added: NMUs/libparse-debianchangelog-perl/t/parse-in-for-loop.t
URL: http://svn.debian.org/wsvn/NMUs/libparse-debianchangelog-perl/t/parse-in-for-loop.t?rev=60922&op=file
==============================================================================
--- NMUs/libparse-debianchangelog-perl/t/parse-in-for-loop.t (added)
+++ NMUs/libparse-debianchangelog-perl/t/parse-in-for-loop.t Fri Jul 30 10:04:14 2010
@@ -1,0 +1,33 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More 0.88;
+use Test::Exception;
+
+use Parse::DebianChangelog;
+
+my $data = <<'EOT';
+package (1.2-1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Ex A. Mple <ex at example.com>  Tue, 08 Jun 2010 01:50:16 +0900
+EOT
+
+{
+  my $parser = Parse::DebianChangelog->init;
+  for my $x ("") {
+    lives_ok { $parser->parse({ instring => $data }); } 'parse in for my $x (...) works';
+  }
+}
+
+{
+  my $parser = Parse::DebianChangelog->init;
+  for ("") {
+    lives_ok { $parser->parse({ instring => $data }); } 'parse in for (...) works';
+  }
+}
+
+done_testing;




More information about the Pkg-perl-cvs-commits mailing list