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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8823C138334 for ; Fri, 12 Apr 2019 18:50:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3B692E08D1; Fri, 12 Apr 2019 18:50:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 02921E08D1 for ; Fri, 12 Apr 2019 18:50:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 474CA340E9F for ; Fri, 12 Apr 2019 18:50:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3F326566 for ; Fri, 12 Apr 2019 18:50:42 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1555094897.26397171ecf098661502d86f9c6cde45ec70d180.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: man/include/, /, man/ X-VCS-Repository: proj/portage-utils X-VCS-Files: man/include/qlist.optdesc.yaml man/qlist.1 qlist.c X-VCS-Directories: / man/ man/include/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 26397171ecf098661502d86f9c6cde45ec70d180 X-VCS-Branch: master Date: Fri, 12 Apr 2019 18:50:42 +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: 4f7e219d-ccd1-4e4c-8288-edcf66ed4107 X-Archives-Hash: 099bb211d7293383fe6782651038d167 commit: 26397171ecf098661502d86f9c6cde45ec70d180 Author: Fabian Groffen gentoo org> AuthorDate: Fri Apr 12 18:48:17 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri Apr 12 18:48:17 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=26397171 qlist: change behaviour to use colours and no parenthesis - in list mode, show colours by default (can be disabled in the normal way using -C) - in USE-flag mode, don't output ( ) so the output is compatible with e.g. package.use Signed-off-by: Fabian Groffen gentoo.org> man/include/qlist.optdesc.yaml | 9 +++------ man/qlist.1 | 11 +++++------ qlist.c | 31 ++++++++++++++++--------------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/man/include/qlist.optdesc.yaml b/man/include/qlist.optdesc.yaml index 2b9299c..5fff904 100644 --- a/man/include/qlist.optdesc.yaml +++ b/man/include/qlist.optdesc.yaml @@ -16,9 +16,6 @@ columns: | space-separated columns. verbose: | When used with \fB\-I\fR, print the package version next to name. - When listing the package contents, a single \fB\-v\fR displays - symlinks with an arrow (\->) to their target. Two or more \fB\-v\fR - adds colour to the entries and prints like \fB\-I\fR before the - listing. Shows disabled USE-flags when used with \fB\-U\fR. -quiet: | - Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR. + When listing the package contents, \fB\-v\fR displays symlinks with + an arrow (\->) to their target. Shows disabled USE-flags when used + with \fB\-U\fR. diff --git a/man/qlist.1 b/man/qlist.1 index 4df7dab..0b16318 100644 --- a/man/qlist.1 +++ b/man/qlist.1 @@ -1,5 +1,5 @@ .\" generated by mkman.py, please do NOT edit! -.TH qlist "1" "Mar 2019" "Gentoo Foundation" "qlist" +.TH qlist "1" "Apr 2019" "Gentoo Foundation" "qlist" .SH NAME qlist \- list files owned by pkgname .SH SYNOPSIS @@ -57,13 +57,12 @@ Set the ROOT env var. .TP \fB\-v\fR, \fB\-\-verbose\fR When used with \fB\-I\fR, print the package version next to name. -When listing the package contents, a single \fB\-v\fR displays -symlinks with an arrow (\->) to their target. Two or more \fB\-v\fR -adds colour to the entries and prints like \fB\-I\fR before the -listing. Shows disabled USE-flags when used with \fB\-U\fR. +When listing the package contents, \fB\-v\fR displays symlinks with +an arrow (\->) to their target. Shows disabled USE-flags when used +with \fB\-U\fR. .TP \fB\-q\fR, \fB\-\-quiet\fR -Suppresses the parenthesis around the USE-flags when used with \fB\-U\fR. +Tighter output; suppress warnings. .TP \fB\-C\fR, \fB\-\-nocolor\fR Don't output color. diff --git a/qlist.c b/qlist.c index d46e0a6..313ff56 100644 --- a/qlist.c +++ b/qlist.c @@ -88,11 +88,11 @@ cmpstringp(const void *p1, const void *p2) * -redis -sasl (-selinux) -sqlite -srs -syslog" 0 KiB * * % qlist -IUv exim - * mail-mta/exim-4.92 (-arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc + * mail-mta/exim-4.92 -arc -dane -dcc dkim -dlfunc dmarc dnsdb -doc * -dovecot-sasl -dsn exiscan-acl -gnutls -idn ipv6 -ldap -libressl lmtp * maildir -mbx -mysql -nis pam -perl -pkcs11 -postgres prdr -proxy * -radius -redis -sasl -selinux spf -sqlite -srs ssl -syslog tcpd tpda - * -X) + * -X */ static char _umapstr_buf[BUFSIZ]; static const char * @@ -134,8 +134,7 @@ umapstr(char display, q_vdb_pkg_ctx *pkg_ctx) #define add_to_buf(fmt, Cb, use, Ce) \ bufp += snprintf(bufp, sizeof(_umapstr_buf) - (bufp - _umapstr_buf), \ - " %s%s" fmt "%s", \ - bufp == _umapstr_buf && !quiet ? "(" : "", Cb, use, Ce); + " %s" fmt "%s", Cb, use, Ce); /* merge join, ensure inputs are sorted (Portage does this, but just * to be sure) */ @@ -163,9 +162,6 @@ umapstr(char display, q_vdb_pkg_ctx *pkg_ctx) } } - bufp += snprintf(bufp, sizeof(_umapstr_buf) - (bufp - _umapstr_buf), - "%s", bufp == _umapstr_buf || quiet ? "" : ")"); - freeargv(iuse_argc, iuse_argv); freeargv(use_argc, use_argv); free(iuse); @@ -352,7 +348,8 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv) /* see if this cat/pkg is requested */ for (i = optind; i < state->argc; ++i) - if (qlist_match(pkg_ctx, state->argv[i], &state->atoms[i - optind], state->exact)) + if (qlist_match(pkg_ctx, state->argv[i], + &state->atoms[i - optind], state->exact)) break; if ((i == state->argc) && (state->argc != optind)) return 0; @@ -362,7 +359,8 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv) atom = (verbose ? NULL : atom_explode(pkgname)); if ((state->all + state->just_pkgname) < 2) { if (state->show_slots && !pkg_ctx->slot) { - q_vdb_pkg_eat(pkg_ctx, "SLOT", &pkg_ctx->slot, &pkg_ctx->slot_len); + q_vdb_pkg_eat(pkg_ctx, "SLOT", + &pkg_ctx->slot, &pkg_ctx->slot_len); /* chop off the subslot if desired */ if (state->show_slots == 1) { char *s = strchr(pkg_ctx->slot, '/'); @@ -396,8 +394,9 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv) return 1; } - if (verbose > 1) - printf("%s%s/%s%s%s\n%sCONTENTS%s:\n", BOLD, catname, BLUE, pkgname, NORM, DKBLUE, NORM); + if (verbose) + printf("%s%s/%s%s%s %sCONTENTS%s:\n", + BOLD, catname, BLUE, pkgname, NORM, DKBLUE, NORM); fp = q_vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS"); if (fp == NULL) @@ -420,18 +419,20 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv) switch (e->type) { case CONTENTS_DIR: if (state->show_dir) - printf("%s%s%s/\n", verbose > 1 ? YELLOW : "" , e->name, verbose > 1 ? NORM : ""); + printf("%s%s%s/\n", YELLOW, e->name, NORM); break; case CONTENTS_OBJ: if (state->show_obj) - printf("%s%s%s\n", verbose > 1 ? WHITE : "" , e->name, verbose > 1 ? NORM : ""); + printf("%s%s%s\n", WHITE, e->name, NORM); break; case CONTENTS_SYM: if (state->show_sym) { if (verbose) - printf("%s%s -> %s%s\n", verbose > 1 ? CYAN : "", e->name, e->sym_target, NORM); + printf("%s%s%s -> %s%s%s\n", + CYAN, e->name, NORM, + CYAN, e->sym_target, NORM); else - printf("%s\n", e->name); + printf("%s%s%s\n", CYAN, e->name, NORM); } break; }