2021-04-22 13:24:47 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# stdin: default config
|
|
|
|
# stdout: modified config
|
2021-09-10 15:59:33 +02:00
|
|
|
set -e
|
|
|
|
|
2021-11-13 17:43:42 +01:00
|
|
|
# save stdin in variable
|
2021-09-10 15:59:33 +02:00
|
|
|
stdin="$(cat)"
|
2021-06-18 19:32:30 +02:00
|
|
|
|
|
|
|
# Enable parallel downloads
|
2021-09-10 15:59:33 +02:00
|
|
|
echo "$stdin" | sed 's|^#ParallelDownloads\s*=.*$|ParallelDownloads = 4|'
|
|
|
|
|
2021-09-10 15:53:53 +02:00
|
|
|
# Assert multilib is not enabled
|
|
|
|
! echo "$stdin" | grep --quiet '^\[multilib\].*$'
|
|
|
|
|
|
|
|
# Enable multilib repository
|
2021-09-10 16:02:25 +02:00
|
|
|
printf '\n[multilib]\nInclude = /etc/pacman.d/mirrorlist\n'
|
2021-09-10 15:53:53 +02:00
|
|
|
|
2021-11-13 17:43:42 +01:00
|
|
|
# Assert de-p1st is not enabled
|
|
|
|
! echo "$stdin" | grep --quiet '^\[de-p1st\].*$'
|
|
|
|
|
2021-09-23 18:30:42 +02:00
|
|
|
# de-p1st mirror
|
2021-09-10 16:02:25 +02:00
|
|
|
printf '\n'
|
2021-09-10 15:53:53 +02:00
|
|
|
printf 'Include = /etc/pacman.d/de-p1st\n'
|