diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 54a6fbb6..b694d3fb 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -88,6 +88,11 @@ class EEStackController(CementBaseController): if set(EEVariables.ee_mysql).issubset(set(apt_packages)): Log.info(self, "Adding repository for MySQL, please wait ...") + mysql_pref = ("Package: *\nPin: origin mirror.aarnet.edu.au" + "\nPin-Priority: 1000\n") + with open('/etc/apt/preferences.d/' + 'MariaDB.pref', 'w') as mysql_pref_file: + mysql_pref_file.write(mysql_pref) EERepo.add(self, repo_url=EEVariables.ee_mysql_repo) Log.debug(self, 'Adding key for {0}' .format(EEVariables.ee_mysql_repo)) diff --git a/ee/cli/plugins/stack_migrate.py b/ee/cli/plugins/stack_migrate.py index 2533aa76..23255973 100644 --- a/ee/cli/plugins/stack_migrate.py +++ b/ee/cli/plugins/stack_migrate.py @@ -31,6 +31,13 @@ class EEStackMigrateController(CementBaseController): # Add MariaDB repo Log.info(self, "Adding repository for MariaDB, please wait ...") + + mysql_pref = ("Package: *\nPin: origin mirror.aarnet.edu.au" + "\nPin-Priority: 1000\n") + with open('/etc/apt/preferences.d/' + 'MariaDB.pref', 'w') as mysql_pref_file: + mysql_pref_file.write(mysql_pref) + EERepo.add(self, repo_url=EEVariables.ee_mysql_repo) Log.debug(self, 'Adding key for {0}' .format(EEVariables.ee_mysql_repo)) @@ -72,6 +79,7 @@ class EEStackMigrateController(CementBaseController): Log.info(self, "Updating apt-cache, please wait ...") EEAptGet.update(self) Log.info(self, "Installing MariaDB, please wait ...") + EEAptGet.remove(self, ["libmysqlclient18"]) EEAptGet.install(self, apt_packages) EEAptGet.auto_remove(self) diff --git a/ee/core/aptget.py b/ee/core/aptget.py index e23674fb..fd64a7c9 100644 --- a/ee/core/aptget.py +++ b/ee/core/aptget.py @@ -59,7 +59,7 @@ class EEAptGet(): global apt_get apt_get = apt_get.bake("-y") try: - if purge == "True": + if purge: for line in apt_get.purge(*packages, _iter=True): Log.info(self, Log.ENDC+line+Log.OKBLUE, end=' ') else: