diff options
-rw-r--r-- | urpm.pm | 6 | ||||
-rwxr-xr-x | urpmi | 11 | ||||
-rwxr-xr-x | urpmi.addmedia | 7 | ||||
-rw-r--r-- | urpmi.spec | 9 | ||||
-rwxr-xr-x | urpmi.update | 7 | ||||
-rwxr-xr-x | urpmq | 7 |
6 files changed, 33 insertions, 14 deletions
@@ -145,7 +145,7 @@ sub sync_webfetch { push @{$files{$1}}, $_; } if ($files{ftp} || $files{http}) { - if (-x "/usr/bin/curl") { + if (-x "/usr/bin/curl" && (! ref $options || $options->{prefer} ne 'wget' || ! -x "/usr/bin/wget")) { sync_curl($options, @{$files{ftp} || []}, @{$files{http} || []}); } elsif (-x "/usr/bin/wget") { sync_wget($options, @{$files{ftp} || []}, @{$files{http} || []}); @@ -231,7 +231,7 @@ sub sync_rsync { -x "/usr/bin/ssh" or die _("ssh is missing\n"); my $options = shift @_; foreach (@_) { - my $count = 3; #- retry count on error (if file exists). + my $count = 10; #- retry count on error (if file exists). my $basename = (/^.*\/([^\/]*)$/ && $1) || $_; do { system "/usr/bin/rsync", (ref $options && $options->{quiet} ? ("-q") : ("--progress", "-v")), "--partial", "-e", "ssh", @@ -1665,7 +1665,7 @@ sub download_source_packages { if ($url =~ /^(removable[^:]*|file):\/(.*)/) { $sources{$i} = $2; } elsif ($url =~ /^([^:]*):\/(.*\/([^\/]*))/) { - if ($force_local) { + if ($force_local || $1 ne 'ftp' && $1 ne 'http') { #- only ftp and http protocol supported. push @distant_sources, $url; $sources{$i} = "$urpm->{cachedir}/rpms/$3"; } else { @@ -104,8 +104,11 @@ for (@ARGV) { /^--src$/ and do { $src = 1; next }; /^--noclean$/ and do { $noclean = 1; next }; /^--force$/ and do { $force = 1; next }; - /^--wget$/ and do { $sync = \&urpm::sync_wget; next }; - /^--curl$/ and do { $sync = \&urpm::sync_curl; next }; + /^--wget$/ and do { $sync = sub { my $options = shift @_; + if (ref $options) { $options->{prefer} = 'wget' } + else { $options = { dir => $options, prefer => 'wget' } } + urpm::sync_webfetch($options, @_) }; next }; + /^--curl$/ and do { $sync = \&urpm::sync_webfetch; next }; /^--bug$/ and do { push @nextargv, \$bug; next }; /^--env$/ and do { push @nextargv, \$env; next }; /^--X$/ and do { $X = 1; next }; @@ -347,8 +350,8 @@ if (%{$state->{ask_remove} || {}}) { my $list = join "\n", keys %{$state->{ask_remove}}; $noexpr = _("Nn"); $yesexpr = _("Yy"); - message_input(_("Some package have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0; - system("rpm", "-e", "--nodeps", keys %{$state->{ask_remove}}, ($root ? ("--root", $root) : ())); + message_input(_("Some package have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ or + system("rpm", "-e", "--nodeps", keys %{$state->{ask_remove}}, ($root ? ("--root", $root) : ())); } #- get out of package that should not be upgraded. diff --git a/urpmi.addmedia b/urpmi.addmedia index 74c0019e..3ef542e9 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -51,8 +51,11 @@ and [options] are from /^--?c/ and $options{noclean} = 0, next; /^--?h/ and $options{probe_with_hdlist} = 1, next; /^--?f/ and ++$options{force}, next; - /^--wget/ and $urpm->{sync} = \&urpm::sync_wget, next; - /^--curl/ and $urpm->{sync} = \&urpm::sync_curl, next; + /^--wget/ and $urpm->{sync} = sub { my $options = shift @_; + if (ref $options) { $options->{prefer} = 'wget' } + else { $options = { dir => $options, prefer => 'wget' } } + urpm::sync_webfetch($options, @_) }, next; + /^--curl/ and $urpm->{sync} = \&urpm::sync_webfetch, next; /^--distrib$/ and $options{distrib} = 1, next; /^--update$/ and $options{update} = 1, next; /^-/ and die $usage . _("\nunknown options '%s'\n", $_); @@ -2,7 +2,7 @@ Name: urpmi Version: 3.6 -Release: 3mdk +Release: 4mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -144,6 +144,13 @@ fi %changelog +* Fri Jun 28 2002 François Pons <fpons@mandrakesoft.com> 3.6-4mdk +- increase retry count to 10 instead of 3 for rsync and ssh protocol. +- support prefered tools to download files (grpmi only handles ftp + and http protocol currently). +- change behaviour of no answered to remove package to simply ignore + remove instead of exiting. + * Fri Jun 28 2002 François Pons <fpons@mandrakesoft.com> 3.6-3mdk - fix deadlock on removing package. - fix rsync download for mulitples files. diff --git a/urpmi.update b/urpmi.update index eb36afac..1454d16a 100755 --- a/urpmi.update +++ b/urpmi.update @@ -35,8 +35,11 @@ sub main { /^--?c/ and $options{noclean} = 0, next; /^--?d/ and $options{depslist} = 1, next; /^--?f/ and ++$options{force}, next; - /^--wget/ and $urpm->{sync} = \&urpm::sync_wget, next; - /^--curl/ and $urpm->{sync} = \&urpm::sync_curl, next; + /^--wget/ and $urpm->{sync} = sub { my $options = shift @_; + if (ref $options) { $options->{prefer} = 'wget' } + else { $options = { dir => $options, prefer => 'wget' } } + urpm::sync_webfetch($options, @_) }, next; + /^--curl/ and $urpm->{sync} = \&urpm::sync_webfetch, next; /^--?noa/ and next; #- default, keeped for compability. /^-/ and die _("usage: urpmi.update [options] <name> ... where <name> is a medium name to update. @@ -81,8 +81,11 @@ for (@ARGV) { /^--sources$/ and do { $query->{sources} = 1; next }; /^--force$/ and do { $query->{force} = 1; next }; /^--root$/ and do { push @nextargv, \$query->{root}; next }; - /^--wget$/ and do { $urpm->{sync} = \&urpm::sync_wget; next }; - /^--curl$/ and do { $urpm->{sync} = \&urpm::sync_curl; next }; + /^--wget$/ and do { $urpm->{sync} = sub { my $options = shift @_; + if (ref $options) { $options->{prefer} = 'wget' } + else { $options = { dir => $options, prefer => 'wget' } } + urpm::sync_webfetch($options, @_) }; next }; + /^--curl$/ and do { $urpm->{sync} = \&urpm::sync_webfetch; next }; /^-(.*)$/ and do { foreach (split //, $1) { /[\?h]/ and do { usage; next }; /d/ and do { $query->{deps} = 1; next }; |