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 C9AF71391EE for ; Sat, 8 Mar 2014 05:51:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 188D6E0B14; Sat, 8 Mar 2014 05:51:22 +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 0509DE0B13 for ; Sat, 8 Mar 2014 05:51:20 +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 E8C6D33FBEA for ; Sat, 8 Mar 2014 05:51:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 74897188EA for ; Sat, 8 Mar 2014 05:51:17 +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: <1392708373.e2af8a0e5a7d0e055e3007dd750d5754d952a71d.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: /, libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/virtuals.c main.c qdepends.c qmerge.c X-VCS-Directories: / libq/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: e2af8a0e5a7d0e055e3007dd750d5754d952a71d X-VCS-Branch: master Date: Sat, 8 Mar 2014 05:51:17 +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: 8ea24697-de82-457e-9fa1-789b7de05f24 X-Archives-Hash: a80559eac9fc59d3af10761d4fab1970 commit: e2af8a0e5a7d0e055e3007dd750d5754d952a71d Author: Mike Frysinger gentoo org> AuthorDate: Tue Feb 18 07:26:13 2014 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Feb 18 07:26:13 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=e2af8a0e drop support for old style virtuals as the tree has not carried them in a long time --- libq/virtuals.c | 128 +------------------------------------------------------- main.c | 3 +- qdepends.c | 12 +----- qmerge.c | 21 ++-------- 4 files changed, 9 insertions(+), 155 deletions(-) diff --git a/libq/virtuals.c b/libq/virtuals.c index 39df3b5..d4f4ae7 100644 --- a/libq/virtuals.c +++ b/libq/virtuals.c @@ -1,12 +1,12 @@ /* * Copyright 2005-2010 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/virtuals.c,v 1.27 2011/12/18 20:41:54 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/virtuals.c,v 1.28 2014/02/18 07:26:13 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2010 Mike Frysinger - * - * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/virtuals.c,v 1.27 2011/12/18 20:41:54 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/virtuals.c,v 1.28 2014/02/18 07:26:13 vapier Exp $ */ #include @@ -23,14 +23,9 @@ struct queue_t { typedef struct queue_t queue; -/* global */ -queue *virtuals = NULL; - queue *del_set(char *s, queue *q, int *ok); queue *add_set(const char *vv, const char *ss, queue *q); -/* void free_virtuals(queue *list); */ - static queue *append_set(queue *q, queue *ll) { queue *z; @@ -156,122 +151,3 @@ void print_sets(queue *list) for (ll = list; ll != NULL; ll = ll->next) printf("%s -> %s\n", ll->name, ll->item); } - -queue *resolve_vdb_virtuals(char *vdb); -queue *resolve_vdb_virtuals(char *vdb) -{ - DIR *dir, *dirp; - struct dirent *dentry_cat, *dentry_pkg; - char buf[_Q_PATH_MAX]; - depend_atom *atom; - - xchdir("/"); - - /* now try to run through vdb and locate matches for user inputs */ - if ((dir = opendir(vdb)) == NULL) - return virtuals; - - /* scan all the categories */ - while ((dentry_cat = q_vdb_get_next_dir(dir)) != NULL) { - snprintf(buf, sizeof(buf), "%s/%s", vdb, dentry_cat->d_name); - if ((dirp = opendir(buf)) == NULL) - continue; - - /* scan all the packages in this category */ - while ((dentry_pkg = q_vdb_get_next_dir(dirp)) != NULL) { - char *p; - /* see if user wants any of these packages */ - snprintf(buf, sizeof(buf), "%s/%s/%s/PROVIDE", vdb, dentry_cat->d_name, dentry_pkg->d_name); - - if (!eat_file(buf, buf, sizeof(buf))) - continue; - - if ((p = strrchr(buf, '\n')) != NULL) - *p = 0; - - rmspace(buf); - - if (*buf) { - int ok = 0; - char *v, *tmp = xstrdup(buf); - snprintf(buf, sizeof(buf), "%s/%s", dentry_cat->d_name, dentry_pkg->d_name); - - atom = atom_explode(buf); - if (!atom) { - warn("could not explode '%s'", buf); - continue; - } - sprintf(buf, "%s/%s", atom->CATEGORY, atom->PN); - if ((v = virtual(tmp, virtuals)) != NULL) { - /* IF_DEBUG(fprintf(stderr, "%s provided by %s (removing)\n", tmp, v)); */ - virtuals = del_set(tmp, virtuals, &ok); - } - virtuals = add_set(tmp, buf, virtuals); - /* IF_DEBUG(fprintf(stderr, "%s provided by %s/%s (adding)\n", tmp, atom->CATEGORY, dentry_pkg->d_name)); */ - free(tmp); - atom_implode(atom); - } - } - } - - return virtuals; -} - -static queue *resolve_local_profile_virtuals(void) -{ - static size_t buflen; - static char *buf = NULL; - FILE *fp; - char *p; - static const char * const paths[] = { "/etc/portage/profile/virtuals", "/etc/portage/virtuals" }; - size_t i; - - for (i = 0; i < ARRAY_SIZE(paths); ++i) { - fp = fopen(paths[i], "r"); - if (!fp) - continue; - - while (getline(&buf, &buflen, fp) != -1) { - if (*buf != 'v') - continue; - rmspace(buf); - if ((p = strchr(buf, ' ')) != NULL) { - int ok = 0; - *p = 0; - virtuals = del_set(buf, virtuals, &ok); - virtuals = add_set(buf, rmspace(++p), virtuals); - ok = 0; - } - } - - fclose(fp); - } - - return virtuals; -} - -_q_static void * -resolve_virtuals_line(void *data, char *buf) -{ - char *p; - - if (*buf != 'v') - return data; - - rmspace(buf); - if ((p = strchr(buf, ' ')) != NULL) { - *p = 0; - if (virtual(buf, virtuals) == NULL) - virtuals = add_set(buf, rmspace(++p), virtuals); - } - - return data; -} - -_q_static queue *resolve_virtuals(void) -{ - free_sets(virtuals); - virtuals = resolve_local_profile_virtuals(); - virtuals = resolve_vdb_virtuals(portvdb); - return q_profile_walk("virtuals", resolve_virtuals_line, virtuals); -} diff --git a/main.c b/main.c index f982cfa..e87dbee 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2013 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.229 2013/10/31 02:40:23 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.230 2014/02/18 07:26:14 vapier Exp $ * * Copyright 2005-2008 Ned Ludd - * Copyright 2005-2013 Mike Frysinger - @@ -1278,7 +1278,6 @@ _q_static queue *get_vdb_atoms(int fullcpv) void cleanup(void) { reinitialize_as_needed(); - free_sets(virtuals); fclose(stderr); } diff --git a/qdepends.c b/qdepends.c index dad3f02..b6c0d1c 100644 --- a/qdepends.c +++ b/qdepends.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2013 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.66 2013/09/29 22:19:39 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.67 2014/02/18 07:26:14 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2013 Mike Frysinger - @@ -32,7 +32,7 @@ static const char * const qdepends_opts_help[] = { "Pretty format specified depend strings", COMMON_OPTS_HELP }; -static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.66 2013/09/29 22:19:39 vapier Exp $"; +static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.67 2014/02/18 07:26:14 vapier Exp $"; #define qdepends_usage(ret) usage(ret, QDEPENDS_FLAGS, qdepends_long_opts, qdepends_opts_help, lookup_applet_idx("qdepends")) static char qdep_name_only = 0; @@ -358,14 +358,6 @@ void _dep_flatten_tree(const dep_node *root, char *buf, size_t *pos) if (root->type == DEP_NULL) goto this_node_sucks; if (root->type == DEP_NORM) { size_t len = strlen(root->info); -#if 1 - if (*root->info == 'v') - if (strncmp(root->info, "virtual/", 8) == 0) { - if (virtuals == NULL) - virtuals = resolve_virtuals(); - IF_DEBUG(fprintf(stderr, "(%s->%s)", root->info, virtual(root->info, virtuals))); - } -#endif memcpy(buf + *pos, root->info, len); *pos += len+1; buf[*pos-1] = ' '; diff --git a/qmerge.c b/qmerge.c index 1a44e46..8d77b7e 100644 --- a/qmerge.c +++ b/qmerge.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2010 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.138 2014/02/18 06:59:05 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.139 2014/02/18 07:26:14 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2010 Mike Frysinger - @@ -67,7 +67,7 @@ static const char * const qmerge_opts_help[] = { COMMON_OPTS_HELP }; -static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.138 2014/02/18 06:59:05 vapier Exp $"; +static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.139 2014/02/18 07:26:14 vapier Exp $"; #define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge")) char search_pkgs = 0; @@ -814,25 +814,12 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg) /* warn("newname = %s", name); */ } if ((subatom = atom_explode(name)) != NULL) { - char *dep; struct pkg_t *subpkg; char *resolved = NULL; - dep = find_binpkg(name); + resolved = find_binpkg(name); - if (strncmp(name, "virtual/", 8) == 0) { - if (virtuals == NULL) - virtuals = resolve_virtuals(); - resolved = find_binpkg(virtual(name, virtuals)); - if (resolved == NULL || !strlen(resolved)) - resolved = find_binpkg(name); - } else - resolved = NULL; - - if (resolved == NULL) - resolved = dep; - - IF_DEBUG(fprintf(stderr, "+Atom: argv0(%s) dep(%s) resolved(%s)\n", name, dep, resolved)); + IF_DEBUG(fprintf(stderr, "+Atom: argv0(%s) resolved(%s)\n", name, resolved)); if (strlen(resolved) < 1) { warn("Cant find a binpkg for %s from rdepend(%s)", name, pkg->RDEPEND);