Control: tag -1 patch

On Wed, Aug 07, 2024 at 12:52:12AM +0300, Niko Tyni wrote:
> Package: libdancer-plugin-database-core-perl
> Version: 0.20-3
> Severity: important
> Tags: trixie sid
> User: debian-p...@lists.debian.org
> Usertags: perl-5.40-transition
> 
> This package fails its autopkgtest checks with Perl 5.40 (currently
> in experimental.)

>    81s     # Name "DBI::errstr" used only once: possible typo at 
> /usr/share/perl5/Dancer/Plugin/Database/Core.pm line 284.

> The best fix is presumably to add "no warnings 'once';" to the block
> where $DBI::errstr is used.

Trivial patch attached.
-- 
Niko
>From 50ca58b6eb72d8fa4746c996bc90eddc7d848567 Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Sat, 24 Aug 2024 16:12:19 +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 lib/Dancer/Plugin/Database/Core.pm

as fatal warnings are requested inside.

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

Bug-Debian: https://bugs.debian.org/1078101
---
 lib/Dancer/Plugin/Database/Core.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/Dancer/Plugin/Database/Core.pm b/lib/Dancer/Plugin/Database/Core.pm
index 9207da8..ee1c6ae 100644
--- a/lib/Dancer/Plugin/Database/Core.pm
+++ b/lib/Dancer/Plugin/Database/Core.pm
@@ -281,6 +281,7 @@ sub _get_connection {
     );
 
     if (!$dbh) {
+        no warnings 'once';
         $logger->(error => "Database connection failed - " . $DBI::errstr);
         $hook_exec->('database_connection_failed', $settings);
         return undef;
-- 
2.45.2

Reply via email to