Mageia Bugzilla – Attachment 7112 Details for
Bug 16500
If URPMI is set to use aria2 as downloader, there is no download progress displayed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
patch for urpmi progress downloading string with aria2
urpmi-download-v3.diff (text/plain), 2.02 KB, created by
Giuseppe Ghibò
on 2015-10-10 22:30:22 CEST
(
hide
)
Description:
patch for urpmi progress downloading string with aria2
Filename:
MIME Type:
Creator:
Giuseppe Ghibò
Created:
2015-10-10 22:30:22 CEST
Size:
2.02 KB
patch
obsolete
>--- /usr/lib/perl5/vendor_perl/5.20.1/urpm/download.pm.orig 2015-05-18 05:18:06.000000000 +0200 >+++ /usr/lib/perl5/vendor_perl/5.20.1/urpm/download.pm 2015-10-10 21:41:05.178272050 +0200 >@@ -694,7 +694,7 @@ > "/usr/bin/aria2c", $options->{debug} ? ('--log', "$options->{dir}/.aria2.log") : @{[]}, > '--auto-file-renaming=false', > '--ftp-pasv', >- '--summary-interval=0', >+ '--summary-interval=1', > '--follow-metalink=mem', > $medium->{mirrorlist} ? ( > '--metalink-enable-unique-protocol=true', # do not try to connect to the same server using the same protocol >@@ -762,8 +762,38 @@ > propagate_sync_callback($options, 'start', $file) > if !$options->{is_retry}; > } >+ >+ # >+ # aria2c > 1.14 changed the output of the progress download string >+ # it's no longer what follows: > #parses aria2c: [#1 SIZE:176.0KiB/2.5MiB(6%) CN:3 SPD:256.22KiBs ETA:09s] >- if ($buf =~ m!^\[#\d*\s+\S+:([\d\.]+\w*).([\d\.]+\w*)\S([\d]+)\S+\s+\S+\s*([\d\.]+)\s\w*:([\d\.]+\w*)\s\w*:(\d+\w*)\]$!) { >+ # if ($buf =~ m!^\[#\d*\s+\S+:([\d\.]+\w*).([\d\.]+\w*)\S([\d]+)\S+\s+\S+\s*([\d\.]+)\s\w*:([\d\.]+\w*)\s\w*:(\d+\w*)\]$!) { >+ # >+ # but here is the new one from aria2c 1.16 and beyond: >+ # >+ #parses aria2c: [#2c8dae 496KiB/830KiB(59%) CN:1 DL:84KiB ETA:3s] >+ # >+ # so the old parser no longer works. The following string parser has been rewritten by Shlomi Fish with use of >+ # multiline mode and comments for better readability, should >+ # aria2c progress download string change again: >+ # >+ if ($buf =~ m! >+ ^\[\#[\dA-Fa-f]+ # match #2c8dae >+ \s+ >+ ([\d\.]+\w*) # Match 496KiB >+ / >+ ([\d\.]+\w*) # Match 830KiB >+ \s* \( (\d+) % \) # Match (59%) >+ \s+ >+ CN:(\S+) # Match CN:1 >+ \s+ >+ DL:(\S+) # Match DL:84KiB >+ \s+ >+ ETA:(\w+) >+ \]$ >+ !msx >+ ) >+ { > my ($total, $percent, $speed, $eta) = ($2, $3, $5, $6); > #- $1 = current downloaded size, $4 = connections > if (propagate_sync_callback($options, 'progress', $file, $percent, $total, $eta, $speed) eq 'canceled') {
--- /usr/lib/perl5/vendor_perl/5.20.1/urpm/download.pm.orig 2015-05-18 05:18:06.000000000 +0200 +++ /usr/lib/perl5/vendor_perl/5.20.1/urpm/download.pm 2015-10-10 21:41:05.178272050 +0200 @@ -694,7 +694,7 @@ "/usr/bin/aria2c", $options->{debug} ? ('--log', "$options->{dir}/.aria2.log") : @{[]}, '--auto-file-renaming=false', '--ftp-pasv', - '--summary-interval=0', + '--summary-interval=1', '--follow-metalink=mem', $medium->{mirrorlist} ? ( '--metalink-enable-unique-protocol=true', # do not try to connect to the same server using the same protocol @@ -762,8 +762,38 @@ propagate_sync_callback($options, 'start', $file) if !$options->{is_retry}; } + + # + # aria2c > 1.14 changed the output of the progress download string + # it's no longer what follows: #parses aria2c: [#1 SIZE:176.0KiB/2.5MiB(6%) CN:3 SPD:256.22KiBs ETA:09s] - if ($buf =~ m!^\[#\d*\s+\S+:([\d\.]+\w*).([\d\.]+\w*)\S([\d]+)\S+\s+\S+\s*([\d\.]+)\s\w*:([\d\.]+\w*)\s\w*:(\d+\w*)\]$!) { + # if ($buf =~ m!^\[#\d*\s+\S+:([\d\.]+\w*).([\d\.]+\w*)\S([\d]+)\S+\s+\S+\s*([\d\.]+)\s\w*:([\d\.]+\w*)\s\w*:(\d+\w*)\]$!) { + # + # but here is the new one from aria2c 1.16 and beyond: + # + #parses aria2c: [#2c8dae 496KiB/830KiB(59%) CN:1 DL:84KiB ETA:3s] + # + # so the old parser no longer works. The following string parser has been rewritten by Shlomi Fish with use of + # multiline mode and comments for better readability, should + # aria2c progress download string change again: + # + if ($buf =~ m! + ^\[\#[\dA-Fa-f]+ # match #2c8dae + \s+ + ([\d\.]+\w*) # Match 496KiB + / + ([\d\.]+\w*) # Match 830KiB + \s* \( (\d+) % \) # Match (59%) + \s+ + CN:(\S+) # Match CN:1 + \s+ + DL:(\S+) # Match DL:84KiB + \s+ + ETA:(\w+) + \]$ + !msx + ) + { my ($total, $percent, $speed, $eta) = ($2, $3, $5, $6); #- $1 = current downloaded size, $4 = connections if (propagate_sync_callback($options, 'progress', $file, $percent, $total, $eta, $speed) eq 'canceled') {
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16500
: 7112