summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index b1ea6454..8ee2ba12 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -488,8 +488,8 @@ sub sync_curl {
#- options for http files, -R (-O <file>)*
my $result;
if (my @all_files = (
- (map { ("-O", $_) } @ftp_files),
- (map { m|/| ? ("-O", $_) : @{[]} } @other_files)))
+ (map { (_curl_output_option($_), $_) } @ftp_files),
+ (map { m|/| ? (_curl_output_option($_), $_) : @{[]} } @other_files)))
{
my @l = (@ftp_files, @other_files);
my $cmd = join(" ", map { "'$_'" } "/usr/bin/curl",
@@ -516,6 +516,15 @@ sub sync_curl {
$result;
}
+sub _curl_output_option {
+ my ($remote_file) = @_;
+ #- curl 7.86 changed the -O option to remove any trailing query part from the output
+ #- file name. So if we have a query part, use the -o option instead. If not, use the
+ #- -O option to avoid bloating the command line.
+ my $local_file = basename($remote_file);
+ $local_file =~ /\?/ ? ('-o', $local_file) : '-O';
+}
+
sub _curl_action {
my ($cmd, $options, @l) = @_;