Currently the feeds script always exit with the status 0, even if it fails to update a feed. This patch changes this behaviour, returning 1 to the shell if any of the feeds fail to update.
This keeps the current behaviour, i.e., try to update all feeds even when one of them fails. Signed-off-by: Jonh Wendell <jonh.wend...@oiwifi.com.br> --- scripts/feeds | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/feeds b/scripts/feeds index b1bdee5..c86cea4 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -539,6 +539,7 @@ sub update { my %opts; my $feed_name; my $perform_update=1; + my $result; $ENV{SCAN_COOKIE} = $$; $ENV{OPENWRT_VERBOSE} = 's'; @@ -563,7 +564,7 @@ sub update { if ( ($#ARGV == -1) or $opts{a}) { foreach my $feed (@feeds) { my ($type, $name, $src) = @$feed; - update_feed($type, $name, $src, $perform_update); + $result = 1 if update_feed($type, $name, $src, $perform_update); } } else { while ($feed_name = shift @ARGV) { @@ -572,14 +573,14 @@ sub update { if($feed_name ne $name) { next; } - update_feed($type, $name, $src, $perform_update); + $result = 1 if update_feed($type, $name, $src, $perform_update); } } } refresh_config(); - return 0; + return $result; } sub usage() { -- 1.7.10.4 -- Jonh Wendell http://www.bani.com.br
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel