• Bug#1078202: restfuldb: FTBFS with Perl 5.40: test failures

    From Niko Tyni@21:1/5 to All on Thu Aug 8 10:00:01 2024
    Source: restfuldb
    Version: 0.16.0+dfsg-1
    Severity: important
    User: debian-perl@lists.debian.org
    Usertags: perl-5.40-transition
    Tags: sid trixie patch

    This package fails to build from source with Perl 5.40 (currently in experimental.)

    tests/cases/HTMLGenerator.pm_001.sh: FAILED:
    0a1
    > Attempt to call undefined import method with arguments ("$VERSION") via package "RestfulDB::Version" (Perhaps you forgot to load the package?) at <script_name> line <line_no>.

    This is fallout from a new Perl warning:

    https://metacpan.org/dist/perl/view/pod/perldelta.pod#Calling-the-import-method-of-an-unknown-package-produces-a-warning

    Proposed patch attached, this fixes it for me.

    A full build log is at

    https://perl.debian.net/rebuild-logs/perl-5.40-throwaway/restfuldb_0.16.0%2Bdfsg-1/restfuldb_0.16.0%2Bdfsg-1_amd64-2024-08-08T07%3A45%3A41Z.build

    --
    Niko Tyni ntyni@debian.org

    From: Niko Tyni <ntyni@debian.org>
    Date: Thu, 8 Aug 2024 08:40:04 +0100
    X-Dgit-Generated: 0.16.0+dfsg-1 6d05da4077a1b5fa329265880b0f52cfe07a6717 Subject: Fix RestfulDB::Version import

    RestfulDB::Version does not export $VERSION.

    This warns with newer versions of Perl (5.40 or so):

    Attempt to call undefined import method with arguments ("$VERSION") via package "RestfulDB::Version" (Perhaps you forgot to load the package?) at <script_name> line <line_no>.

    ---

    diff --git a/lib/HTMLGenerator.pm b/lib/HTMLGenerator.pm
    index de1f4a1..189af78 100644
    --- a/lib/HTMLGenerator.pm
    +++ b/lib/HTMLGenerator.pm
    @@ -46,7 +46,7 @@ use RestfulDB::SQL qw(
    is_integer
    is_text
    );
    -use RestfulDB::Version qw( $VERSION );
    +use RestfulDB::Version;
    use POSIX qw(strftime);
    use List::MoreUtils qw(uniq);
    use List::Util qw( any );

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)