From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-043.btinternet.com (mailomta5-sa.btinternet.com [213.120.69.11]) by sourceware.org (Postfix) with ESMTPS id 7394E3858D1E for ; Sun, 14 Aug 2022 13:55:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7394E3858D1E 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-005.btmx-prd.synchronoss.net ([10.2.38.8]) by sa-prd-fep-043.btinternet.com with ESMTP id <20220814135555.ELMI3164.sa-prd-fep-043.btinternet.com@sa-prd-rgout-005.btmx-prd.synchronoss.net>; Sun, 14 Aug 2022 14:55:55 +0100 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 6139452E356ACBE0 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: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehtddgjedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfhuffvfhgjtgfgsehtjeertddtfeejnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeegteejueevgeehffdukeegffduhffhteffheehjedvfeefgfekffelgfdtteelgeenucfkphepkedurdduheefrdelkedrudejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddthegnpdhinhgvthepkedurdduheefrdelkedrudejuddpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepvehhrhhishhtihgrnhdrhfhrrghnkhgvsehtqdhonhhlihhnvgdruggvpdhrtghpthhtoheptgihghifihhnqdgrphhpshestgihghifihhnrdgtohhm 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-005.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 6139452E356ACBE0; Sun, 14 Aug 2022 14:55:55 +0100 Message-ID: <7ac0957d-b881-d276-733d-3b3736dab14b@dronecode.org.uk> Date: Sun, 14 Aug 2022 14:55:53 +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 From: Jon Turney Subject: Re: [PATCH setup] Add view mode "Unneeded" To: Christian Franke , "cygwin-apps@cygwin.com" References: <68d66187-7b70-9fb0-fd12-e1dca7e08399@t-online.de> Content-Language: en-GB In-Reply-To: <68d66187-7b70-9fb0-fd12-e1dca7e08399@t-online.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1192.0 required=5.0 tests=BAYES_00, 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: Sun, 14 Aug 2022 13:56:00 -0000 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 & 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? This should also update the tooltip for the view dropdown (IDS_VIEWBUTTON_TOOLTIP) to describe the new view.