[devscripts] 01/01: Make curl return a proper exit code for HTTP errors.

James McCoy jamessan at debian.org
Fri Aug 23 01:32:31 UTC 2013


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 9618fc205689b8ea860396106e28d91a5e2514df
Author: James McCoy <jamessan at debian.org>
Date:   Thu Aug 22 21:31:41 2013 -0400

    Make curl return a proper exit code for HTTP errors.
    
    Closes: #720508
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog      |    1 +
 scripts/rc-alert.pl   |    4 ++--
 scripts/rmadison.pl   |    2 +-
 scripts/wnpp-alert.sh |    2 +-
 scripts/wnpp-check.sh |    2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 43f0e78..85fdcd5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 devscripts (2.13.4) UNRELEASED; urgency=low
 
   * Document which scripts use libdistro-info-perl.  (Closes: #708311)
+  * Make curl return a proper exit code for HTTP errors.  (Closes: #720508)
 
  -- James McCoy <jamessan at debian.org>  Sun, 18 Aug 2013 07:17:51 -0400
 
diff --git a/scripts/rc-alert.pl b/scripts/rc-alert.pl
index 1787a6d..6ca4e90 100755
--- a/scripts/rc-alert.pl
+++ b/scripts/rc-alert.pl
@@ -165,7 +165,7 @@ if (system("command -v wget >/dev/null 2>&1") == 0) {
     $getcommand = "wget -q -O -";
 } elsif (system("command -v curl >/dev/null 2>&1") == 0) {
     $curl_or_wget = "curl";
-    $getcommand = "curl -qs";
+    $getcommand = "curl -qfs";
 } else {
     die "$progname: this program requires either the wget or curl package to be installed\n";
 }
@@ -186,7 +186,7 @@ if (-d $cachedir) {
 	    die "$progname: wget failed!\n";
 	}
     } elsif ("$curl_or_wget" eq "curl") {
-	if (system('curl', '-qsR', $url) != 0) {
+	if (system('curl', '-qfsR', $url) != 0) {
 	    die "$progname: curl failed!\n";
 	}
     } else {
diff --git a/scripts/rmadison.pl b/scripts/rmadison.pl
index ae2690d..9c7a5b6 100755
--- a/scripts/rmadison.pl
+++ b/scripts/rmadison.pl
@@ -191,7 +191,7 @@ my $status = 0;
 foreach my $url (@url) {
     print "$url:\n" if @url > 1;
     $url = $url_map{$url} if $url_map{$url};
-    my @cmd = -x "/usr/bin/curl" ? qw/curl -s -S -L/ : qw/wget -q -O -/;
+    my @cmd = -x "/usr/bin/curl" ? qw/curl -f -s -S -L/ : qw/wget -q -O -/;
     system @cmd, $url . (($url =~ m/\?/)?'&':'?')."package=" . join("+", map { uri_escape($_) } @ARGV) . "&text=on&" . join ("&", @args);
     $status = 1 if ($? >> 8 != 0);
 }
diff --git a/scripts/wnpp-alert.sh b/scripts/wnpp-alert.sh
index 530b3a7..66905fe 100755
--- a/scripts/wnpp-alert.sh
+++ b/scripts/wnpp-alert.sh
@@ -59,7 +59,7 @@ if command -v wget >/dev/null 2>&1; then
     GETCOMMAND="wget -q -O"
 elif command -v curl >/dev/null 2>&1; then
     CURLORWGET="curl"
-    GETCOMMAND="curl -qs -o"
+    GETCOMMAND="curl -qfs -o"
 else
     echo "$PROGNAME: need either the wget or curl package installed to run this" >&2
     exit 1
diff --git a/scripts/wnpp-check.sh b/scripts/wnpp-check.sh
index 9525698..fbf2b6e 100755
--- a/scripts/wnpp-check.sh
+++ b/scripts/wnpp-check.sh
@@ -39,7 +39,7 @@ if command -v wget >/dev/null 2>&1; then
     GETCOMMAND="wget -q -O"
 elif command -v curl >/dev/null 2>&1; then
     CURLORWGET="curl"
-    GETCOMMAND="curl -qs -o"
+    GETCOMMAND="curl -qfs -o"
 else
     echo "${0##*/}: need either the wget or curl package installed to run this" >&2
     exit 1

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