[libbio-primerdesigner-perl] 01/02: add patch fixing hash manipulation inside each

Damyan Ivanov dmn at alioth.debian.org
Tue Sep 3 12:32:56 UTC 2013


This is an automated email from the git hooks/post-receive script.

dmn pushed a commit to branch master
in repository libbio-primerdesigner-perl.

commit 7147172531b50b835cdd7e2ad10293e09ce23730
Author: Damyan Ivanov <dmn at debian.org>
Date:   Tue Sep 3 15:29:24 2013 +0300

    add patch fixing hash manipulation inside each
    
    Fixes test failures with perl 5.18 (Closes: #711426)
---
 .../patches/no-hash-manipulation-inside-each.patch |   29 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 2 files changed, 30 insertions(+)

diff --git a/debian/patches/no-hash-manipulation-inside-each.patch b/debian/patches/no-hash-manipulation-inside-each.patch
new file mode 100644
index 0000000..c42250d
--- /dev/null
+++ b/debian/patches/no-hash-manipulation-inside-each.patch
@@ -0,0 +1,29 @@
+Description: avoid changing hash keys in an "each %hash" loop
+ This leads to undefined behaviour
+ Instead, mark what needs to be added/deleted and do it outside of the loop.
+Bug-Debian: http://bugs.debian.org/711426
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=85968
+Author: Damyan Ivanov <dmn at debian.org>
+Forwarded: yes
+
+--- a/lib/Bio/PrimerDesigner/primer3.pm
++++ b/lib/Bio/PrimerDesigner/primer3.pm
+@@ -106,12 +106,16 @@ that can be used to call result methods.
+     #
+     my %aliases = $self->list_aliases;
+     my %lookup  = reverse %aliases;
++    my @delete;
++    my %add;
+     while ( my ( $k, $v ) = each %$args ) {
+         next if exists $aliases{ $k };
+         my $alias = $lookup{ $k } or return $self->error("No alias for '$k'");
+-        delete $args->{ $k };
+-        $args->{ $alias } = $v;
++        push @delete, $k;
++        $add{ $alias } = $v;
+     }
++    delete $args->{$_} for @delete;
++    $args->{$_} = $add{$_} for keys %add;
+ 
+     #
+     # Check that everything required is present.
diff --git a/debian/patches/series b/debian/patches/series
index 3ee7479..42a6dc4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 build.pl-getopt-long.patch
+no-hash-manipulation-inside-each.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libbio-primerdesigner-perl.git



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