From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F1DE71392EF for ; Tue, 11 Mar 2014 04:53:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86CE4E0956; Tue, 11 Mar 2014 04:53:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 09E4EE0956 for ; Tue, 11 Mar 2014 04:53:58 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 42EF833FBBD for ; Tue, 11 Mar 2014 04:53:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 65E71188EA for ; Tue, 11 Mar 2014 04:53:54 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1394513201.6f1994cabd7a3fe37ccb50d2036ebed5748bcf32.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qlist.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 6f1994cabd7a3fe37ccb50d2036ebed5748bcf32 X-VCS-Branch: master Date: Tue, 11 Mar 2014 04:53:54 +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-Archives-Salt: 243ddb81-f6fc-44de-81ca-29507785a361 X-Archives-Hash: b2437707d9c0ca3d325c0fe521ce771c commit: 6f1994cabd7a3fe37ccb50d2036ebed5748bcf32 Author: Mike Frysinger gentoo org> AuthorDate: Tue Mar 11 04:46:41 2014 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Mar 11 04:46:41 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=6f1994ca qlist: punt --dups option I'm not sure anyone really uses this option anymore now that packages are actively using multiple SLOTs in the tree. The code is also pretty ugly, so it'd be nice if we didn't have to maintain it. --- qlist.c | 70 ++--------------------------------------------------------------- 1 file changed, 2 insertions(+), 68 deletions(-) diff --git a/qlist.c b/qlist.c index be5893d..0b0714e 100644 --- a/qlist.c +++ b/qlist.c @@ -16,7 +16,6 @@ static struct option const qlist_long_opts[] = { {"repo", no_argument, NULL, 'R'}, {"umap", no_argument, NULL, 'U'}, {"columns", no_argument, NULL, 'c'}, - {"dups", no_argument, NULL, 'D'}, {"showdebug", no_argument, NULL, 128}, {"exact", no_argument, NULL, 'e'}, {"all", no_argument, NULL, 'a'}, @@ -32,7 +31,6 @@ static const char * const qlist_opts_help[] = { "Display installed packages with repository", "Display installed packages with flags used", "Display column view", - "Only show package dups", "Show /usr/lib/debug files", "Exact match (only CAT/PN or PN without PV)", "Show every installed package", @@ -44,25 +42,6 @@ static const char * const qlist_opts_help[] = { }; #define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, qlist_opts_help, lookup_applet_idx("qlist")) -_q_static queue *filter_dups(queue *sets) -{ - queue *ll = NULL; - queue *dups = NULL; - queue *list = NULL; - - for (list = sets; list != NULL; list = list->next) { - for (ll = sets; ll != NULL; ll = ll->next) { - if ((strcmp(ll->name, list->name) == 0) && (strcmp(ll->item, list->item) != 0)) { - int ok = 0; - dups = del_set(ll->item, dups, &ok); - ok = 0; - dups = add_set(ll->item, ll->item, dups); - } - } - } - return dups; -} - static char *grab_pkg_umap(const char *CAT, const char *PV) { static char umap[BUFSIZ]; @@ -276,7 +255,6 @@ struct qlist_opt_state { bool exact; bool all; bool just_pkgname; - bool dups_only; bool show_dir; bool show_obj; bool show_repo; @@ -307,15 +285,6 @@ _q_static int qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv) if (state->just_pkgname) { depend_atom *atom; - if (state->dups_only) { - char swap[_Q_PATH_MAX]; - atom = atom_explode(pkgname); - snprintf(state->buf, state->buflen, "%s/%s", catname, atom->P); - snprintf(swap, sizeof(swap), "%s/%s", catname, atom->PN); - state->sets = add_set(swap, state->buf, state->sets); - atom_implode(atom); - return 0; - } atom = (verbose ? NULL : atom_explode(pkgname)); if ((state->all + state->just_pkgname) < 2) { if (state->show_slots && !pkg_ctx->slot) @@ -389,7 +358,6 @@ int qlist_main(int argc, char **argv) .exact = false, .all = false, .just_pkgname = false, - .dups_only = false, .show_dir = false, .show_obj = false, .show_repo = false, @@ -419,12 +387,12 @@ int qlist_main(int argc, char **argv) case 128: state.show_dbg = true; break; case 'o': state.show_obj = true; break; case 's': state.show_sym = true; break; - case 'D': state.dups_only = state.exact = state.just_pkgname = true; break; case 'c': state.columns = true; break; case 'f': break; } } - if (state.columns) verbose = 0; /* if not set to zero; atom wont be exploded; segv */ + if (state.columns) + verbose = 0; /* if not set to zero; atom wont be exploded; segv */ /* default to showing syms and objs */ if (!state.show_dir && !state.show_obj && !state.show_sym) state.show_obj = state.show_sym = true; @@ -434,40 +402,6 @@ int qlist_main(int argc, char **argv) state.buf = xmalloc(state.buflen); state.atoms = xcalloc(argc - optind, sizeof(*state.atoms)); ret = q_vdb_foreach_pkg_sorted(qlist_cb, &state); - - if (state.dups_only) { - char last[126]; - depend_atom *atom; - queue *ll, *dups = filter_dups(state.sets); - last[0] = 0; - - for (ll = dups; ll != NULL; ll = ll->next) { - int ok = 1; - atom = atom_explode(ll->item); - if (strcmp(last, atom->PN) == 0) - if (!verbose) - ok = 0; - strncpy(last, atom->PN, sizeof(last)); - if (ok) { - char *slot = NULL; - char *repo = NULL; - if (state.show_slots) - slot = grab_vdb_item("SLOT", atom->CATEGORY, atom->P); - if (state.show_repo) - repo = grab_vdb_item("repository", atom->CATEGORY, atom->P); - printf("%s%s/%s%s%s%s%s%s%s%s%s%s%s%s%s", BOLD, atom->CATEGORY, BLUE, - (!state.columns ? (verbose ? atom->P : atom->PN) : atom->PN), - (state.columns ? " " : ""), (state.columns ? atom->PV : ""), - NORM, YELLOW, slot ? ":" : "", slot ? slot : "", - NORM, GREEN, repo ? "::" : "", repo ? repo : "", NORM); - puts(umapstr(state.show_umap, atom->CATEGORY, atom->P)); - } - atom_implode(atom); - } - free_sets(dups); - free_sets(state.sets); - } - free(state.buf); free(state.atoms);