diff --git a/inst/service/backend/alpm.py b/inst/service/backend/alpm.py index 7a3ba2d..6035e3f 100644 --- a/inst/service/backend/alpm.py +++ b/inst/service/backend/alpm.py @@ -54,11 +54,14 @@ def _update(handle): db.update(False) _db_sync = False -def _install(handle, t, repos, name): +def _install(handle, t, repos, weak_deps, name): ok, pkg = pycman.action_sync.find_sync_package(name, repos) t.add_pkg(pkg) + if weak_deps == True: + for optdep in pkg.optdepends: + t.add_pkg(optdep) -def _remove(handle, t, repos, name): +def _remove(handle, t, repos, weak_deps, name): pkg = handle.get_localdb().get_pkg(name) t.remove_pkg(pkg) @@ -82,13 +85,13 @@ def available(prefixes, exclusions): return pkgs -def operation(op, prefixes, pkgs, exclusions): +def operation(op, prefixes, pkgs, exclusions, weak_deps=None): handle = _get_handle() repos = dict((db.name, db) for db in handle.get_syncdbs()) t = handle.init_transaction() _update(handle) - fun = partial(op, handle, t, repos) + fun = partial(op, handle, t, repos, weak_deps) notavail = mark(fun, prefixes, pkgs, exclusions, trans="lower") try: @@ -100,8 +103,8 @@ def operation(op, prefixes, pkgs, exclusions): return notavail -def install(prefixes, pkgs, exclusions): - return operation(_install, prefixes, pkgs, exclusions) +def install(prefixes, pkgs, exclusions, weak_deps=None): + return operation(_install, prefixes, pkgs, exclusions, weak_deps) def remove(prefixes, pkgs, exclusions): return operation(_remove, prefixes, pkgs, exclusions)