From 8804b15b59138850bede90ce84d3212dbb391be2 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 1 Feb 2017 11:33:37 +0100 Subject: [PATCH] Make try_{install,remove} more robust. --- src/modules/packages/main.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 3ec60ff2d..2b2a52bf4 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -4,6 +4,7 @@ # === This file is part of Calamares - === # # Copyright 2014, Pier Luigi Fiorini +# Copyright 2015-2017, Teo Mrnjavac # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -134,17 +135,21 @@ def run_operations(pkgman, entry): if key == "install": pkgman.install(entry[key]) elif key == "try_install": - try: - pkgman.install(entry[key]) - except subprocess.CalledProcessError: - libcalamares.utils.debug("WARNING: could not install packages {}".format(", ".join(entry[key]))) + # we make a separate package manager call for each package so a single + # failing package won't stop all of them + for package in entry[key]: + try: + pkgman.install([package]) + except subprocess.CalledProcessError: + libcalamares.utils.debug("WARNING: could not install package {}".format(package)) elif key == "remove": pkgman.remove(entry[key]) elif key == "try_remove": - try: - pkgman.remove(entry[key]) - except subprocess.CalledProcessError: - libcalamares.utils.debug("WARNING: could not remove packages {}".format(", ".join(entry[key]))) + for package in entry[key]: + try: + pkgman.remove([package]) + except subprocess.CalledProcessError: + libcalamares.utils.debug("WARNING: could not remove package {}".format(package)) elif key == "localInstall": pkgman.install(entry[key], from_local=True)