Allow try_install and try_remove entries in packages module.
This commit is contained in:
parent
b272917e83
commit
c4df69b4a7
@ -18,6 +18,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import subprocess
|
||||
import libcalamares
|
||||
from libcalamares.utils import check_target_env_call, target_env_call
|
||||
|
||||
@ -117,8 +118,18 @@ def run_operations(pkgman, entry):
|
||||
for key in entry.keys():
|
||||
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])))
|
||||
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])))
|
||||
elif key == "localInstall":
|
||||
pkgman.install(entry[key], from_local=True)
|
||||
|
||||
|
@ -36,9 +36,9 @@ update_db: true
|
||||
# - remove:
|
||||
# - pkg3
|
||||
# - pkg4
|
||||
# - install:
|
||||
# - try_install: # no system install failure if a package cannot be installed
|
||||
# - pkg5
|
||||
# - remove:
|
||||
# - try_remove: # no system install failure if a package cannot be removed
|
||||
# - pkg2
|
||||
# - pkg1
|
||||
# - install:
|
||||
|
Loading…
Reference in New Issue
Block a user