[devscripts] 01/02: grep-excuses: Report excuses even if autoremovals aren't reachable

James McCoy jamessan at debian.org
Sat Mar 5 02:17:32 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 d6cab0a06c5cc050c4579267c529e6da03d7e8b9
Author: James McCoy <jamessan at debian.org>
Date:   Fri Mar 4 20:01:18 2016 -0500

    grep-excuses: Report excuses even if autoremovals aren't reachable
    
    Also, report the masked error code ($? >> 8) to the user.
    
    Closes: #816723
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog        |  3 +++
 scripts/grep-excuses.pl | 25 +++++++++++++++++++------
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8a61001..ecf3b6b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,9 @@ devscripts (2.16.2) UNRELEASED; urgency=medium
       (Closes: #816022)
   * uscan:
     + Fix typo in dirversionmangle help.  (Closes: #816231)
+  * grep-excuses:
+    + Report excuses even when autoremoval info isn't reachable.  (Closes:
+      #816723)
 
  -- Osamu Aoki <osamu at debian.org>  Sat, 13 Feb 2016 22:10:05 +0900
 
diff --git a/scripts/grep-excuses.pl b/scripts/grep-excuses.pl
index c856f62..0f5f0a1 100755
--- a/scripts/grep-excuses.pl
+++ b/scripts/grep-excuses.pl
@@ -193,8 +193,10 @@ if (system("command -v wget >/dev/null 2>&1") != 0) {
 sub grep_autoremovals () {
     print DEBUG "Fetching $rmurl\n";
 
-    open REMOVALS, "wget -q -O - $rmurl |" or
-	die "$progname: wget $rmurl failed: $!\n";
+    unless (open REMOVALS, "wget -q -O - $rmurl |") {
+	warn "$progname: wget $rmurl failed: $!\n";
+	return;
+    }
 
     my $wantmaint = 0;
     my %reportpkgs;
@@ -220,14 +222,20 @@ sub grep_autoremovals () {
 	}
 	warn "$progname: unprocessed line $. in $rmurl:\n$_";
     }
-    $?=0; close REMOVALS or die "$progname: fetch $rmurl failed ($? $!)\n";
+    $?=0;
+    unless (close REMOVALS) {
+	my $rc = $? >> 8;
+	warn "$progname: fetch $rmurl failed ($rc $!)\n";
+    }
 
     return unless %reportpkgs;
 
     print DEBUG "Fetching $rmurl_yaml\n";
 
-    open REMOVALS, "wget -q -O - $rmurl_yaml |" or
-	die "$progname: wget $rmurl_yaml failed: $!\n";
+    unless (open REMOVALS, "wget -q -O - $rmurl_yaml |") {
+	warn "$progname: wget $rmurl_yaml failed: $!\n";
+	return;
+    }
 
     my $reporting = 0;
     while (<REMOVALS>) {
@@ -253,7 +261,12 @@ sub grep_autoremovals () {
 	warn "$progname: unprocessed line $. in $rmurl_yaml:\n$_";
     }
 
-    $?=0; close REMOVALS or die "$progname: fetch $rmurl_yaml failed ($? $!)\n";
+    $?=0;
+    unless (close REMOVALS)
+    {
+	my $rc = $? >> 8;
+	warn "$progname: fetch $rmurl_yaml failed ($rc $!)\n";
+    }
 
     foreach my $pkg (keys %reportpkgs) {
 	print "$pkg (AUTOREMOVAL)\n  $reportpkgs{$pkg}\n" or die $!;

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