summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-12-05 16:16:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-12-05 16:16:52 +0000
commitc1314b9fdbea88d3d2e2f53fa3344f996e663d8c (patch)
tree035b51f2414906a32043b004566554aeaa4bcfb3 /urpm/media.pm
parenta9def5f61d5a49e5f148951af4e422c446b57c84 (diff)
downloadurpmi-c1314b9fdbea88d3d2e2f53fa3344f996e663d8c.tar
urpmi-c1314b9fdbea88d3d2e2f53fa3344f996e663d8c.tar.gz
urpmi-c1314b9fdbea88d3d2e2f53fa3344f996e663d8c.tar.bz2
urpmi-c1314b9fdbea88d3d2e2f53fa3344f996e663d8c.tar.xz
urpmi-c1314b9fdbea88d3d2e2f53fa3344f996e663d8c.zip
- urpmi.update:
o exit code 1 when a (selected) medium can't be updated (#35952) o leave early with error if no medium were successfull updated nb: also fix returning "unmodified" instead of "1" when a medium is not updated
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 9cd588cb..c262900d 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1595,7 +1595,7 @@ sub _update_medium_first_pass {
#- to speed up the process, we only read the synthesis at the beginning.
_parse_hdlist_or_synthesis__when_not_modified($urpm, $medium);
compute_need_second_pass($urpm, $medium, \@unresolved_before);
- return 1;
+ return 'unmodified';
}
#- always delete a remaining list file or pubkey file in cache.
@@ -1801,9 +1801,16 @@ sub update_media {
_update_media__handle_some_flags($urpm, $options{forcekey}, $options{all});
my $clean_cache = !$options{noclean};
+ my %updates_result;
foreach my $medium (grep { !$_->{ignore} } @{$urpm->{media}}) {
- _update_medium_first_pass($urpm, $medium, \$clean_cache, %options)
- or _update_medium_first_pass_failed($urpm, $medium);
+ my $rc = _update_medium_first_pass($urpm, $medium, \$clean_cache, %options);
+ $updates_result{$rc || 'error'}++;
+ $rc or _update_medium_first_pass_failed($urpm, $medium);
+ }
+
+ if ($updates_result{1} == 0) {
+ #- only errors/unmodified, leave now
+ return $updates_result{error} == 0;
}
#- some unresolved provides may force to rebuild all synthesis,
@@ -1846,6 +1853,8 @@ sub update_media {
#- NB: in case of $urpm->{modified}, write_MD5SUM is called in write_config above
write_MD5SUM($urpm);
}
+
+ $updates_result{error} == 0;
}
#- clean params and depslist computation zone.