summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-02-11 13:18:06 +0000
committerOlivier Blin <oblin@mandriva.org>2004-02-11 13:18:06 +0000
commit275fecaa3dbaabf97aa7bd03f3bff2b17eac95a0 (patch)
treee127d211991de9b234e03fa7eeec561b40e4be75 /urpm.pm
parent11bd1f5120e939c60aa1256dbed1a9c3b28289eb (diff)
downloadurpmi-275fecaa3dbaabf97aa7bd03f3bff2b17eac95a0.tar
urpmi-275fecaa3dbaabf97aa7bd03f3bff2b17eac95a0.tar.gz
urpmi-275fecaa3dbaabf97aa7bd03f3bff2b17eac95a0.tar.bz2
urpmi-275fecaa3dbaabf97aa7bd03f3bff2b17eac95a0.tar.xz
urpmi-275fecaa3dbaabf97aa7bd03f3bff2b17eac95a0.zip
send download errors to error output instead of log output (in order to display them in non-verbose mode too)
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm17
1 files changed, 9 insertions, 8 deletions
diff --git a/urpm.pm b/urpm.pm
index 1f484850..eb7f26bb 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -326,7 +326,7 @@ sub sync_curl {
propagate_sync_callback($options, 'end', $file);
$file = undef;
}
- } elsif ($buf =~ /^curl:/) { #- probably an error reported by curl
+ } elsif ($buf =~ /^curl:/) { #- likely to be an error reported by curl
local $/ = "\n";
chomp $buf;
propagate_sync_callback($options, 'error', $file, $buf);
@@ -452,6 +452,9 @@ sub sync_logger {
print STDERR $text, " " x (79 - length($text)), "\r";
} elsif ($mode eq 'end') {
print STDERR " " x 79, "\r";
+ } elsif ($mode eq 'error') {
+ #- error is 3rd argument, saved in $percent
+ print STDERR N("...retrieving failed: %s", $percent), "\n";
}
}
@@ -1049,7 +1052,7 @@ sub add_distrib_media {
reduce_pathname("$url/Mandrake/base/hdlists"));
$urpm->{log}(N("...retrieving done"));
};
- $@ and $urpm->{log}(N("...retrieving failed: %s", $@));
+ $@ and $urpm->{error}(N("...retrieving failed: %s", $@));
if (-e "$urpm->{cachedir}/partial/hdlists") {
$hdlists_file = "$urpm->{cachedir}/partial/hdlists";
} else {
@@ -1708,7 +1711,7 @@ this could happen if you mounted manually the directory when creating the medium
proxy => $urpm->{proxy} }, reduce_pathname("$medium->{url}/$medium->{with_hdlist}"));
};
if ($@) {
- $urpm->{log}(N("...retrieving failed: %s", $@));
+ $urpm->{error}(N("...retrieving failed: %s", $@));
unlink "$urpm->{cachedir}/partial/$basename";
}
}
@@ -1717,7 +1720,7 @@ this could happen if you mounted manually the directory when creating the medium
if (-s "$urpm->{cachedir}/partial/$basename" > 32 && $retrieved_md5sum) {
$urpm->{log}(N("computing md5sum of retrieved source hdlist (or synthesis)"));
unless ((split ' ', `md5sum '$urpm->{cachedir}/partial/$basename'`)[0] eq $retrieved_md5sum) {
- $urpm->{log}(N("...retrieving failed: %s", N("md5sum mismatch")));
+ $urpm->{error}(N("...retrieving failed: %s", N("md5sum mismatch")));
unlink "$urpm->{cachedir}/partial/$basename";
}
}
@@ -2320,7 +2323,7 @@ sub register_rpms {
$urpm->{log}(N("...retrieving done"));
$_ = "$urpm->{cachedir}/partial/$basename";
};
- $@ and $urpm->{log}(N("...retrieving failed: %s", $@));
+ $@ and $urpm->{error}(N("...retrieving failed: %s", $@));
} else {
-r $_ or $error = 1, $urpm->{error}(N("unable to access rpm file [%s]", $_)), next;
}
@@ -3000,9 +3003,7 @@ sub download_packages_of_distant_media {
values %distant_sources);
$urpm->{log}(N("...retrieving done"));
};
- if ($@) {
- $urpm->{log}(N("...retrieving failed: %s", $@));
- }
+ $@ and $urpm->{error}(N("...retrieving failed: %s", $@));
#- clean files that have not been downloaded, but keep mind there
#- has been problem downloading them at least once, this is
#- necessary to keep track of failing download in order to