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.
(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?)
+// 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?
This should also update the tooltip for the view dropdown
(IDS_VIEWBUTTON_TOOLTIP) to describe the new view.