diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | urpm/download.pm | 9 |
2 files changed, 12 insertions, 1 deletions
@@ -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)}; } |