Skip to content

Commit

Permalink
eclean: dist: make VCS cleaning dependent on --deep
Browse files Browse the repository at this point in the history
The man page clearly says that without --deep, users can expect eclean-dist
to be conservative in cleaning up, and not consider the VDB, just the repo
state.

Honour that promise by making VCS cleaning dependent on --deep, given it
involves VDB inspection to see what's installed.

Bug: https://bugs.gentoo.org/923369
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed May 3, 2024
1 parent 2e5933f commit ada43fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions man/eclean.1
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ etc.
Units are: G, M, K and B.
.TP
\fB\-\-skip\-vcs\fP protect VCS sources for live ebuilds not installed
Only effective with \-\-deep. Without \-\-deep, no VCS cleaning is done.
.SS "Options for the 'packages' action"
.TP
\fB\-i, \-\-ignore\-failure\fP ignore the failure to locate PKGDIR
Expand Down
6 changes: 3 additions & 3 deletions pym/gentoolkit/eclean/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def optionSwitch(option, opts, action=None):
options["unique-use"] = True
elif o in ("--no-clean-invalid"):
options["no-clean-invalid"] = True
elif o in ("--skip-vcs"):
elif o in ("--skip-vcs") or not options["destructive"]:
options["skip-vcs"] = True
else:
return_code = False
Expand Down Expand Up @@ -602,11 +602,11 @@ def doAction(action, options, exclude={}, output=None):
output.einfo("Cleaning " + files_type + "...")
# do the cleanup, and get size of deleted files
if options["pretend"]:
if options["skip-vcs"]:
if options["skip-vcs"] or not options["destructive"]:
vcs = {}
clean_size = cleaner.pretend_clean(clean_me, vcs)
elif action in ["distfiles"]:
if options["skip-vcs"]:
if options["skip-vcs"] or not options["destructive"]:
vcs = {}
clean_size = cleaner.clean_dist(clean_me, vcs)
elif action in ["packages"]:
Expand Down

0 comments on commit ada43fc

Please sign in to comment.