From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-046.btinternet.com (mailomta19-sa.btinternet.com [213.120.69.25]) by sourceware.org (Postfix) with ESMTPS id 2A9A53858CDA for ; Tue, 16 Aug 2022 19:57:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A9A53858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from sa-prd-rgout-001.btmx-prd.synchronoss.net ([10.2.38.4]) by sa-prd-fep-046.btinternet.com with ESMTP id <20220816195754.VUWH3113.sa-prd-fep-046.btinternet.com@sa-prd-rgout-001.btmx-prd.synchronoss.net>; Tue, 16 Aug 2022 20:57:54 +0100 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 62E573CC030DDA5B X-Originating-IP: [81.153.98.171] X-OWM-Source-IP: 81.153.98.171 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehgedgudeffecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepfeevgffghfdtvdetvddvfeduhedukeettdekveeflefgkeekieefgfehhfffudetnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepkedurdduheefrdelkedrudejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddthegnpdhinhgvthepkedurdduheefrdelkedrudejuddpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepvehhrhhishhtihgrnhdrhfhrrghnkhgvsehtqdhonhhlihhnvgdruggvpdhrtghpthhtoheptgihghifihhnqdgrphhpshestgihghifihhnrdgtohhm X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.105] (81.153.98.171) by sa-prd-rgout-001.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 62E573CC030DDA5B; Tue, 16 Aug 2022 20:57:54 +0100 Message-ID: <8df4d779-456d-4547-71b1-5211f84bfd4d@dronecode.org.uk> Date: Tue, 16 Aug 2022 20:57:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH setup] Add view mode "Unneeded" Content-Language: en-GB To: Christian Franke , "cygwin-apps@cygwin.com" References: <68d66187-7b70-9fb0-fd12-e1dca7e08399@t-online.de> <7ac0957d-b881-d276-733d-3b3736dab14b@dronecode.org.uk> From: Jon Turney In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3568.9 required=5.0 tests=BAYES_00, BODY_8BITS, FORGED_SPF_HELO, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2022 19:57:59 -0000 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 & needed) >>> +{ >>> +  std::map 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.