summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-05-18 12:39:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-05-18 12:39:43 +0000
commitb5a3719a93a7ed0531414e342d5e6fd5aed9711e (patch)
tree73fae052c24f65654a8e9bcb6f4a933ff58aab02
parent740ba83b28c56c99211df2e551eaef9e28e39827 (diff)
downloadurpmi-b5a3719a93a7ed0531414e342d5e6fd5aed9711e.tar
urpmi-b5a3719a93a7ed0531414e342d5e6fd5aed9711e.tar.gz
urpmi-b5a3719a93a7ed0531414e342d5e6fd5aed9711e.tar.bz2
urpmi-b5a3719a93a7ed0531414e342d5e6fd5aed9711e.tar.xz
urpmi-b5a3719a93a7ed0531414e342d5e6fd5aed9711e.zip
- urpmi
o fix "Argument list too long" when calling curl/wget/proz (things should work even in case of one big transaction) (#30848)
-rw-r--r--NEWS4
-rw-r--r--urpm/download.pm9
2 files changed, 12 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 2c57a488..9bc801b5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- urpmi
+ o fix "Argument list too long" when calling curl/wget/proz
+ (things should work even in case of one big transaction) (#30848)
+
Version 4.9.24 - 9 May 2007, by Pascal "Pixel" Rigaux
- urpmi
diff --git a/urpm/download.pm b/urpm/download.pm
index 255dee77..d34f1078 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -690,7 +690,14 @@ sub _sync_webfetch_raw {
}
}
my $sync = $urpm::download::{"sync_$preferred"} or die N("no webfetch found, supported webfetch are: %s\n", join(", ", urpm::download::ftp_http_downloaders()));
- $sync->($options, @{$files{ftp} || []}, @{$files{http} || []}, @{$files{https} || []});
+ my @l = (@{$files{ftp} || []}, @{$files{http} || []}, @{$files{https} || []});
+ while (@l) {
+ my $half_MAX_ARG = 131072 / 2;
+ # restrict the number of elements so that it fits on cmdline of curl/wget/proz
+ my $n = 0;
+ for (my $len = 0; $n < @l && $len < $half_MAX_ARG; $len += length($l[$n++])) {}
+ $sync->($options, splice(@l, 0, $n));
+ }
delete @files{qw(ftp http https)};
}