From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D2BBC15800A for ; Tue, 22 Aug 2023 20:35:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D31C02BC05B; Tue, 22 Aug 2023 20:35:13 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B356E2BC05B for ; Tue, 22 Aug 2023 20:35:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B4A31335CEF for ; Tue, 22 Aug 2023 20:35:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 54FCAFC9 for ; Tue, 22 Aug 2023 20:35:11 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1692736470.204b1abca2c0cbbdad188c7fd4b84452c2f630a0.sam@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/eclean/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/eclean/cli.py X-VCS-Directories: pym/gentoolkit/eclean/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 204b1abca2c0cbbdad188c7fd4b84452c2f630a0 X-VCS-Branch: master Date: Tue, 22 Aug 2023 20:35:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 884a2d30-09c7-43dc-b267-154ca89bb76f X-Archives-Hash: 44199fe73b702766b96f8657e822141e commit: 204b1abca2c0cbbdad188c7fd4b84452c2f630a0 Author: Siddhanth Rathod gmail com> AuthorDate: Tue Aug 22 13:55:48 2023 +0000 Commit: Sam James gentoo org> CommitDate: Tue Aug 22 20:34:30 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=204b1abc eclean-pkg: Limit invalid search to 'packages' action Bug: https://bugs.gentoo.org/900224 Fixes: a16d0d4fbfb4614832c4b682b41284a9050af29f Signed-off-by: Siddhanth Rathod gmail.com> Closes: https://github.com/gentoo/gentoolkit/pull/30 Signed-off-by: Sam James gentoo.org> pym/gentoolkit/eclean/cli.py | 46 +++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py index 40fc4f9..c8381a0 100644 --- a/pym/gentoolkit/eclean/cli.py +++ b/pym/gentoolkit/eclean/cli.py @@ -435,7 +435,7 @@ def parseArgs(options={}): # here are the different allowed command line options (getopt args) getopt_options = {"short": {}, "long": {}} - getopt_options["short"]["global"] = "CdDipqe:t:nhVv" + getopt_options["short"]["global"] = "CdDipqe:t:nhVvN" getopt_options["long"]["global"] = [ "nocolor", "deep", @@ -450,6 +450,7 @@ def parseArgs(options={}): "help", "version", "verbose", + "clean-inavlids", ] getopt_options["short"]["distfiles"] = "fs:" getopt_options["long"]["distfiles"] = ["fetch-restricted", "size-limit="] @@ -619,28 +620,29 @@ def doAction(action, options, exclude={}, output=None): ) output.set_colors("deprecated") output.list_pkgs(deprecated) - if invalids and options["clean-invalids"]: - if type(invalids) == list: - printUsage(_error="invalid_paths", unresolved_invalids=invalids) - sys.exit(1) - verb = "were" - if options["pretend"]: - verb = "would be" - if not options["quiet"]: - print() - print( - ( - pp.emph(" The following ") - + red("invalid") - + pp.emph(" binpkgs were found") + if action in ["packages"]: + if invalids and options["clean-invalids"]: + if type(invalids) == list: + printUsage(_error="invalid_paths", unresolved_invalids=invalids) + sys.exit(1) + verb = "were" + if options["pretend"]: + verb = "would be" + if not options["quiet"]: + print() + print( + ( + pp.emph(" The following ") + + red("invalid") + + pp.emph(" binpkgs were found") + ) ) - ) - output.set_colors("invalid") - output.list_pkgs(invalids) - clean_size = cleaner.clean_pkgs(invalids, pkgdir) - output.total("invalid", clean_size, len(invalids), verb, action) - else: - cleaner.clean_pkgs(invalids, pkgdir) + output.set_colors("invalid") + output.list_pkgs(invalids) + clean_size = cleaner.clean_pkgs(invalids, pkgdir) + output.total("invalid", clean_size, len(invalids), verb, action) + else: + cleaner.clean_pkgs(invalids, pkgdir) def main():