correct adding testing repository

This commit is contained in:
Tobias Powalowski 2022-12-07 07:38:27 +01:00
parent e8122a099e
commit 2eeaa9806f

View file

@ -66,9 +66,9 @@ dotesting() {
if ! grep -q "^\[testing\]" /etc/pacman.conf; then
DIALOG --defaultno --yesno "Do you want to enable [testing]\nand [community-testing] repositories?\n\nOnly enable this if you need latest\navailable packages for testing purposes!" 9 50 && DOTESTING="yes"
if [[ "${DOTESTING}" == "yes" ]]; then
#shellcheck disable=SC2129
! grep -q "^\[testing\]" /etc/pacman.conf && sed -i -e "s:#\[testing\]:\[testing\]\nInclude = /etc/pacman.d/mirrorlist:g" /etc/pacman.conf
! grep -q "^\[community-testing\]" /etc/pacman.conf && sed -i -e "s:#\[community-testing\]:\[community-testing\]\nInclude = /etc/pacman.d/mirrorlist:g" /etc/pacman.conf
sed -i -e '/^#\[testing\]/ { n ; s/^#// }' /etc/pacman.conf
sed -i -e '/^#\[community-testing\]/ { n ; s/^#// }' /etc/pacman.conf
sed -i -e 's:^#\[testing\]:\[testing\]:g' -e 's:^#\[community-testing\]:\[community-testing\]:g' /etc/pacman.conf
fi
fi
}