public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: Christian Franke <Christian.Franke@t-online.de>,
	"cygwin-apps@cygwin.com" <cygwin-apps@cygwin.com>
Subject: Re: [PATCH setup] Add view mode "Unneeded"
Date: Tue, 16 Aug 2022 20:57:54 +0100	[thread overview]
Message-ID: <8df4d779-456d-4547-71b1-5211f84bfd4d@dronecode.org.uk> (raw)
In-Reply-To: <c589a9e6-c200-b7d5-7f54-f4322b6f1add@t-online.de>

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.

      reply	other threads:[~2022-08-16 19:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 12:17 Christian Franke
2022-08-14 13:55 ` Jon Turney
2022-08-15 13:04   ` Christian Franke
2022-08-16 19:57     ` Jon Turney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8df4d779-456d-4547-71b1-5211f84bfd4d@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=Christian.Franke@t-online.de \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).