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()
|
||||
|
||||
def debian_major_version(self):
|
||||
# We rely on lsb_release instead of the python module "platform",
|
||||
# because "platform" relies on uname, which on some weird setups does
|
||||
# not behave correctly (still says running Jessie when lsb_release says
|
||||
# Stretch...)
|
||||
return int(check_output("lsb_release -r").split("\t")[1][0])
|
||||
# The python module "platform" and lsb_release are not reliable because
|
||||
# on some setup, they still return Release=8 even after upgrading to
|
||||
# stretch ... (Apparently this is related to OVH overriding some stuff
|
||||
# with /etc/lsb-release for instance -_-)
|
||||
# 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):
|
||||
return int(get_installed_version("yunohost").split('.')[0])
|
||||
|
|
Loading…
Add table
Reference in a new issue