This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=61d4dc27cbe5f33420a7287bf830637eaf9e41a9

commit 61d4dc27cbe5f33420a7287bf830637eaf9e41a9
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Nov 1 22:17:09 2022 +0100

    Dselect::Ftp: Conditionally load perl modules shipped in the perl package
    
    In Debian and derivatives where the perl distribution is split into
    a perl-base package which is always guaranteed to be installed, and a
    perl-modules and perl packages, which are not, we need to conditionally
    load these modules, as we do not have strict dependencies on the perl
    package.
    
    On other systems, when perl is installed these modules will always be
    present so this change should not make any difference.
---
 dselect/methods/Dselect/Ftp.pm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm
index fa5487331..e95a6d5f6 100644
--- a/dselect/methods/Dselect/Ftp.pm
+++ b/dselect/methods/Dselect/Ftp.pm
@@ -32,8 +32,15 @@ our @EXPORT = qw(
 
 use Exporter qw(import);
 use Carp;
-use Net::FTP;
-use Data::Dumper;
+
+eval q{
+    use Net::FTP;
+    use Data::Dumper;
+};
+if ($@) {
+    warn "Missing 'perl' package required by the FTP access method.\n\n";
+    exit 1;
+}
 
 our %CONFIG;
 

-- 
Dpkg.Org's dpkg

Reply via email to