diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-07-14 22:27:39 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-07-14 22:27:39 +0000 |
commit | c5fbcf59e0fcaba3dd137d406e38b3eb27d21573 (patch) | |
tree | 1933a54561dabc57dc0d6a5a31ff30eb885870f5 /scripts/feeds | |
parent | 6c8c019b785c5c868a3062485d250d5052d25e57 (diff) | |
download | upstream-c5fbcf59e0fcaba3dd137d406e38b3eb27d21573.tar.gz upstream-c5fbcf59e0fcaba3dd137d406e38b3eb27d21573.tar.bz2 upstream-c5fbcf59e0fcaba3dd137d406e38b3eb27d21573.zip |
scripts/feeds: return error status from feed update
This patch is a modified version of the patch being discussed at here:
https://patchwork.ozlabs.org/patch/471303/
from Martin Strbacka <martin.strbacka@nic.cz>
My version modifies scripts/feeds so that an error with one of the feeds just
raises the error flag, but script continues and tries to update the other
feeds. After all feeds have been updated, the script returns 1 if at least
one feed failed, and 0 on success with all feeds. The user can then utilise
the status in his build script, if he wants.
signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
SVN-Revision: 46374
Diffstat (limited to 'scripts/feeds')
-rwxr-xr-x | scripts/feeds | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/feeds b/scripts/feeds index 7744dd068e..1da44f539f 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -687,6 +687,7 @@ sub update { my %opts; my $feed_name; my $perform_update=1; + my $failed=0; $ENV{SCAN_COOKIE} = $$; $ENV{OPENWRT_VERBOSE} = 's'; @@ -711,8 +712,7 @@ sub update { if ( ($#ARGV == -1) or $opts{a}) { foreach my $feed (@feeds) { my ($type, $name, $src) = @$feed; - next unless update_feed($type, $name, $src, $perform_update) == 1; - last; + update_feed($type, $name, $src, $perform_update) == 0 or $failed=1; } } else { while ($feed_name = shift @ARGV) { @@ -721,14 +721,14 @@ sub update { if($feed_name ne $name) { next; } - update_feed($type, $name, $src, $perform_update); + update_feed($type, $name, $src, $perform_update) == 0 or $failed=1; } } } refresh_config(); - return 0; + return $failed; } sub feed_config() { |