Control: tag -1 patch

On Wed, Aug 07, 2024 at 11:10:28AM +0300, Niko Tyni wrote:
> Package: libtest-expander-perl
> Version: 2.5.0-2
> Severity: important
> User: debian-p...@lists.debian.org
> Usertags: perl-5.40-transition
> 
> This package fails its autopkgtest checks with Perl 5.40 (currently
> in experimental.)

>  89s     # Name "Test::Expander::BAIL_OUT" used only once: possible typo at 
> /usr/share/perl5/Test/Expander.pm line 83.
>  89s     not ok 2 - /usr/bin/perl -wc /usr/share/perl5/Test/Expander.pm 
> exited successfully

> A fix might be to add "no warnings 'once';" to the block where the
> offending variable is used.

Patch doing this attached.
-- 
Niko
>From 7df0abd5397aca2b809fe184200bf64018bc7f8f Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Sat, 24 Aug 2024 16:44:16 +0100
Subject: [PATCH] Silence a fatalized "used only once" warning

These warnings honour fatalizing with Perl 5.40, so the
module started to fail with for example

  $ perl -Ilib lib/Test/Expander.pm

as fatal warnings are requested inside.

See https://github.com/Perl/perl5/issues/13814

Bug-Debian: https://bugs.debian.org/1078117
---
 lib/Test/Expander.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/Test/Expander.pm b/lib/Test/Expander.pm
index eed7964..ecf9ea3 100644
--- a/lib/Test/Expander.pm
+++ b/lib/Test/Expander.pm
@@ -80,7 +80,10 @@ our @EXPORT = (
   qw( BAIL_OUT bail_on_failure dies_ok is_deeply lives_ok new_ok require_ok restore_failure_handler throws_ok use_ok ),
 );
 
-*BAIL_OUT = \&bail_out;                                     # Explicit "sub BAIL_OUT" would be untestable
+{
+  no warnings 'once';
+  *BAIL_OUT = \&bail_out;                                     # Explicit "sub BAIL_OUT" would be untestable
+}
 
 sub bail_on_failure {
   _set_failure_handler(
-- 
2.45.2

Reply via email to