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=bc382efce48612135428ebae8c9820b924cc67a2

commit bc382efce48612135428ebae8c9820b924cc67a2
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Tue Nov 1 13:33:35 2022 +0100

    dselect: Require the Dpkg modules for the ftp access method
    
    While strictly speaking we do not currently need it, it will make it
    possible to remove code that can use functionality from the Dpkg perl
    modules. We replace the warning recommending to install perl, by a
    message stating that the Dpkg modules are missing, as if the user
    installs libdpkg-perl (or equivalent) then the perl package will also
    be pulled in.
---
 debian/control                 | 1 +
 dselect/methods/Dselect/Ftp.pm | 4 +++-
 dselect/methods/ftp/install.pl | 5 +++--
 dselect/methods/ftp/setup.pl   | 6 ++++--
 dselect/methods/ftp/update.pl  | 5 +++--
 5 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/debian/control b/debian/control
index 3666addda..161b48cfd 100644
--- a/debian/control
+++ b/debian/control
@@ -217,6 +217,7 @@ Depends:
  ${shlibs:Depends},
  ${misc:Depends},
 Suggests:
+ libdpkg-perl,
  perl,
 Description: Debian package management front-end
  dselect is a high-level interface for managing the installation and
diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm
index e95a6d5f6..de93eb81f 100644
--- a/dselect/methods/Dselect/Ftp.pm
+++ b/dselect/methods/Dselect/Ftp.pm
@@ -36,9 +36,11 @@ use Carp;
 eval q{
     use Net::FTP;
     use Data::Dumper;
+
+    use Dpkg; # Dummy import to require the presence of Dpkg::*.
 };
 if ($@) {
-    warn "Missing 'perl' package required by the FTP access method.\n\n";
+    warn "Missing Dpkg modules required by the FTP access method.\n\n";
     exit 1;
 }
 
diff --git a/dselect/methods/ftp/install.pl b/dselect/methods/ftp/install.pl
index 4ad7e7b74..af5883610 100755
--- a/dselect/methods/ftp/install.pl
+++ b/dselect/methods/ftp/install.pl
@@ -27,10 +27,11 @@ eval q{
     use Net::FTP;
     use File::Find;
     use Data::Dumper;
+
+    use Dpkg; # Dummy import to require the presence of Dpkg::*.
 };
 if ($@) {
-    warn "Please install the 'perl' package if you want to use the\n" .
-         "FTP access method of dselect.\n\n";
+    warn "Missing Dpkg modules required by the FTP access method.\n\n";
     exit 1;
 }
 
diff --git a/dselect/methods/ftp/setup.pl b/dselect/methods/ftp/setup.pl
index 562a61f65..8ab28fe9c 100755
--- a/dselect/methods/ftp/setup.pl
+++ b/dselect/methods/ftp/setup.pl
@@ -22,12 +22,14 @@ use warnings;
 eval q{
     pop @INC if $INC[-1] eq '.';
     use Net::FTP;
+
+    use Dpkg; # Dummy import to require the presence of Dpkg::*.
 };
 if ($@) {
-    warn "Please install the 'perl' package if you want to use the\n" .
-         "FTP access method of dselect.\n\n";
+    warn "Missing Dpkg modules required by the FTP access method.\n\n";
     exit 1;
 }
+
 use Dselect::Ftp;
 
 # deal with arguments
diff --git a/dselect/methods/ftp/update.pl b/dselect/methods/ftp/update.pl
index a40f6f01a..5cfd5cfdf 100755
--- a/dselect/methods/ftp/update.pl
+++ b/dselect/methods/ftp/update.pl
@@ -22,10 +22,11 @@ use warnings;
 eval q{
     pop @INC if $INC[-1] eq '.';
     use Net::FTP;
+
+    use Dpkg; # Dummy import to require the presence of Dpkg::*.
 };
 if ($@) {
-    warn "Please install the 'perl' package if you want to use the\n" .
-         "FTP access method of dselect.\n\n";
+    warn "Missing Dpkg modules required by the FTP access method.\n\n";
     exit 1;
 }
 

-- 
Dpkg.Org's dpkg

Reply via email to