mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Rely on the codename instead of release number because lsb_release is fokin stupid
This commit is contained in:
parent
0ebfa145b8
commit
f96aa44505
1 changed files with 7 additions and 4 deletions
|
@ -55,7 +55,7 @@ class MyMigration(Migration):
|
||||||
_run_service_command("stop", "mysql")
|
_run_service_command("stop", "mysql")
|
||||||
self.apt_dist_upgrade(conf_flags=["old", "miss", "def"])
|
self.apt_dist_upgrade(conf_flags=["old", "miss", "def"])
|
||||||
_run_service_command("start", "mysql")
|
_run_service_command("start", "mysql")
|
||||||
if self.debian_major_version() == 8:
|
if self.debian_major_version() == "jessie":
|
||||||
raise MoulinetteError(m18n.n("migration_0003_still_on_jessie_after_main_upgrade", log=self.logfile))
|
raise MoulinetteError(m18n.n("migration_0003_still_on_jessie_after_main_upgrade", log=self.logfile))
|
||||||
|
|
||||||
# Specific upgrade for fail2ban...
|
# Specific upgrade for fail2ban...
|
||||||
|
@ -89,7 +89,10 @@ class MyMigration(Migration):
|
||||||
# because "platform" relies on uname, which on some weird setups does
|
# because "platform" relies on uname, which on some weird setups does
|
||||||
# not behave correctly (still says running Jessie when lsb_release says
|
# not behave correctly (still says running Jessie when lsb_release says
|
||||||
# Stretch...)
|
# Stretch...)
|
||||||
return int(check_output("lsb_release -r").split("\t")[1][0])
|
# Also lsb_release is fucking stupid and sometimes return "Release: 8"
|
||||||
|
# and "Codename: stretch". So apparently the codename is more reliable
|
||||||
|
# than the release number :|
|
||||||
|
return check_output("lsb_release -c").split("\t")[1].strip()
|
||||||
|
|
||||||
def yunohost_major_version(self):
|
def yunohost_major_version(self):
|
||||||
return int(get_installed_version("yunohost").split('.')[0])
|
return int(get_installed_version("yunohost").split('.')[0])
|
||||||
|
@ -100,7 +103,7 @@ class MyMigration(Migration):
|
||||||
# NB : we do both check to cover situations where the upgrade crashed
|
# NB : we do both check to cover situations where the upgrade crashed
|
||||||
# in the middle and debian version could be >= 9.x but yunohost package
|
# in the middle and debian version could be >= 9.x but yunohost package
|
||||||
# would still be in 2.x...
|
# would still be in 2.x...
|
||||||
if not self.debian_major_version() == 8 \
|
if not self.debian_major_version() == "jessie" \
|
||||||
and not self.yunohost_major_version() == 2:
|
and not self.yunohost_major_version() == 2:
|
||||||
raise MoulinetteError(m18n.n("migration_0003_not_jessie"))
|
raise MoulinetteError(m18n.n("migration_0003_not_jessie"))
|
||||||
|
|
||||||
|
@ -125,7 +128,7 @@ class MyMigration(Migration):
|
||||||
# NB : we do both check to cover situations where the upgrade crashed
|
# NB : we do both check to cover situations where the upgrade crashed
|
||||||
# in the middle and debian version could be >= 9.x but yunohost package
|
# in the middle and debian version could be >= 9.x but yunohost package
|
||||||
# would still be in 2.x...
|
# would still be in 2.x...
|
||||||
if not self.debian_major_version() == 8 \
|
if not self.debian_major_version() == "jessie" \
|
||||||
and not self.yunohost_major_version() == 2:
|
and not self.yunohost_major_version() == 2:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue