FS#8042 - rankmirrors doesn't work with the new global mirrorlist

Attached to Project: Pacman
Opened by Andrew Fyfe (space-m0nkey) - Monday, 17 September 2007, 16:04 GMT
Last edited by Dan McGee (toofishes) - Friday, 28 September 2007, 05:40 GMT
Task Type Bug Report
Category Scripts & Tools
Status Closed
Assigned To Aaron Griffin (phrakture)
Dan McGee (toofishes)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.0.5
Due in Version 3.1.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
When running rankmirrors on /etc/pacman.d/mirrorlist all the mirrors are marked unreachable because the urls contain $repo instead of a valid repository name.

Solution:
Have rankmirrors replace $repo with core when testing urls.

Steps to Reproduce:
rankmirrors -v /etc/pacman.d/mirrorlist
This task depends upon

This task blocks these from closing
 FS#8109 - Pacman 3.1 Release Roadmap 
Closed by  Dan McGee (toofishes)
Friday, 28 September 2007, 05:40 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed and tested in git, scheduled for 3.1
Comment by Aaron Griffin (phrakture) - Monday, 17 September 2007, 16:16 GMT
Yeah good idea.

if we want to get fancy with the mini lexing, we could use string.Template and setup some sort of:

junk = { 'repo': 'core' }
url = string.Template(url).safe_substitute(junk)

This future proofs the current implementation in the case that we add other $foo variables, or change to ${} syntax
ref: http://docs.python.org/lib/node40.html
Comment by Xavier (shining) - Monday, 17 September 2007, 17:26 GMT
Is the attached patch acceptable?
I don't know python, but it apparently works :)
Comment by Aaron Griffin (phrakture) - Monday, 17 September 2007, 17:53 GMT
Heh, looks fine to me - the string.Template use was more theoretical, me musing. A .replace() would have worked just as well.
Comment by Dan McGee (toofishes) - Tuesday, 18 September 2007, 00:32 GMT
Patched in my tree using your patch, thanks.

Loading...