summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-06-28 12:35:43 +0000
committerFrancois Pons <fpons@mandriva.com>2002-06-28 12:35:43 +0000
commitab18e550dddce9519cc42bfa1c3353066fc7b7f4 (patch)
tree71917427d42d4eb3b0c8f4449eb4d467477ea6e5
parentb67cae4683e58ced6b28721cba36e1f1aa2b83b7 (diff)
downloadurpmi-ab18e550dddce9519cc42bfa1c3353066fc7b7f4.tar
urpmi-ab18e550dddce9519cc42bfa1c3353066fc7b7f4.tar.gz
urpmi-ab18e550dddce9519cc42bfa1c3353066fc7b7f4.tar.bz2
urpmi-ab18e550dddce9519cc42bfa1c3353066fc7b7f4.tar.xz
urpmi-ab18e550dddce9519cc42bfa1c3353066fc7b7f4.zip
3.6-4mdk
-rw-r--r--urpm.pm6
-rwxr-xr-xurpmi11
-rwxr-xr-xurpmi.addmedia7
-rw-r--r--urpmi.spec9
-rwxr-xr-xurpmi.update7
-rwxr-xr-xurpmq7
6 files changed, 33 insertions, 14 deletions
diff --git a/urpm.pm b/urpm.pm
index de096572..325ce84e 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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 {
diff --git a/urpmi b/urpmi
index 04cfc9ab..15d5daea 100755
--- a/urpmi
+++ b/urpmi
@@ -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", $_);
diff --git a/urpmi.spec b/urpmi.spec
index e4a5fdca..39adfcf3 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -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.
diff --git a/urpmq b/urpmq
index 18c45574..2addd573 100755
--- a/urpmq
+++ b/urpmq
@@ -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 };