aboutsummaryrefslogtreecommitdiffstats
path: root/README.org
blob: c37ca101fc17942093030038ce75979568eb844a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#+title: update-mirrors

#+begin_export html
<a href="http://laminar.ryuslash.org/jobs/update-mirrors">
  <img src="https://laminar.ryuslash.org/badge/update-mirrors.svg">
</a>
#+end_export

This is a simple utility for [[https://archlinux.org/][archlinux]] that keeps the mirror list up-to-date.

Whenever the =pacman-mirrorlist= updates it's always a pain to have to pick out which servers exactly you want. And the archlinux project provides a nice [[https://archlinux.org/mirrorlist/][Pacman Mirrorlist Generator]]. This utility uses that generator to automatically update the mirror list every time =pacman-mirrorlist= is updated.

* Installation

I've provided a =PKGBUILD= through which it can be installed:

: makepkg -sic

It will install the executable, configuration file, and pacman hook into the proper locations so that after it will always be called automatically.

You can also install it by adding my repository:

#+begin_src conf-unix
  [ryuslash]
  SigLevel = Optional TrustAll
  Server = https://ryuslash.org/repo/x86_64
#+end_src

And then run =pacman -Sy update-mirrors= to install it.

#+begin_note
Note that my repository currently isn't signed, plus I'm just a random guy on the internet. I don't expect anyone to actually use this, but if you do, do so with caution and at your own risk.
#+end_note

* Configuration

There are a few configuration options. The configuration file =etc/xdg/update-mirrors/config.sh= is just a regular shell script sourced by the =update-mirrors= script.

- =url= :: A string. The base URL for archlinux's mirrorlist generator. You probably don't have to change this. *Default*: =https://www.archlinux.org/mirrorslist=.
- =countries= :: An array of strings. Which countries you want to include mirrors from. You will probably want to change this. *Default*: =BE=, =NL=.
- =protocols= :: An array of strings. Which protocols to include. Available protocols are =http= and =https=. *Default*: =http=, =https=.
- =ip_versions= :: An array of numbers. Which IP versions to include in the mirrorlist. Available versions are =4= and =6=. *Default*: =4=.
- =use_mirror_status= :: The string “on” or empty. Turning this on will make the generator filter the list of mirrors by the mirror score from the [[https://archlinux.org/mirrors/status/][Mirror Status]] page. *Default*: =on=
- =dest= :: A string, a file path. Where to write the result to. You probably don't have to change this. *Default*: =/etc/pacman.d/mirrorlist=.