From 832fc9fd515ec2d738c1269bef96bcec89a2dfdb Mon Sep 17 00:00:00 2001 From: Kyle Robertze Date: Mon, 20 Feb 2017 14:22:18 +0200 Subject: [PATCH] fixed two bugs in packages module if the key "install" was used, the install would crash as the backwards compatibility checks were incorrect. Fixed a typo in the run function so pre- and post-install hooks now work correctly --- src/modules/packages/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index d0f34a08f..bfd8636f5 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -112,7 +112,7 @@ class PackageManager: def run(self, script): if script != "": - check_target_env_call(scrtip.split(" ")) + check_target_env_call(script.split(" ")) def subst_locale(list): @@ -138,13 +138,13 @@ def run_operations(pkgman, entry): for key in entry.keys(): entry[key] = subst_locale(entry[key]) if key == "install": - if isinstance(package, str): - pkgman.install(entry[key]) - else: + if isinstance(entry[key], list): for package in entry[key]: pkgman.run(package["pre-script"]) pkgman.install([package["package"]]) pkgman.run(package["post-script"]) + else: + pkgman.install(entry[key]) elif key == "try_install": # we make a separate package manager call for each package so a single # failing package won't stop all of them