summaryrefslogtreecommitdiff
path: root/core/pacman-mirrorlist/update-list
blob: 2223f9ba44303452b162845f4207e1ead7446df3 (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
#!/bin/bash

cd "${0%/*}"

sed -i '
  1i ##\
## Arch Linux repository mirrorlist for i686\
## Generated on '"$(date +%F)"'\
##\

  1,/^$/d
' mirrorlist

sed -i '
  /^[^#]/d
' PKGBUILD

printf "pkgver=%s\n" "$(date '+%Y%m%d')" >> PKGBUILD
for sum_type in sha256 md5; do
  printf "%ssums=('%s')\n" \
    "${sum_type}" \
    "$(
      ${sum_type}sum mirrorlist | \
        awk '{print $1}'
    )" >> PKGBUILD
done