IS_SURY: check that if sury is enabled, then a safeguard must be in place

This commit is contained in:
David Prevot 2023-10-17 17:26:44 +02:00
parent d92a8862e8
commit 8f58aa00ee
2 changed files with 11 additions and 1 deletions

View file

@ -9,6 +9,7 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
* IS_OLDPUB: pub.evolix.net has been supersed by pub.evolix.org since Stretch
* IS_NEWPUB: verify that the new public repository is present
* IS_DRBDTWOPRIMARIES: check there are not 2 DRBD primaries at the same time.
* IS_SURY: check that if sury is enabled, then a safeguard must be in place
### Changed

View file

@ -200,9 +200,17 @@ check_oldpub() {
}
check_newpub() {
# Look for enabled pub.evolix.org sources
apt-cache policy | grep --quiet pub.evolix.org
apt-cache policy | grep "\bl=Evolix\b" | grep --quiet -v php
test $? -eq 0 || failed "IS_NEWPUB" "New pub.evolix.org repository is missing"
}
check_sury() {
# Look for enabled packages.sury.org sources
apt-cache policy | grep --quiet packages.sury.org
if [ $? -eq 0 ]; then
apt-cache policy | grep "\bl=Evolix\b" | grep php --quiet
test $? -eq 0 || failed "IS_SURY" "packages.sury.org is present but our safeguard pub.evolix.org repository is missing"
fi
}
check_aptitude() {
test -e /usr/bin/aptitude && failed "IS_APTITUDE" "aptitude may not be installed on Debian >=8"
}
@ -1454,6 +1462,7 @@ main() {
test "${IS_DEBIANSECURITY:=1}" = 1 && check_debiansecurity
test "${IS_OLDPUB:=1}" = 1 && check_oldpub
test "${IS_NEWPUB:=1}" = 1 && check_newpub
test "${IS_SURY:=1}" = 1 && check_sury
test "${IS_APTITUDE:=1}" = 1 && check_aptitude
test "${IS_APTGETBAK:=1}" = 1 && check_aptgetbak
test "${IS_USRRO:=1}" = 1 && check_usrro