mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[CI] Format code with Black
This commit is contained in:
parent
451ee7a8ae
commit
6cc7978b4a
1 changed files with 18 additions and 8 deletions
|
@ -25,6 +25,7 @@ N_CURRENT_YUNOHOST = 4
|
||||||
N_NEXT_DEBAN = 11
|
N_NEXT_DEBAN = 11
|
||||||
N_NEXT_YUNOHOST = 11
|
N_NEXT_YUNOHOST = 11
|
||||||
|
|
||||||
|
|
||||||
class MyMigration(Migration):
|
class MyMigration(Migration):
|
||||||
|
|
||||||
"Upgrade the system to Debian Bullseye and Yunohost 11.x"
|
"Upgrade the system to Debian Bullseye and Yunohost 11.x"
|
||||||
|
@ -76,13 +77,17 @@ class MyMigration(Migration):
|
||||||
_force_clear_hashes(["/etc/mysql/my.cnf"])
|
_force_clear_hashes(["/etc/mysql/my.cnf"])
|
||||||
rm("/etc/mysql/mariadb.cnf", force=True)
|
rm("/etc/mysql/mariadb.cnf", force=True)
|
||||||
rm("/etc/mysql/my.cnf", force=True)
|
rm("/etc/mysql/my.cnf", force=True)
|
||||||
self.apt_install("mariadb-common --reinstall -o Dpkg::Options::='--force-confmiss'")
|
self.apt_install(
|
||||||
|
"mariadb-common --reinstall -o Dpkg::Options::='--force-confmiss'"
|
||||||
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
# /usr/share/yunohost/yunohost-config/ssl/yunoCA -> /usr/share/yunohost/ssl
|
# /usr/share/yunohost/yunohost-config/ssl/yunoCA -> /usr/share/yunohost/ssl
|
||||||
#
|
#
|
||||||
if os.path.exists("/usr/share/yunohost/yunohost-config/ssl/yunoCA"):
|
if os.path.exists("/usr/share/yunohost/yunohost-config/ssl/yunoCA"):
|
||||||
os.system("mv /usr/share/yunohost/yunohost-config/ssl/yunoCA /usr/share/yunohost/ssl")
|
os.system(
|
||||||
|
"mv /usr/share/yunohost/yunohost-config/ssl/yunoCA /usr/share/yunohost/ssl"
|
||||||
|
)
|
||||||
rm("/usr/share/yunohost/yunohost-config", recursive=True, force=True)
|
rm("/usr/share/yunohost/yunohost-config", recursive=True, force=True)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -116,8 +121,12 @@ class MyMigration(Migration):
|
||||||
# Adding it there shouldnt be a big deal - Yunohost 11.x does add it
|
# Adding it there shouldnt be a big deal - Yunohost 11.x does add it
|
||||||
# through its regen conf anyway.
|
# through its regen conf anyway.
|
||||||
if not os.path.exists("/etc/apt/sources.list.d/extra_php_version.list"):
|
if not os.path.exists("/etc/apt/sources.list.d/extra_php_version.list"):
|
||||||
open("/etc/apt/sources.list.d/extra_php_version.list", "w").write("deb https://packages.sury.org/php/ bullseye main")
|
open("/etc/apt/sources.list.d/extra_php_version.list", "w").write(
|
||||||
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"')
|
"deb https://packages.sury.org/php/ bullseye main"
|
||||||
|
)
|
||||||
|
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"'
|
||||||
|
)
|
||||||
|
|
||||||
os.system("apt update")
|
os.system("apt update")
|
||||||
|
|
||||||
|
@ -285,7 +294,6 @@ class MyMigration(Migration):
|
||||||
|
|
||||||
call_async_output(cmd, callbacks, shell=True)
|
call_async_output(cmd, callbacks, shell=True)
|
||||||
|
|
||||||
|
|
||||||
def patch_yunohost_conflicts(self):
|
def patch_yunohost_conflicts(self):
|
||||||
#
|
#
|
||||||
# This is a super dirty hack to remove the conflicts from yunohost's debian/control file
|
# This is a super dirty hack to remove the conflicts from yunohost's debian/control file
|
||||||
|
@ -305,6 +313,8 @@ class MyMigration(Migration):
|
||||||
# We want to keep conflicting with apache/bind9 tho
|
# We want to keep conflicting with apache/bind9 tho
|
||||||
new_conflicts = "Conflicts: apache2, bind9"
|
new_conflicts = "Conflicts: apache2, bind9"
|
||||||
|
|
||||||
command = f"sed -i /var/lib/dpkg/status -e 's@{conflicts}@{new_conflicts}@g'"
|
command = (
|
||||||
|
f"sed -i /var/lib/dpkg/status -e 's@{conflicts}@{new_conflicts}@g'"
|
||||||
|
)
|
||||||
logger.debug(f"Running: {command}")
|
logger.debug(f"Running: {command}")
|
||||||
os.system(command)
|
os.system(command)
|
||||||
|
|
Loading…
Add table
Reference in a new issue