mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Rely on /etc/os-release to get the release number..
This commit is contained in:
parent
201edd8c38
commit
1b55eacf9c
1 changed files with 7 additions and 5 deletions
|
@ -85,11 +85,13 @@ class MyMigration(Migration):
|
||||||
self.upgrade_yunohost_packages()
|
self.upgrade_yunohost_packages()
|
||||||
|
|
||||||
def debian_major_version(self):
|
def debian_major_version(self):
|
||||||
# We rely on lsb_release instead of the python module "platform",
|
# The python module "platform" and lsb_release are not reliable because
|
||||||
# because "platform" relies on uname, which on some weird setups does
|
# on some setup, they still return Release=8 even after upgrading to
|
||||||
# not behave correctly (still says running Jessie when lsb_release says
|
# stretch ... (Apparently this is related to OVH overriding some stuff
|
||||||
# Stretch...)
|
# with /etc/lsb-release for instance -_-)
|
||||||
return int(check_output("lsb_release -r").split("\t")[1][0])
|
# Instead, we rely on /etc/os-release which should be the raw info from
|
||||||
|
# the distribution...
|
||||||
|
return int(check_output("grep VERSION_ID /etc/os-release | tr '\"' ' ' | cut -d ' ' -f2"))
|
||||||
|
|
||||||
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])
|
||||||
|
|
Loading…
Add table
Reference in a new issue