Summary: | "eclean-pkg -n -d" keeps binpkgs with no corresponding ebuild | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Marc Joliet <marcec> |
Component: | Tools | Assignee: | Portage Tools Team <tools-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | b4b1, esigra, marcec |
Priority: | Normal | Keywords: | InVCS, PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 346443 | ||
Attachments: |
modify eclean-pkg to also remove certain packages with no corresponding ebuild with the options "-d -n"
Make "eclean-pkg -d -n" also remove packages with no corresponding ebuild |
Description
Marc Joliet
2013-06-01 16:24:50 UTC
Created attachment 349848 [details, diff]
modify eclean-pkg to also remove certain packages with no corresponding ebuild with the options "-d -n"
Maybe it makes sense to add a new option for the behavior that you propose, since the --package-names description says that it protects _all_ versions. (In reply to Marc Joliet from comment #0) > - rather than put cp_all() into a dict (was this for performance maybe?) > simply take the list returned by cp_all(), therefor all occurrences of > cp_all are now lists rather than dicts A dict uses a hash table for __contains__, while a list uses sequential search. Therefore, a dict is much more efficient for our use case. (In reply to Zac Medico from comment #2) > Maybe it makes sense to add a new option for the behavior that you propose, > since the --package-names description says that it protects _all_ versions. That differs a bit from the man page, which says it protects *existing* versions (or perhaps I misunderstand "existing" in this case?). Also, if that is the intended behaviour, then I have to wonder why eclean-dist *does* clean distfiles of non-existing ebuilds, since the man page says "-d -n" avoids recompiling and *downloading*, so if a binpkg is supposed to be protected, I would think the same should hold for the corresponding distfile. Therefor it seems to me that eclean is inconsistent here. So if you think the additional option is the way to go, I think the behaviour of "--package-names" should still be modified. Personally, I'm not so sure about adding an option for this. The goal of the "-d -n" combination is to keep useful binpkgs/distfiles around without having $PKGDIR grow indefinitely (it's documented as being between "-d" and the default behaviour). But the way it works now for binpkgs, $PKGDIR *does* grow indefinitely for as long as you have a package installed and new versions come along. That's pretty bad for packages like wine, {libre,open}office and firefox. Maybe the exclusion file is enough to handle the case of wanting/needing to keep the binpkg of a removed package version around in case an upgrade goes awry? But then again, you don't want to give the user an unpleasant surprise by removing any hope of having a downgrade path (espcially if you run eclean in a cron job, like I do). > (In reply to Marc Joliet from comment #0) > > - rather than put cp_all() into a dict (was this for performance maybe?) > > simply take the list returned by cp_all(), therefor all occurrences of > > cp_all are now lists rather than dicts > > A dict uses a hash table for __contains__, while a list uses sequential > search. Therefore, a dict is much more efficient for our use case. Aha, I thought it might be something like that. Good to know! (In reply to Marc Joliet from comment #3) [...] > Maybe the exclusion file is enough to handle the case of wanting/needing to > keep the binpkg of a removed package version around in case an upgrade goes > awry? But then again, you don't want to give the user an unpleasant surprise > by removing any hope of having a downgrade path (espcially if you run eclean > in a cron job, like I do). Or for this particular use case maybe better: the --time-limit and --interactive options. Thanks for that. I've been at my daughters softball tournament this weekend. When I did the eclean re-write. I actually did very little to the binpkg code. It was already quite good and needed very little re-work to fit the new structure. It was the distfiles portion of the code that was a complicated mess to sort out. and took the majority of the work. I'll have a better look at it next week. I haven't looked at that code in awhile. Could be 4 more games in the semi & finals tomorrow if they keep winning to take first place :) Now that my emaint rewrite is in portage. I need to update eclean-pkg to use the api I created for it. (In reply to Brian Dolbec from comment #5) [...] > I'll have a better look at it next week. I haven't looked at that code in > awhile. [...] Have you had a chance to look into this yet? In the meantime I've decided to patch it locally via /etc/portage/env/. Created attachment 390650 [details, diff] Make "eclean-pkg -d -n" also remove packages with no corresponding ebuild I remembered about this bug semi-recently and decided to simplify the patch following comment #2. This version of the patch only extends the conditional as already discussed. Comments? (As with the original patch, I'm using this version on both of my systems.) The patch has been pushed to the gentoolkit repository: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=68283db9d0a775c334087a27601edf042987294c It will be included in the next release. This was released in gentoolkit-0.3.1 |