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