diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> | 2006-09-27 15:58:15 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> | 2006-09-27 15:58:15 +0000 |
commit | e367ab8deb3c959869de6c4f5ce2178d585c2aa6 (patch) | |
tree | afac71375bd34549c4eaedcdc20940bc5c81a960 | |
parent | af54a3fc1605e286878a3802ae3a5d6716703886 (diff) | |
download | urpmi-e367ab8deb3c959869de6c4f5ce2178d585c2aa6.tar urpmi-e367ab8deb3c959869de6c4f5ce2178d585c2aa6.tar.gz urpmi-e367ab8deb3c959869de6c4f5ce2178d585c2aa6.tar.bz2 urpmi-e367ab8deb3c959869de6c4f5ce2178d585c2aa6.tar.xz urpmi-e367ab8deb3c959869de6c4f5ce2178d585c2aa6.zip |
Issue error messages on trying to retrieve hdlists in several locations only
when the -v switch to urpmi.addmedia is used.
-rwxr-xr-x | urpmi.addmedia | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia index 79ad8c32..9a4e567d 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -76,6 +76,8 @@ and [options] are from exit 0; } +my $sync_logger = sub {}; + #- remove quietly the failing media. sub remove_failed { my ($urpm, @media) = @_; @@ -83,7 +85,7 @@ sub remove_failed { print STDERR join("\n", map { N("unable to update medium \"%s\"\n", $_->{name}) } @media); local $urpm->{log} = sub {}; $urpm->remove_selected_media; - $urpm->update_media(%options, callback => \&urpm::download::sync_logger); + $urpm->update_media(%options, callback => $sync_logger); exit(1); } } @@ -109,6 +111,7 @@ our ($name, $url, $with, $relative_hdlist) = our @cmdline; #- remove verbose if not asked. $options{verbose} > 0 or $urpm->{log} = sub {}; +$sync_logger = \&urpm::download::sync_logger if $options{verbose} > 1; $url or ($url, $name) = ($name, ''); my ($type) = $url =~ m,^(([^:]*):/)?/, or usage; @@ -155,7 +158,7 @@ if ($options{distrib}) { remove_failed($urpm, grep { $_->{modified} } @{$urpm->{media}}); exit(1); }; - $urpm->update_media(%options, callback => \&urpm::download::sync_logger); + $urpm->update_media(%options, callback => $sync_logger); remove_failed($urpm, grep { $_->{modified} } @{$urpm->{media}}); } else { @@ -183,7 +186,7 @@ if ($options{distrib}) { remove_failed($urpm, grep { $_->{name} eq $name && $_->{modified} } @{$urpm->{media}}); exit(1); }; - $urpm->update_media(%options, callback => \&urpm::download::sync_logger); + $urpm->update_media(%options, callback => $sync_logger); #- check creation of media my ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}}; $medium or die N("unable to create medium \"%s\"\n", $name); |