You are not logged in.

#1 2005-02-01 06:21:04

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Sort pacman mirrors

pacman.conf has a handy bit of advice for sorting your mirrors but its a frustratingly boring task, so i automated it, bit more cron-jobable now

#!/bin/bash

base=/etc/pacman.d

cd $base

# obviously you can add more to the array!
for dbase in {current,extra}
do
    echo "Sorting $dbase mirrors.  Please wait..."
    sortmirrors.pl <$base/$dbase >$base/$dbase.new
    mv $base/$dbase.new $base/$dbase
done

Offline

#2 2005-02-01 12:10:59

Spider.007
Member
Registered: 2004-06-20
Posts: 1,134
Website

Re: Sort pacman mirrors

what / where is sortmirrors.pl and why not use a simple `sort` call?

Offline

#3 2005-02-01 13:51:09

kumo
Member
From: VARESE - Italy
Registered: 2004-04-02
Posts: 49
Website

Re: Sort pacman mirrors

Cheers! One thing though people should install the netselect package first otherwise your "current" and "extra" files will be emptied.

Offline

#4 2005-02-01 18:27:17

mattux
Member
Registered: 2004-04-22
Posts: 81

Re: Sort pacman mirrors

@spider.007...
`sort` only do alphabetic... sortmirrors.pl try to find out the d/l speed and sort them...


mattux

Offline

#5 2005-02-02 13:37:12

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Sort pacman mirrors

as i said this expands on the note at the top of pacman.conf!  smile

Offline

#6 2005-03-04 19:48:25

mercy
Member
Registered: 2004-04-24
Posts: 62

Re: Sort pacman mirrors

#!/bin/bash 

base=/etc/pacman.d 

cd $base 

# obviously you can add more to the array! 
for dbase in {current,extra}; do
   [ -f ${base}/${dbase}.orig ] || cp ${base}/${dbase}.orig;
   echo "Sorting $dbase mirrors.  Please wait...";
   sortmirrors.pl <${base}/${dbase}.orig >${base}/${dbase};
   cat ${base}/${dbase}.orig | egrep [^#] | sed 's/# The Extra Repository/# Just to keep em for emergency/' | sed 's/# CURRENT: Arch Linux core repository/# Just to keep em for emergency/' >> ${base}/${dbase};
done

sortmirror just leaves 3 mirrors.. id prefere something like that just to keep em if pacman cant reach those 3 (or find special pkgs on them)

Offline

#7 2005-03-04 20:53:13

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Sort pacman mirrors

I find that the easiest way to make Pacman faster is to just get rid of the iBiblio mirror in the pacman.d/* files... The other mirrors all seem pretty fast, but iBiblio seems to take forever to connect with (though it's fast once you're connected).

Offline

#8 2005-03-05 08:37:38

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Sort pacman mirrors

amusingly i just updated this script myself - it is also in a pkg in my repo:

#!/bin/bash

base=/etc/pacman.d

for dbase in {current,extra,testing,unstable} ; do
    repotest=`cat /etc/pacman.conf | grep "$dbase"`
    repotest=`echo $repotest | grep "#Include"`
    if [ -z $repotest ] ; then
        echo "Sorting $dbase mirrors.  Please wait..."
        sortmirrors.pl <$base/$dbase >$base/$dbase.new
        cp -f $base/$dbase.new $base/$dbase
        rm $base/$dbase.new
    fi
done

Mercy, I don't really understand you bit about it "just leaves three mirrors"?

Offline

#9 2005-03-06 15:40:14

mercy
Member
Registered: 2004-04-24
Posts: 62

Re: Sort pacman mirrors

in the orig file containing the servers you got a list of 10+ per repository (atm at my windoze-box so i cant tell you exact numbers)

the sort mirror gives you the closest* three and throws the others away...

*according to ping-delays

Offline

#10 2005-03-06 16:34:41

zeppelin
Member
From: Athens, Greece
Registered: 2004-03-05
Posts: 807
Website

Re: Sort pacman mirrors

sortmirros.pl and this job should go to WIKI plz

Offline

#11 2005-03-06 20:23:39

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Sort pacman mirrors

sortmirrors.pl is already included in pacman.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#12 2005-03-07 06:09:53

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Sort pacman mirrors

Xentac - yeah but sortmirrors on it's own is crap - it's stupid - why include a script that does half the job when it could do the whole job?  it's bizarre.

plus you need netselect - my package provides a "frontend" script for sortmirrors.pl and requires netselect so you get that dep in

(which i guess is why teh script isn't in pacman cos then pacman would depend on netselect, n'est pa?)

Offline

#13 2005-03-07 23:48:23

normc
Member
From: Ottawa, Canada
Registered: 2004-06-28
Posts: 277
Website

Re: Sort pacman mirrors

I gave it a try. It works great, for current and extra, then I get 
line 8: [: too many arguments


Norm

Offline

#14 2005-06-08 22:36:49

Shofs
Member
From: Central Illinois
Registered: 2004-12-15
Posts: 184

Re: Sort pacman mirrors

For some reason I only have four severs listed in my pacman.d/* files. I am not sire why. Where can I get the original files, or could someone post them for me.

Thanks

Offline

#15 2005-06-08 22:40:32

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Sort pacman mirrors


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#16 2005-06-09 01:24:53

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Sort pacman mirrors

From what I've seen, US (and probably Canadian) users should be able to use any mirror other than the ibiblio one without a problem. The ibiblio mirror has relatively low bandwidth and some irritating lag issues.

(This isn't really surprising, since it's the default mirror for the Extra repo.)

Offline

Board footer

Powered by FluxBB