#1126139 dh-make-perl: Alternative (multiple package) dependency detection warnings

#1126139#5
Date:
2026-01-22 09:39:47 UTC
From:
To:
Dear Maintainer,

I am installing OptArgs2 as a deb from cpan by running "cpan2deb OptArgs2".

A "../liboptargs2-perl_2.0.17-1_all.deb" package is built and installs
and loads correctly. However, there are warnings during the
debianization that indicate dh-make-perl has a problem with
dependency detection.

     Use of uninitialized value in hash element at /usr/share/perl5/Debian/Control/FromCPAN.pm line 397.
     Use of uninitialized value in subroutine entry at /usr/lib/x86_64-linux-gnu/perl5/5.40/AptPkg/Cache.pm line 50.
     + Test2::V0 found in libtest-simple-perl | libtest2-suite-perl
     Use of uninitialized value $pkg in substitution (s///) at /usr/share/perl5/DhMakePerl/Utils.pm line 131.
     Use of uninitialized value $pkg in string eq at /usr/share/perl5/DhMakePerl/Utils.pm line 133.
     Use of uninitialized value $pkg in string eq at /usr/share/perl5/DhMakePerl/Utils.pm line 133.
     Use of uninitialized value $pkg in string eq at /usr/share/perl5/DhMakePerl/Utils.pm line 133.
     Use of uninitialized value $pkg in pattern match (m//) at /usr/share/perl5/DhMakePerl/Utils.pm line 133.
     Use of uninitialized value $pkg in pattern match (m//) at /usr/share/perl5/DhMakePerl/Utils.pm line 133.

It appears from a brief look at the code, that
Debian::Control::FromCPAN is assuming a single Debian::Dependency->pkg
is returned from Debian::AptContents->find_perl_module_package. But
since Test2::V0 seems to be satisfied by multiple packages, it actually
returns a dependency where only Debian::Dependency->alternatives is
valid.

This does not stop the correct dependency making it into
debian/control, so it still appears to be working as designed. Perhaps
then this is a purely cosmetic issue.