summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-04 06:31:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-04 06:31:22 +0000
commitaed076e34b4e696d6e59058f1ab8a1fc2e882d84 (patch)
treef16a903b90ca853d8f74cafb4f64fa82a909007b
parent6d8e4dfb2d3e651f39e331a4a616cdde51a50d92 (diff)
downloadurpmi-aed076e34b4e696d6e59058f1ab8a1fc2e882d84.tar
urpmi-aed076e34b4e696d6e59058f1ab8a1fc2e882d84.tar.gz
urpmi-aed076e34b4e696d6e59058f1ab8a1fc2e882d84.tar.bz2
urpmi-aed076e34b4e696d6e59058f1ab8a1fc2e882d84.tar.xz
urpmi-aed076e34b4e696d6e59058f1ab8a1fc2e882d84.zip
- urpmi
o fix "Argument list too long" when calling curl/wget/proz (things should work even in case of one big transaction) (#30848) (backport from trunk)
-rw-r--r--NEWS4
-rw-r--r--urpm/download.pm9
2 files changed, 12 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 54085410..815f1789 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.21.2 - 1 June 2007, by Pascal "Pixel" Rigaux
- urpmi.addmedia
diff --git a/urpm/download.pm b/urpm/download.pm
index e4fed74c..8afd78e5 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -689,7 +689,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)};
}