diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-12-02 10:30:25 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-12-02 10:30:25 -0800 |
commit | 0ac299616c5cb22befdd9fcd4091d80ca889ef19 (patch) | |
tree | b46a0c4c45286a40dfa943073fce8f517f7df33d | |
parent | c6c71eefb9532af0d4505de70e58f45ad8e8fe0a (diff) | |
download | portage-0ac299616c5cb22befdd9fcd4091d80ca889ef19.tar.gz portage-0ac299616c5cb22befdd9fcd4091d80ca889ef19.tar.bz2 portage-0ac299616c5cb22befdd9fcd4091d80ca889ef19.zip |
action_depclean: fix return code
The fixes some cases where emerge.log would show that depclean was
unsuccessful when it was really successful but there was nothing to
remove.
-rw-r--r-- | pym/_emerge/actions.py | 13 | ||||
-rw-r--r-- | pym/_emerge/unmerge.py | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index ba2e631f2..a62b30510 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -588,15 +588,18 @@ def action_depclean(settings, trees, ldpath_mtimes, return rval if cleanlist: - unmerge(root_config, myopts, "unmerge", + if unmerge(root_config, myopts, "unmerge", cleanlist, ldpath_mtimes, ordered=ordered, - scheduler=scheduler) + scheduler=scheduler): + rval = os.EX_OK + else: + rval = 1 if action == "prune": - return + return rval if not cleanlist and "--quiet" in myopts: - return + return rval print("Packages installed: " + str(len(vardb.cpv_all()))) print("Packages in world: " + \ @@ -609,6 +612,8 @@ def action_depclean(settings, trees, ldpath_mtimes, else: print("Number removed: "+str(len(cleanlist))) + return rval + def calc_depclean(settings, trees, ldpath_mtimes, myopts, action, args_set, spinner): allow_missing_deps = bool(args_set) diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index 852ad936a..c76afdf73 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -526,7 +526,7 @@ def unmerge(root_config, myopts, unmerge_action, if "--pretend" in myopts: #we're done... return - return 0 + return 1 if "--ask" in myopts: if userquery("Would you like to unmerge these packages?", enter_invalid) == "No": |