Control: tag -1 patch

On Wed, Jul 05, 2023 at 10:23:45AM +0300, Niko Tyni wrote:
> Package: libmime-tools-perl
> Version: 5.510-1
> Severity: normal
> Tags: trixie sid
> User: debian-p...@lists.debian.org
> Usertags: perl-5.38-transition
> 
> The MIME::Decoder::QuotedPrint module throws a warning on usage
> with Perl 5.38 (currently in experimental):
> 
>   $ perl -w -e 'use MIME::Decoder::QuotedPrint'
>   Argument "3.16_01" isn't numeric in numeric ge (>=) at 
> /usr/share/perl5/MIME/Decoder/QuotedPrint.pm line 76.

> Looks like the version check needs to be changed to handle non-numeric
> version strings.

Trivial patch attached.
-- 
Niko Tyni   nt...@debian.org
>From 5964839271fd856076da6c7ed7822bcd39324c82 Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Sat, 29 Jul 2023 18:54:01 +0100
Subject: [PATCH] Fix MIME::QuotedPrint version parsing

Perl 5.38 bundles MIME::QuotedPrint at version 3.16_01 which is not
numeric, causing spurious warnings on usage.

Bug-Debian: https://bugs.debian.org/1040377
---
 lib/MIME/Decoder/QuotedPrint.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/MIME/Decoder/QuotedPrint.pm b/lib/MIME/Decoder/QuotedPrint.pm
index 89bb3da..1a8a7ec 100644
--- a/lib/MIME/Decoder/QuotedPrint.pm
+++ b/lib/MIME/Decoder/QuotedPrint.pm
@@ -1,6 +1,7 @@
 package MIME::Decoder::QuotedPrint;
 use strict;
 use warnings;
+use version;
 
 
 =head1 NAME
@@ -73,7 +74,7 @@ $VERSION = "5.510";
 # The following code is horrible.  I know.  Beat me up. --dfs
 BEGIN {
     if (!defined(&encode_qp_threearg)) {
-        if ($::MIME::QuotedPrint::VERSION >= 3.03) {
+        if (version->parse($::MIME::QuotedPrint::VERSION) >= version->parse(3.03)) {
             eval 'sub encode_qp_threearg ( $$$ ) { encode_qp(shift, shift, shift); }';
         } else {
             eval 'sub encode_qp_threearg ( $$$ ) { encode_qp(shift); }';
-- 
2.39.1

Reply via email to