On 15/08/2022 14:04, Christian Franke wrote:
Jon Turney wrote:
On 02/08/2022 13:17, Christian Franke wrote:
In long standing cygwin installations, many no longer needed
automatically installed packages (e.g. libicuNN) accumulate. This
patch adds a new view which is possibly helpful to cleanup packages
manually.
Some possible later enhancements:
- automatically refresh this view (a few seconds) after the user
changed a package status as this may add or remove entries.
- add a keyboard shortcut (^U) to the list view for "Uninstall this
package and then select next package"
Thanks. This looks good.
I think perhaps a better approach would be a view showing all packages
which aren't user_picked, or a dependency of a user_picked package.
This would drop the ability to easily clean up user_picked packages
without later conflicts. The attached new patch splits this into two
views "Removable" (not "Uninstallable" due to possible ambiguity with
"cannot be installed") and "Unneeded" (or "Stale" ?).
(If I've read the code correctly your implementation has the weakness
that if e.g. appA -> libbB -> libC, which is then changed to appA ->
libD -> libE, it will only show libC as unneeded, then libB on the
next run?)
I'm not sure for this case. It may be correct again after the view is
refreshed during the same run. In general, this ad-hoc algorithm does
not handle all corner cases. It should be sufficient if installation
cleanup is done in a separate run.
Thanks. I applied this.
I'm not sure these are the perfect filters, but they are a lot better
than the nothing we have at the moment :)
Some time ago, I thought about replacing the "view"s list with a
drop-down menu which would let you choose how to filter and show the
package list, but I don't think I got around to writing anything...
e.g
---
[x] Installed
[✓] Changed
[ ] Picked
[ ] Needed
---
[✓] Category
[ ] List
---
(I think the filter menu items would need to be tri-stateable so they
can represent "true", "false" and "don't care", so this might be complex
to implement...)
Later: actually it looks like I started writing some of this [1], but
didn't get very far...
[1]
https://github.com/jon-turney/cygwin-setup/tree/split-view-filter-and-style
+// Scan installed or desired packages and collect the names of packages
+// which provide the dependencies of other packages or are member of
+// category "Base".
+static void FindNeededPackages (const packagedb & db,
std::set<std::string> & needed)
+{
+ std::map<std::string, std::string> providedBy;
+ for (const auto & p : db.packages)
+ {
+ const packagemeta & pkg = *p.second;
+ if (!pkg.isBinary ())
+ continue;
+ if (!(pkg.desired && (pkg.installed || pkg.picked ())))
+ continue;
This seems redundant. Why can't this be just !pkg.desired?
Yes, fixed. I originally wanted to handle the "install source package
without the binary" case here. During development of "Ctrl+I/R/U" patch,
I learned that this could not happen.
This should also update the tooltip for the view dropdown
(IDS_VIEWBUTTON_TOOLTIP) to describe the new view.
Done.