commit: b7e35beaa4168b315ad3ae294b71706d24c795b0
Author: John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 16 03:45:14 2023 +0000
Commit: John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Fri Dec 15 18:30:59 2023 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b7e35bea
depclean: return failure when no packages are selected for depclean
Based on the preceding writemsg, one might think that this function
could be used for more than depcleans, but there's no other reference
to it in the codebase.
With this patch:
$ sudo ./bin/emerge --debug --verbose --depclean foo; echo $?
myaction depclean
myopts {'--debug': True, '--binpkg-respect-use': 'y', '--quiet-build': 'y',
'--regex-search-auto': 'y', '--verbose': True}
[DEBUG] Using selector: EpollSelector
Signed-off-by: John Helmert III <ajak <AT> gentoo.org>
NEWS | 6 ++++++
lib/_emerge/actions.py | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index 250b4399f2..e1e47d0a2e 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,12 @@ Release notes take the form of the following optional
categories:
* Bug fixes
* Cleanups
+portage-3.0.59 (UNRELEASED)
+
+Features:
+* emerge: depclean now returns with failure if no packages are matched
+ (bug #917120)
+
portage-3.0.58 (2023-12-14)
--------------
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index ae8796531e..86ba7f77a5 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -843,7 +843,7 @@ def action_depclean(
)
if not matched_packages:
writemsg_level(f">>> No packages selected for removal by
{action}\n")
- return 0
+ return 1
# The calculation is done in a separate function so that depgraph
# references go out of scope and the corresponding memory