mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
apt and hold packages are fucking stupid, so we need to handle this the dirty way
This commit is contained in:
parent
cc240e94ca
commit
d769f539ab
1 changed files with 6 additions and 7 deletions
|
@ -45,12 +45,16 @@ class MyMigration(Migration):
|
|||
self.apt_update()
|
||||
apps_packages = self.get_apps_equivs_packages()
|
||||
self.unhold(["metronome"])
|
||||
self.hold(YUNOHOST_PACKAGES + apps_packages + ["fail2ban", "nginx-common"])
|
||||
self.hold(YUNOHOST_PACKAGES + apps_packages + ["fail2ban"])
|
||||
if "/etc/nginx/nginx.conf" in manually_modified_files_compared_to_debian_default() \
|
||||
and os.path.exists("/etc/nginx/nginx.conf"):
|
||||
os.system("mv /etc/nginx/nginx.conf \
|
||||
/home/yunohost.conf/backup/nginx.conf.bkp_before_stretch")
|
||||
|
||||
# Main dist-upgrade
|
||||
logger.warning(m18n.n("migration_0003_main_upgrade"))
|
||||
_run_service_command("stop", "mysql")
|
||||
self.apt_dist_upgrade(conf_flags=["old", "def"])
|
||||
self.apt_dist_upgrade(conf_flags=["old", "miss", "def"])
|
||||
_run_service_command("start", "mysql")
|
||||
if self.debian_major_version() == 8:
|
||||
raise MoulinetteError(m18n.n("migration_0003_still_on_jessie_after_main_upgrade", log=self.logfile))
|
||||
|
@ -66,11 +70,6 @@ class MyMigration(Migration):
|
|||
self.apt_dist_upgrade(conf_flags=["new", "miss", "def"])
|
||||
_run_service_command("restart", "fail2ban")
|
||||
|
||||
# Specific upgrade for nginx-common...
|
||||
logger.warning(m18n.n("migration_0003_nginx_upgrade"))
|
||||
self.unhold(["nginx-common"])
|
||||
self.apt_dist_upgrade(conf_flags=["new", "def"])
|
||||
|
||||
# Clean the mess
|
||||
os.system("apt autoremove --assume-yes")
|
||||
os.system("apt clean --assume-yes")
|
||||
|
|
Loading…
Add table
Reference in a new issue