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 E5DCC15801B for ; Tue, 22 Aug 2023 20:50:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D2ACC2BC088; Tue, 22 Aug 2023 20:50:39 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7B33B2BC088 for ; Tue, 22 Aug 2023 20:50:39 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 64E0134127F for ; Tue, 22 Aug 2023 20:50:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AE170FC9 for ; Tue, 22 Aug 2023 20:50:36 +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: <1692737395.6b17633d0d74cb8fa0eeb46c8ee4f4f05d0e38b2.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: 6b17633d0d74cb8fa0eeb46c8ee4f4f05d0e38b2 X-VCS-Branch: master Date: Tue, 22 Aug 2023 20:50:36 +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: 937111d9-8a71-4941-b55c-0b7b16e2da3e X-Archives-Hash: 309c3b31c588b9cde8747e025d41eeb9 commit: 6b17633d0d74cb8fa0eeb46c8ee4f4f05d0e38b2 Author: Sam James gentoo org> AuthorDate: Tue Aug 22 20:43:25 2023 +0000 Commit: Sam James gentoo org> CommitDate: Tue Aug 22 20:49:55 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=6b17633d eclean-pkg: add --clean-invalid to help, fix parsing * Rename --clean-invalids -> --clean-invalid * Add --clean-invalid to help * Make it default-off for now to match the option name (rather than the help saying --no-clean-invalids). (I could go either way on what the actual default should be, but this is more conservative for now.) * Fix typo in option name. * Make it a package specific arg, not a global one. Bug: https://bugs.gentoo.org/900224 Fixes: 204b1abca2c0cbbdad188c7fd4b84452c2f630a0 Fixes: a16d0d4fbfb4614832c4b682b41284a9050af29f Signed-off-by: Sam James gentoo.org> pym/gentoolkit/eclean/cli.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py index c8381a0..aa8b20f 100644 --- a/pym/gentoolkit/eclean/cli.py +++ b/pym/gentoolkit/eclean/cli.py @@ -261,6 +261,11 @@ def printUsage(_error=None, help=None, unresolved_invalids=None): + " - delete packages for which ebuild dependencies have changed", file=out, ) + print( + yellow(" --clean-invalid") + + " - cleanup invalid binpkgs", + file=out, + ) print( yellow(" -i, --ignore-failure") + " - ignore failure to locate PKGDIR", @@ -413,8 +418,8 @@ def parseArgs(options={}): options["ignore-failure"] = True elif o in ("-u", "--unique-use"): options["unique-use"] = True - elif o in ("-N", "--skip-invalids"): - options["clean-invalids"] = False + elif o in ("-N", "--skip-invalid"): + options["clean-invalid"] = False else: return_code = False # sanity check of --deep only options: @@ -435,7 +440,7 @@ def parseArgs(options={}): # here are the different allowed command line options (getopt args) getopt_options = {"short": {}, "long": {}} - getopt_options["short"]["global"] = "CdDipqe:t:nhVvN" + getopt_options["short"]["global"] = "CdDipqe:t:nhVv" getopt_options["long"]["global"] = [ "nocolor", "deep", @@ -450,14 +455,14 @@ def parseArgs(options={}): "help", "version", "verbose", - "clean-inavlids", ] getopt_options["short"]["distfiles"] = "fs:" getopt_options["long"]["distfiles"] = ["fetch-restricted", "size-limit="] - getopt_options["short"]["packages"] = "i" + getopt_options["short"]["packages"] = "iN" getopt_options["long"]["packages"] = [ "ignore-failure", "changed-deps", + "clean-invalid", "unique-use", ] # set default options, except 'nocolor', which is set in main() @@ -474,8 +479,8 @@ def parseArgs(options={}): options["verbose"] = False options["changed-deps"] = False options["ignore-failure"] = False + options["clean-invalid"] = False options["unique-use"] = False - options["clean-invalids"] = True # if called by a well-named symlink, set the action accordingly: action = None # temp print line to ensure it is the svn/branch code running, etc.. @@ -621,7 +626,7 @@ def doAction(action, options, exclude={}, output=None): output.set_colors("deprecated") output.list_pkgs(deprecated) if action in ["packages"]: - if invalids and options["clean-invalids"]: + if invalids and options["clean-invalid"]: if type(invalids) == list: printUsage(_error="invalid_paths", unresolved_invalids=invalids) sys.exit(1)