summaryrefslogtreecommitdiff
path: root/README
blob: 75341c478f06563f1c568bd678196b1adae3c30a (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
45
46
47
48
49
#!/bin/bash
# to be run as root ...

set -o

# import keys:
pacman-key --add <(curl -o - "https://arch.eckner.net/archlinuxewe/masterkeys.gpg")

# locally sign package-key
pacman-key --lsign-key 0x43BF68D3

# locally sign repository-key
pacman-key --lsign-key 0x20194BA1

# setup mirror in mirrorlist
if ! grep -q "^Server = https://arch\.eckner\.net" /etc/pacman.d/mirrorlist
then
  ml="$(
    curl -o - "https://arch.eckner.net/archlinuxewe/os/any/" 2> /dev/null | \
      tr "<>" "\n\n" | \
      grep "^pacman-mirrorlist-.*\.pkg\.tar\.xz\$" | \
      tail -n1
  )"
  curl -o - "https://arch.eckner.net/archlinuxewe/os/any/${ml}" 2> /dev/null | \
    tar -OxJ etc/pacman.d/mirrorlist > \
    /etc/pacman.d/mirrorlist
fi

# setup repo in pacman.conf
if grep -q "^\[archlinuxewe\]\$" /etc/pacman.conf
then
  tmpFile=$(mktemp)
  cat /etc/pacman.conf | \
    (
      while read s
      do
        if [[ "$s" = "# The testing repositories"* ]]
        then
          echo '[archlinuxewe]'
          echo 'SigLevel = Required'
          echo 'Include = /etc/pacman.d/mirrorlist'
          echo ''
        fi
        echo "${s}"
      done
    ) > "${tmpFile}"
  cat "${tmpFile}" > /etc/pacman.conf
  rm "${tmpFile}"
fi