Une place pour une véritable innovation. Partagez vos propres utilitaires créés avec la communauté Manjaro.
Questions et discussions sur la programmation et le codage.

pamir : réécriture de pacman-mirrors en python

#21Messageil y a 10 ans

Hello Esclapion,
Je faisais référence à l'option -g car tu écrivais plus haut : « Ils m'ont demandé d'avoir les mêmes options que pacman-mirrors, »
Mais, et bien sûr c'est très subjectif, je la trouve pratique cette option car on peut vouloir dans certains cas un affichage du résultat sans pour autant vouloir la réalisation dans pacman de la liste. Aussi pour par exemple faire un lien symbolique pamir pacman-mirrors pour remplacer ce dernier aux fins de tests complets.

Aussi tu me confirmes que avec la méthode random aussi la vérification de la synchro des miroirs est vérifiée ?

Pour la vitesse d'exécution ? oui j'avais déjà vu cela. Et oui, good job :)

pamir : réécriture de pacman-mirrors en python

#22Messageil y a 10 ans

Un dernier point que j'ai oublié :
- prévoir des numéros de versions pour simplifier le suivi
Merci.

pamir : réécriture de pacman-mirrors en python

#23Messageil y a 10 ans

OK. Il faudra même que je mette mon nom aussi. :sourire: Mais j'avais cherché des cartouches normalisés, pas trouvé et oublié. :saispas:

Une option --version, aussi ? Mais j'ai hésité à mettre une --verbose -> :confus:

pamir : réécriture de pacman-mirrors en python

#24Messageil y a 10 ans

OK, donc :

- lien d'en-tête modifié vers e-Nautia ;
- version 1.0b : cartouche d'en-tête, et option -v --version ;
- bizarrerie du -o corrigée
- la date du fichier de sortie contient aussi l'heure

pamir : réécriture de pacman-mirrors en python

#25Messageil y a 10 ans

--> pamir -v
pamir 1.0b
`--> sudo pamir -g -c Custom
:: Querying servers, this may take some time...
-> 0.150 http://manjarolinux.polymorf.fr/stable/$repo/$arch
-> 1.190 http://ftp.nluug.nl/pub/os/Linux/distr/ ... repo/$arch
-> 0.124 http://www.mirrorservice.org/sites/repo ... repo/$arch
-> 0.130 http://mirror.catn.com/pub/manjaro/stable/$repo/$arch
-> 0.122 http://manjaro.mirrors.uk2.net/stable/$repo/$arch
-> 1.127 http://repo.manjaro.org.uk/stable/$repo/$arch
:: Generated and saved '/etc/pacman.d/mirrorlist' mirrorlist.

Et le -o
`--> pamir -c Custom -o list.txt
:: Querying servers, this may take some time...
-> 0.151 http://manjarolinux.polymorf.fr/stable/$repo/$arch
-> 0.135 http://ftp.nluug.nl/pub/os/Linux/distr/ ... repo/$arch
-> 1.126 http://www.mirrorservice.org/sites/repo ... repo/$arch
-> 0.131 http://mirror.catn.com/pub/manjaro/stable/$repo/$arch
-> 0.123 http://manjaro.mirrors.uk2.net/stable/$repo/$arch
-> 0.141 http://repo.manjaro.org.uk/stable/$repo/$arch
:: Generated and saved '/home/cep/tmp/list.txt' mirrorlist.

Tout ok :)

pamir : réécriture de pacman-mirrors en python

#27Messageil y a 10 ans

:bjr:

Normalement, livré dans Testing et Unstable aujourd'hui. Et dans 10 jours, il devrait arriver dans Stable.

pamir : réécriture de pacman-mirrors en python

#28Messageil y a 10 ans

:sourire: pamir en testing ? Bien
Pas encore arrivé.

pamir : réécriture de pacman-mirrors en python

#29Messageil y a 10 ans

Alors, en unstablle oui. Installé :
~]# pacman-mirrors -v
pacman-mirrors 1.0b

Pas de problème. Liste générée. Bien plus rapide.

pamir : réécriture de pacman-mirrors en python

#30Messageil y a 10 ans

@ Esclapion
Petite anomalie
Si on lance seulement pacman-mirrors -g (sans l'option -c )
le OnlyCountry=France positionné dans /etc/pacman-mirrors.conf
n'est pas pris en compte malgré le path_conf = "/etc/pacman-mirrors.conf"

Si je modifie /usr/bin/pacman-mirrors avec
onlyCountry=['France']
c'est bon.

L'ancienne version bash tenait compte de ce paramètre dans le conf.

pamir : réécriture de pacman-mirrors en python

#31Messageil y a 10 ans

Aïe : donc erreur dans analyse du fichier pacman-mirrors.conf, pas prise en compte de cette rubrique ?

(edit)
ça doit être quand j'ai aligné les options de pamir et celles de pacman-mirrors.

pamir : réécriture de pacman-mirrors en python

#32Messageil y a 10 ans

Si je modifie le /etc/pacman-mirrors.conf, c'est bon chez moi ???

Je n'ai peut-être pas bien compris le pb ???

OnlyCountry=France,Germany


ou

OnlyCountry=France


passent.
Dernière modification par Esclapionil y a 10 ans, modifié au total 1 fois.
Raison :1

pamir : réécriture de pacman-mirrors en python

#33Messageil y a 10 ans

Oui, c'est bien cela :

# grep OnlyCountry /etc/pacman-mirrors.conf
OnlyCountry=France
# pacman-mirrors -g
:: Querying servers, this may take some time...
-> Error!http://manjaro.mirror.ac.za/testing/$repo/$arch
-> 7.971 http://mirrors.ispros.com.bd/manjaro/te ... repo/$arch
-> Error!http://ftp.belnet.be/manjaro/testing/$repo/$arch
-> Error!http://manjaro.cu.be/testing/$repo/$arch
-> Error!http://manjaro.fis.unb.br/testing/$repo/$arch
-> 6.059 http://www.las.ic.unicamp.br/pub/manjar ... repo/$arch
-> Error!http://mirror.edatel.net.co/manjaro/testing/$repo/$arch
-> 5.262 http://mirrors.dotsrc.org/manjaro/testing/$repo/$arch
-> 0.155 http://manjarolinux.polymorf.fr/testing/$repo/$arch
-> Error!http://ftp.halifax.rwth-aachen.de/manjaro/testing/$repo/$arch
-> Error!http://ftp.tu-chemnitz.de/pub/linux/manjaro/testing/$repo/$arch
-> Error!http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/testing/$repo/$arch
-> Error!http://mirror3.layerjet.com/manjaro/testing/$repo/$arch
-> 0.297 http://ftp.cc.uoc.gr/mirrors/linux/manj ... repo/$arch
-> 0.711 http://kambing.ui.ac.id/manjaro/testing/$repo/$arch
-> Error!http://ftp.heanet.ie/mirrors/manjaro/testing/$repo/$arch
-> Error!http://manjaro.mirror.garr.it/mirrors/manjaro/testing/$repo/$arch
-> 6.010 http://ftp.tsukuba.wide.ad.jp/Linux/man ... repo/$arch
-> 0.728 http://www.ftp.ne.jp/Linux/packages/man ... o/$archgre
-> Error!http://ftp.kddilabs.jp/Linux/packages/manjaro/testing/$repo/$archp
-> 0.177 http://ftp.nluug.nl/pub/os/Linux/distr/ ... repo/$arch
-> 6.387 http://mirror.pregi.net/pub/Linux/manja ... $repo/$arc
-> 0.205 http://mirrors.xservers.ro/manjaro/testing/$repo/$arch
-> 0.201 http://mirrors.serverhost.ro/manjaro/pa ... repo/$arch
-> Error!http://ftp.lug.ro/manjaro/testing/$repo/$arch
-> Error!http://mirror.yandex.ru/mirrors/manjaro/testing/$repo/$arch
-> Error!http://ftp.lysator.liu.se/pub/manjaro/testing/$repo/$arch
-> Error!http://mirror.zetup.net/manjaro/testing/$repo/$arch
-> Error!http://free.twaren.net/manjaro/testing/$repo/$arch
-> 6.063 http://free.nchc.org.tw/manjaro/testing/$repo/$arch
-> 0.165 http://repo.manjaro.org.uk/testing/$repo/$arch
-> 0.155 http://www.mirrorservice.org/sites/repo ... repo/$arch
-> 0.146 http://mirror.catn.com/pub/manjaro/testing/$repo/$arch
-> 0.141 http://manjaro.mirrors.uk2.net/testing/$repo/$arch
-> 0.341 http://mirror.dacentec.com/manjaro/testing/$repo/$arch
-> 0.433 http://spiralinear.org/manjaro/repo/testing/$repo/$arch
-> Error!http://www.gtlib.gatech.edu/pub/manjaro/testing/$repo/$arch
-> Error!http://mirror.jmu.edu/manjaro/testing/$repo/$arch
:: Generated and saved '/etc/pacman.d/mirrorlist' mirrorlist.

Faudra faire des tests chez d'autres.

pamir : réécriture de pacman-mirrors en python

#34Messageil y a 10 ans

Essaie l'option -t, si ta liaison est très mauvaise.

[root@p mirrors]# pacman-mirrors -g
:: Querying servers, this may take some time...
-> 0.130 http://manjarolinux.polymorf.fr/stable/$repo/$arch
:: Generated and saved '/etc/pacman.d/mirrorlist' mirrorlist.
[root@p mirrors]#


(edit)

## Specify to use only mirrors from a specific country
## Disabled by default
OnlyCountry=France

## Input mirrorlist directory
MirrorlistsDir="/etc/pacman.d/mirrors"

pamir : réécriture de pacman-mirrors en python

#35Messageil y a 10 ans

Regarde la sortie de grep plus haut.

pamir : réécriture de pacman-mirrors en python

#37Messageil y a 10 ans

Sais pas. Faudra renouveler les tests chez d'autres, soit en testing, soit à la sortie en stable.

pamir : réécriture de pacman-mirrors en python

#38Messageil y a 10 ans

:sourire:
Si vous me dites qui et quoi.....pour tester :maître:
Parce-que je suis en stable 3.10.0-1 > je peux revenir en arrière en 9.9-1....j'ai encore l'image de backup
Comme tu voudras...vous savez :gsourire:

Édit > j'ai parcouru le post du début :
Faut-il toujours faire le script ?
Dernière modification par kilimand22il y a 10 ans, modifié au total 1 fois.

pamir : réécriture de pacman-mirrors en python

#39Messageil y a 10 ans

je ne sais pas si ça peux aider, mais quand je fait

sudo pacman-mirrors -g -c France


ça me génère bien un fichier mirrorlist avec seulement le serveur pour la France et ça fonctionne bien.
et c'est vraiment beaucoup plus rapide qu'avant quand on fait simplement un

sudo pacman-mirrors -g


merci pour l'excellent boulot !!! :bien:bien:bien

pamir : réécriture de pacman-mirrors en python

#40Messageil y a 10 ans

Oui :sourire:
Sans le script python ???

$ sudo pacman-mirrors -g -c France
[sudo] password for kili:
:: Querying servers, this may take some time...
:: Only country: France
 -> 1.171 http://manjarolinux.polymorf.fr/stable/$repo/$arch
:: Generated and saved '/etc/pacman.d/mirrorlist' mirrorlist.


Édit:
le mirrorlist :
##
## Manjaro Linux repository mirrorlist
## Generated on 15 juillet 2013
## Use pacman-mirrors to modify
##


## Location: France
## Time: 1.171
Server = http://manjarolinux.polymorf.fr/stable/$repo/$arch

Mais pas forcément le + rapide....> doit dépendre du lieu et de son FAI de connexion :

sudo pacman-mirrors -g
[sudo] password for kili:
:: Querying servers, this may take some time...
 -> 2.100 http://manjaro.mirror.ac.za/stable/$repo/$arch
 -> 1.794 http://mirrors.ispros.com.bd/manjaro/stable/$repo/$arch
 -> 0.715 http://ftp.belnet.be/manjaro/stable/$repo/$arch
 -> 0.701 http://manjaro.cu.be/stable/$repo/$arch
 -> unreachable http://manjaro.fis.unb.br/stable/$repo/$arch
 -> 2.054 http://www.las.ic.unicamp.br/pub/manjarolinux/stable/$repo/$arch
 -> 1.824 http://mirror.edatel.net.co/manjaro/stable/$repo/$arch
 -> 1.354 http://mirrors.dotsrc.org/manjaro/stable/$repo/$arch
 -> 0.762 http://manjarolinux.polymorf.fr/stable/$repo/$arch
 -> 0.703 http://ftp.halifax.rwth-aachen.de/manjaro/stable/$repo/$arch
 -> 0.807 http://ftp.tu-chemnitz.de/pub/linux/manjaro/stable/$repo/$arch
 -> 0.768 http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/stable/$repo/$arch
 -> 1.380 http://mirror3.layerjet.com/manjaro/stable/$repo/$arch
 -> 0.919 http://ftp.cc.uoc.gr/mirrors/linux/manjaro/stable/$repo/$arch
 -> 2.551 http://kambing.ui.ac.id/manjaro/stable/$repo/$arch
 -> 0.830 http://ftp.heanet.ie/mirrors/manjaro/stable/$repo/$arch
 -> 0.778 http://manjaro.mirror.garr.it/mirrors/manjaro/stable/$repo/$arch
 -> 2.664 http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/stable/$repo/$arch
 -> 2.944 http://www.ftp.ne.jp/Linux/packages/manjaro/stable/$repo/$arch
 -> 4.210 http://ftp.kddilabs.jp/Linux/packages/manjaro/stable/$repo/$arch
 -> 0.762 http://ftp.nluug.nl/pub/os/Linux/distr/manjaro/stable/$repo/$arch
 -> 3.352 http://mirror.pregi.net/pub/Linux/manjaro/stable/$repo/$arch
 -> 0.976 http://mirrors.xservers.ro/manjaro/stable/$repo/$arch
 -> 0.920 http://mirrors.serverhost.ro/manjaro/packages/stable/$repo/$arch
 -> 0.916 http://ftp.lug.ro/manjaro/stable/$repo/$arch
 -> 0.889 http://mirror.yandex.ru/mirrors/manjaro/stable/$repo/$arch
 -> unreachable http://ftp.lysator.liu.se/pub/manjaro/stable/$repo/$arch
 -> 1.489 http://mirror.zetup.net/manjaro/stable/$repo/$arch
 -> 4.646 http://free.twaren.net/manjaro/stable/$repo/$arch
 -> 2.753 http://free.nchc.org.tw/manjaro/stable/$repo/$arch
 -> 0.753 http://repo.manjaro.org.uk/stable/$repo/$arch
 -> 0.722 http://www.mirrorservice.org/sites/repo.manjaro.org/repos/stable/$repo/$arch
 -> 0.809 http://mirror.catn.com/pub/manjaro/stable/$repo/$arch
 -> 0.703 http://manjaro.mirrors.uk2.net/stable/$repo/$arch
 -> 1.171 http://mirror.dacentec.com/manjaro/stable/$repo/$arch
 -> 2.646 http://spiralinear.org/manjaro/repo/stable/$repo/$arch
 -> 2.659 http://www.gtlib.gatech.edu/pub/manjaro/stable/$repo/$arch
 -> 0.985 http://mirror.jmu.edu/manjaro/stable/$repo/$arch
:: Generated and saved '/etc/pacman.d/mirrorlist' mirrorlist.


Le début du mirrorlist

##
## Manjaro Linux repository mirrorlist
## Generated on 15 juillet 2013
## Use pacman-mirrors to modify
##


## Location: Belgium
## Time:     0.701
Server = http://manjaro.cu.be/stable/$repo/$arch

## Location: Germany
## Time:     0.703
Server = http://ftp.halifax.rwth-aachen.de/manjaro/stable/$repo/$arch

## Location: United_Kingdom
## Time:     0.703
Server = http://manjaro.mirrors.uk2.net/stable/$repo/$arch

## Location: Belgium
## Time:     0.715
Server = http://ftp.belnet.be/manjaro/stable/$repo/$arch

## Location: United_Kingdom
## Time:     0.722
Server = http://www.mirrorservice.org/sites/repo.manjaro.org/repos/stable/$repo/$arch

## Location: United_Kingdom
## Time:     0.753
Server = http://repo.manjaro.org.uk/stable/$repo/$arch

## Location: France
## Time:     0.762
Server = http://manjarolinux.polymorf.fr/stable/$repo/$arch

## Location: Netherlands
## Time:     0.762
Server = http://ftp.nluug.nl/pub/os/Linux/distr/manjaro/stable/$repo/$arch

## Location: Germany
## Time:     0.768
Server = http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/stable/$repo/$arch


On peut toujours, par la suite, commenter les + longs ...voir même les supprimer ....si c'est régulier :clindoeil:
Dernière modification par kilimand22il y a 10 ans, modifié au total 2 fois.
Répondre