Subject: [PATCH 1/2] rmadison: return a non-zero exit code if curl or wget failed

From: Raphael Geissert <[email-masked]>
Date: Thu, 23 Sep 2010 17:54:28 -0500

---
 scripts/rmadison.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/rmadison.pl b/scripts/rmadison.pl
index 505d446..cd60277 100755
--- a/scripts/rmadison.pl
+++ b/scripts/rmadison.pl
@@ -169,13 +169,18 @@ push @args, "t" if $params->{'time'};
 my $url = $params->{'url'} ? $params->{'url'} : $default_url;
 my @url = split /,/, $url;
 
+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 -/;
     system @cmd, $url . (($url =~ m/\?/)?'&':'?')."package=" . join("+", map { uri_escape($_) } @ARGV) . "&text=on&" . join ("&", @args);
+    $status = 1 if ($? >> 8 != 0);
 }
 
+exit $status;
+
 =pod
 
 =head1 NAME
-- 
1.7.1