You are not logged in.

#1 2007-04-12 15:46:38

rbrownclown
Member
Registered: 2006-12-29
Posts: 125

Rank Mirrors

I heard that rankmirrors is included in pacman 3.  Has pacman been updated to this version in Arch 64?  How do I use it?

Offline

#2 2007-04-12 17:09:14

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Rank Mirrors

I think pacman 3 is still in testing... You can check your version with pacman -V.

Offline

#3 2007-04-12 19:11:37

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: Rank Mirrors

Yes, pacman3 is still in testing. However, you can get the rankmirror script here:
http://cvs.archlinux.org/cgi-bin/viewcv … oot=Pacman

Offline

#4 2007-04-12 21:17:13

rbrownclown
Member
Registered: 2006-12-29
Posts: 125

Re: Rank Mirrors

Snowman wrote:

Yes, pacman3 is still in testing. However, you can get the rankmirror script here:
http://cvs.archlinux.org/cgi-bin/viewcv … oot=Pacman

Cool... but how do I use it?  Is it as simple as downloading and ./ ?

Offline

#5 2007-04-12 21:24:28

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Rank Mirrors

Save it in a file like eg. rankMirrors.py and run python ranMirrors.py /etc/pacman.d/current to rank the servers in the current file.

Offline

#6 2007-04-13 02:28:21

Jessehk
Member
From: Toronto, Ontario, Canada
Registered: 2007-01-16
Posts: 152

Re: Rank Mirrors

Ramses de Norre wrote:

Save it in a file like eg. rankMirrors.py and run python ranMirrors.py /etc/pacman.d/current to rank the servers in the current file.

I may be extremely stupid, but the rankmirrors script included with pacman 3 didn't edit the file specified, but rather output the new file to stdout.

I had to:

rankmirrors /etc/pacman.d/current > /etc/pacman.d/current_new

in order for anything to happen.

Offline

#7 2007-06-23 18:05:58

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: Rank Mirrors

Jessehk wrote:

I had to:

rankmirrors /etc/pacman.d/current > /etc/pacman.d/current_new

in order for anything to happen.

You mean to say that one needs to run rankmirror and save the file with some different name and then delete old files and rename the newly created files to old names (eg current_new to current) to get any benefit of rankmirror. I ran rankmirror and it gave a list of servers (i guess in order of responsiveness). Isnt thats all what we need to do?

Last edited by ravisghosh (2007-06-23 18:06:32)

Offline

#8 2007-06-23 18:52:33

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Rank Mirrors

You need to set the servers in your conf file (e.g. /etc/pacman.d/current for current) in the order rankmirror gave them to you.

Offline

#9 2007-06-24 10:30:27

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: Rank Mirrors

So, doing

 rankmirror /etc/pacman.d/current > /etc/pacman.d/current_new

and then deleting current and renaming current_new to current is what we need to do.

Offline

#10 2007-06-24 14:45:31

Jessehk
Member
From: Toronto, Ontario, Canada
Registered: 2007-01-16
Posts: 152

Re: Rank Mirrors

ravisghosh wrote:

So, doing

 rankmirror /etc/pacman.d/current > /etc/pacman.d/current_new

and then deleting current and renaming current_new to current is what we need to do.

Actually, with my very limited bash skills (which I'd very soon like to improve), I wrote a script called rankallmirrors.

I haven't tested it (I'm very temporarily on Ubuntu -- I'll be reinstalling Arch this afternoon), but it should do what you want.

#!/bin/bash

# edit this list appropriately to include the mirrors you want.
mirrors="current extra testing community"

root_UID=0
mirror_dir=/etc/pacman.d/
rankmirrors=/usr/bin/rankmirrors

if [ $UID != $root_uid ]; then
    echo "You don't have the privileges necessary to run this script."
    exit 1
elif [ ! -d $mirror_dir ]; then
    echo "Unable to locate pacman mirrors. Looked in ${mirror_dir}."
    exit 1
elif [ ! -e $rankmirrors ]; then
    echo "Unable to locate rankmirrors script. Do you have pacman >= 3.0 installed?"
    exit 1
fi

cd $mirror_dir
for mirror in $mirrors; do
    cp $mirror ${mirror}.bak
    $rankmirrors $mirror > ${mirror}.new
    mv ${mirror}.new $mirror
done

exit 0

Last edited by Jessehk (2007-06-24 14:51:26)

Offline

Board footer

Powered by FluxBB