From 6defbfdbacec8a711a69c06c62814a20845015a9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 10 Jun 2020 16:09:05 +0200 Subject: [PATCH] Fix small issue with unscd upgrade/downgrade ... new version ain't always 0.53.1, so find it using dirty scrapping --- src/yunohost/data_migrations/0015_migrate_to_buster.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/yunohost/data_migrations/0015_migrate_to_buster.py b/src/yunohost/data_migrations/0015_migrate_to_buster.py index 08e85e704..78f6c24c9 100644 --- a/src/yunohost/data_migrations/0015_migrate_to_buster.py +++ b/src/yunohost/data_migrations/0015_migrate_to_buster.py @@ -50,7 +50,11 @@ class MyMigration(Migration): # which for apt appears as a lower version (hence the --allow-downgrades and the hardcoded version number) unscd_version = check_output('dpkg -s unscd | grep "^Version: " | cut -d " " -f 2') if "yunohost" in unscd_version: - self.apt_install('unscd=0.53-1+b1 --allow-downgrades') + new_version = check_output("apt policy unscd 2>/dev/null | grep -v '\\*\\*\\*' | grep -A100 'Version table' | grep debian -B1 | head -n 1 | awk '{print $1}'") + if new_version: + self.apt_install('unscd=%s --allow-downgrades' % new_version) + else: + logger.warning("Could not identify which version of unscd to install") # Upgrade libpam-modules independently, small issue related to willing to overwrite a file previously provided by Yunohost libpammodules_version = check_output('dpkg -s libpam-modules | grep "^Version: " | cut -d " " -f 2')