postgresql 11->13 migration: skip if no yunohost app depend on postgresql

This commit is contained in:
Alexandre Aubin 2022-08-13 20:02:33 +02:00
parent 625eb79ca3
commit d161da039a

View file

@ -19,6 +19,10 @@ class MyMigration(Migration):
def run(self): def run(self):
if os.system('grep -A10 "ynh-deps" /var/lib/dpkg/status | grep "Package:\|Depends:" | grep -B1 postgresql') != 0:
logger.info("No YunoHost app seem to require postgresql... Skipping!")
return
if not self.package_is_installed("postgresql-11"): if not self.package_is_installed("postgresql-11"):
logger.warning(m18n.n("migration_0023_postgresql_11_not_installed")) logger.warning(m18n.n("migration_0023_postgresql_11_not_installed"))
return return