summaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--urpm.pm17
-rwxr-xr-xurpmi2
-rw-r--r--urpmi.spec8
3 files changed, 16 insertions, 11 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
diff --git a/urpmi b/urpmi
index b09a55dd..7a1ed657 100755
--- a/urpmi
+++ b/urpmi
@@ -665,7 +665,7 @@ foreach my $set (@{$state->{transaction} || []}) {
print SAVEERR " " x 79, "\r";
} elsif ($mode eq 'error') {
#- error is 3rd argument, saved in $percent
- print STDERR N("...retrieving failed: %s"), $percent, "\n";
+ print STDERR N("...retrieving failed: %s", $percent), "\n";
}
}
},
diff --git a/urpmi.spec b/urpmi.spec
index a4a27f79..d6ff74eb 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -8,7 +8,7 @@
%define name urpmi
%define version 4.4.5
-%define release 4mdk
+%define release 5mdk
%define group %(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? "System/Configuration/Packaging" : "System Environment/Base"')
@@ -236,7 +236,11 @@ $urpm->update_media(nolock => 1, nopubkey => 1);
%{compat_perl_vendorlib}/urpm/parallel_ssh.pm
%changelog
-- gurpmi: don't escape "," in translatable string, do it after translation
+* Fri Jan 30 2004 Olivier Blin <blino@mandrake.org> 4.4.5-5mdk
+- send download errors to error output instead of log output
+ (in order to display them in non-verbose mode too)
+- From Guillaume Cottenceau <gc@mandrakesoft.com> :
+ - gurpmi: don't escape "," in translatable string, do it after translation
* Mon Feb 9 2004 Guillaume Cottenceau <gc@mandrakesoft.com> 4.4.5-4mdk
- fix bug #7472: progressbar forced to be thicker than default