This is an automated email from the git hooks/post-receive script. ntyni pushed a commit to branch master in repository libautodie-perl.
commit c1065ae835db0829f8d124e94a9dbaf46c3a3de0 Author: Niko Tyni <nt...@debian.org> Date: Fri Dec 25 12:39:43 2015 +0200 Fix a scoping issue with "no autodie" and the "system" sub Closes: #798096 --- ...ng-issue-with-no-autodie-and-the-system-s.patch | 101 +++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 102 insertions(+) diff --git a/debian/patches/0001-Fix-a-scoping-issue-with-no-autodie-and-the-system-s.patch b/debian/patches/0001-Fix-a-scoping-issue-with-no-autodie-and-the-system-s.patch new file mode 100644 index 0000000..cf79a9d --- /dev/null +++ b/debian/patches/0001-Fix-a-scoping-issue-with-no-autodie-and-the-system-s.patch @@ -0,0 +1,101 @@ +From c1b4fc4a319f8139d1cd6770bfb7b72a59ae232d Mon Sep 17 00:00:00 2001 +From: Niko Tyni <nt...@debian.org> +Date: Mon, 21 Dec 2015 19:20:12 +0200 +Subject: [PATCH] Fix a scoping issue with "no autodie" and the "system" sub + +Don't queue nonexisting subs for reinstalling later when +exiting the 'no autodie' scope. + +FIXME: if the original sub 'can be undef for "CORE::" subs', does this +break for those? Is that the case when $symbol =~ /::/, as guarded for +on L566? + +Bug: https://github.com/pjf/autodie/issues/69 +Bug-Debian: https://bugs.debian.org/798096 +Origin: upstream, https://github.com/pjf/autodie/commit/c1b4fc4a319f8139d1cd6770bfb7b72a59ae232d +--- + lib/Fatal.pm | 7 ++++++- + t/no-all.t | 22 ++++++++++++++++++++++ + t/no-default.t | 23 +++++++++++++++++++++++ + 3 files changed, 51 insertions(+), 1 deletion(-) + create mode 100755 t/no-all.t + create mode 100755 t/no-default.t + +diff --git a/lib/Fatal.pm b/lib/Fatal.pm +index 62ec1c0..d0f9cef 100644 +--- a/lib/Fatal.pm ++++ b/lib/Fatal.pm +@@ -581,7 +581,12 @@ sub unimport { + # Record the current sub to be reinstalled at end of scope + # and then restore the original (can be undef for "CORE::" + # subs) +- $reinstall_subs{$symbol} = \&$sub; ++ ++ { ++ no strict 'refs'; ++ $reinstall_subs{$symbol} = \&$sub ++ if exists ${"${pkg}::"}{$symbol}; ++ } + $uninstall_subs{$symbol} = $Original_user_sub{$sub}; + + } +diff --git a/t/no-all.t b/t/no-all.t +new file mode 100755 +index 0000000..1a503f6 +--- /dev/null ++++ b/t/no-all.t +@@ -0,0 +1,22 @@ ++#!/usr/bin/perl ++ ++package foo; ++use warnings; ++use strict; ++use Test::More tests => 1; ++use autodie qw(:all); ++ ++use_system(); ++ok("system() works with a lexical 'no autodie' block (github issue #69"); ++ ++sub break_system { ++ no autodie; ++ open(my $fh, "<", 'NONEXISTENT'); ++ ok("survived failing open"); ++} ++ ++sub use_system { ++ system($^X, '-e' , 1); ++} ++ ++1; +diff --git a/t/no-default.t b/t/no-default.t +new file mode 100755 +index 0000000..44d2acf +--- /dev/null ++++ b/t/no-default.t +@@ -0,0 +1,23 @@ ++#!/usr/bin/perl ++ ++package foo; ++use warnings; ++use strict; ++use Test::More tests => 2; ++use autodie; ++ ++ ++use_system(); ++ok("system() works with a lexical 'no autodie' block (github issue #69"); ++break_system(); ++ ++sub break_system { ++ no autodie; ++ open(my $fh, "<", 'NONEXISTENT'); ++ ok("survived failing open"); ++} ++ ++sub use_system { ++ system($^X, '-e' , 1); ++} ++1; +-- +2.6.4 + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..dcdff19 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-Fix-a-scoping-issue-with-no-autodie-and-the-system-s.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libautodie-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits