You are not logged in.
Pages: 1
The rankmirrors currently depends on python. That is absurd. I rewrote it using bash+coreutils+curl. Curl is a much more comfortable depend than python I do say. If this is up to snuff, I think it should replace the existing rankmirrors in pacman.
It should work the exact same as the previous one with a few differences:
1. When you KeyboardInterrupt, it still shoots out the mirrors it has timed in a sorted manner like the python one, but the behavior is slightly different if you are attempting to redirect that output to a file. I don't think this is significant and shouldn't really affect anyone, but it is there.
2. The rankmirrors -u option works now with a literal url like "http://mirrors.gigenet.com/archlinux/core/os/i686" and a url with the repo variable still there like 'http://mirrors.gigenet.com/archlinux/$repo/os/i686' So this actually adds functionality to the script. Woot!
3. Times are calculated to the milisecond and not the hundredth of a second.
Other than that, it appears to work just the same. All of the times that are reported come from curl's %{total_time} output. The results are sometimes different from the python socket stuff that is used in the python one, but I don't know that it is significant. I mean variations occur in every invocation of either one of the scripts. So just showing that they have different times doesn't prove much. Also I trust libcurl over some python socket lib anyways.
Code at the github, just a single bash script: http://github.com/bruenig/rankmirrors/tree/master
Edit: I misunderstood how -n was supposed to work. Fixed it.
Last edited by bruenig (2009-08-09 17:52:07)
Offline
^5
When I suggested you write it in bash I did not expect you to actually do it. Good job!
Hopefully the devs show it some love.
Offline
nice job breunig , it would be awesome if the script also checks how up to date the mirror is,
Offline
Nice bruenig .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
nice work
Offline
Words cannot describe the sheer awesomeness of this script.
Last edited by Wintervenom (2009-08-08 18:18:07)
Offline
just did pacman -Syu. why isnt it already there?!?!!
Offline
You brought the claque bruenig, didn't you?
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
You brought the claque bruenig, didn't you?
These are all unsolicited opinions. No serious person would disagree.
Offline
Not bad for a web developer! it's a keeper
vote+1
Offline
Very nice! This is a good idea... does it have a name?
Last edited by Gen2ly (2009-08-10 07:09:11)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
Very nice! This is a good idea... does it have a name?
rankmirrors is its name, seeking to replace the existing one
Offline
The python dependency always irked me just a bit....nice job!
Submitted to flyspray yet?
Offline
The python dependency always irked me just a bit....nice job!
Submitted to flyspray yet?
That would be great and makes it more coreutils only.
Offline
Offline
Pages: 1