Skip to content

Commit 0670482

Browse files
committed
eclean-pkg: add --unreachable to enable all --changed-* options
The set of reasons a binary package can no longer be a Portage cache hit keeps growing (--changed-deps, --changed-subslot, --changed-iuse), and users generally just want all of them cleaned. Add --unreachable as a convenience that enables every --changed-* option at once, so new reasons are picked up automatically without users having to learn each flag. Closes: https://bugs.gentoo.org/977235 Signed-off-by: Matt Turner <mattst88@gentoo.org>
1 parent e46cf1d commit 0670482

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

man/eclean.1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ This is only useful when scripting to ignore an otherwise fatal error.
119119
\fB\-\-changed\-iuse\fP delete packages whose IUSE no longer matches the ebuild
120120
This is useful when, for instance, PYTHON_COMPAT changes and adds a new
121121
python_targets_* flag: the old binary package can never be a cache hit again.
122+
.TP
123+
\fB\-\-unreachable\fP delete packages that can no longer be a Portage cache hit
124+
This enables all of the \-\-changed\-* options at once, so any binary package
125+
that Portage can no longer reuse is removed regardless of why.
122126
.SH "EXCLUSION FILES"
123127
Exclusions files are lists of packages names or categories you want to protect
124128
in particular. This may be useful to protect more binary packages for some system

pym/gentoolkit/eclean/cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,12 @@ def printUsage(_error=None, help=None, unresolved_invalids=None):
271271
+ " - delete packages whose IUSE no longer matches the ebuild",
272272
file=out,
273273
)
274+
print(
275+
yellow(" --unreachable")
276+
+ " - delete packages that can no longer be a cache hit"
277+
+ " (enables all --changed-* options)",
278+
file=out,
279+
)
274280
print(
275281
yellow(" --no-clean-invalid")
276282
+ " - Skip cleaning invalid binpkgs",
@@ -432,6 +438,10 @@ def optionSwitch(option, opts, action=None):
432438
options["changed-subslot"] = True
433439
elif o in ("--changed-iuse"):
434440
options["changed-iuse"] = True
441+
elif o in ("--unreachable"):
442+
options["changed-deps"] = True
443+
options["changed-subslot"] = True
444+
options["changed-iuse"] = True
435445
elif o in ("-i", "--ignore-failure"):
436446
options["ignore-failure"] = True
437447
elif o in ("-u", "--unique-use"):
@@ -488,6 +498,7 @@ def optionSwitch(option, opts, action=None):
488498
"changed-deps",
489499
"changed-subslot",
490500
"changed-iuse",
501+
"unreachable",
491502
"unique-use",
492503
"no-clean-invalid",
493504
]

0 commit comments

Comments
 (0)