[fix] bullseye migration: a few annoying issues related to Sury

This commit is contained in:
Alexandre Aubin 2022-08-29 15:36:24 +02:00
parent b9bb2e4de5
commit b5fabc871b

View file

@ -104,10 +104,18 @@ class MyMigration(Migration):
open("/etc/apt/sources.list.d/extra_php_version.list", "w").write(
"deb https://packages.sury.org/php/ bullseye main"
)
# Add Sury key even if extra_php_version.list was already there,
# because some old system may be using an outdated key not valid for Bullseye
# and that'll block the migration
os.system(
'wget --timeout 900 --quiet "https://packages.sury.org/php/apt.gpg" --output-document=- | gpg --dearmor >"/etc/apt/trusted.gpg.d/extra_php_version.gpg"'
)
# Remove legacy, duplicated sury entry if it exists
if os.path.exists("/etc/apt/sources.list.d/sury.list"):
os.system("rm -rf /etc/apt/sources.list.d/sury.list")
#
# Get requirements of the different venvs from python apps
#