[devscripts] 01/01: uscan: Use die instead of uscan_die for LWP::UserAgent error

James McCoy jamessan at debian.org
Sat Jun 4 01:03:10 UTC 2016


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 770ca95fd9022df98d19df7e0bd35e12ab223f48
Author: James McCoy <jamessan at debian.org>
Date:   Fri Jun 3 20:59:58 2016 -0400

    uscan: Use die instead of uscan_die for LWP::UserAgent error
    
    uscan_die is only useful to report errors in performing uscan's job.  If
    LWP::UserAgent isn't present, that can't be done at all so just use die.
    
    Also, uscan_die isn't defined during processing of BEGIN{} blocks so we
    end up failing without informing the user of the problem in their
    environment.
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog |  3 +++
 scripts/uscan.pl | 16 ++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index bc6434d..48a9301 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ devscripts (2.16.5) UNRELEASED; urgency=medium
   * uscan:
     + Import catfile from File::Spec::Functions to fix use of unqualified
       name.  Thanks to Craig Small for the patch.  (Closes: #823218)
+    + Use builtin die function when telling the user they don't have
+      LWP::UserAgent installed, instead of calling an undefined function.
+      (Closes: #826146)
 
   [ Osamu Aoki ]
   * uscan:
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index e105a68..5e3b1e2 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -1688,6 +1688,7 @@ use strict;
 use warnings;
 use Cwd qw/cwd abs_path/;
 use Dpkg::Changelog::Parse qw(changelog_parse);
+use Dpkg::Control::Hash;
 use Dpkg::IPC;
 use File::Basename;
 use File::Copy qw/copy/;
@@ -1700,23 +1701,22 @@ use Devscripts::Versort;
 use Text::ParseWords;
 use Digest::MD5;
 
-sub uscan_die ($);
-sub uscan_warn ($);
-# From here, do not use bare "warn" nor "die".
-# Use "uscan_warn" or "uscan_die" instead to make --dehs work as expected.
-
 BEGIN {
     eval { require LWP::UserAgent; };
     if ($@) {
 	my $progname = basename($0);
 	if ($@ =~ /^Can\'t locate LWP\/UserAgent\.pm/) {
-	    uscan_die "$progname: you must have the libwww-perl package installed\nto use this script\n";
+	    die "$progname: you must have the libwww-perl package installed\nto use this script\n";
 	} else {
-	    uscan_die "$progname: problem loading the LWP::UserAgent module:\n  $@\nHave you installed the libwww-perl package?\n";
+	    die "$progname: problem loading the LWP::UserAgent module:\n  $@\nHave you installed the libwww-perl package?\n";
 	}
     }
 }
-use Dpkg::Control::Hash;
+
+sub uscan_die ($);
+sub uscan_warn ($);
+# From here, do not use bare "warn" nor "die".
+# Use "uscan_warn" or "uscan_die" instead to make --dehs work as expected.
 
 my $CURRENT_WATCHFILE_VERSION = 4;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list