public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage-utils:master commit in: /, libq/
Date: Sat,  8 Mar 2014 05:51:17 +0000 (UTC)	[thread overview]
Message-ID: <1392708373.e2af8a0e5a7d0e055e3007dd750d5754d952a71d.vapier@gentoo> (raw)

commit:     e2af8a0e5a7d0e055e3007dd750d5754d952a71d
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 07:26:13 2014 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> 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        - <solar@gentoo.org>
  * Copyright 2005-2010 Mike Frysinger  - <vapier@gentoo.org>
  *
- * $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 <stdio.h>
@@ -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        - <solar@gentoo.org>
  * Copyright 2005-2013 Mike Frysinger  - <vapier@gentoo.org>
@@ -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        - <solar@gentoo.org>
  * Copyright 2005-2013 Mike Frysinger  - <vapier@gentoo.org>
@@ -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        - <solar@gentoo.org>
  * Copyright 2005-2010 Mike Frysinger  - <vapier@gentoo.org>
@@ -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);


             reply	other threads:[~2014-03-08  5:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-08  5:51 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-02  7:57 [gentoo-commits] proj/portage-utils:master commit in: /, libq/ Fabian Groffen
2020-05-16 18:27 Fabian Groffen
2020-01-05 16:08 Fabian Groffen
2020-01-04 19:48 Fabian Groffen
2020-01-01 17:54 Fabian Groffen
2019-11-15 13:52 Fabian Groffen
2019-07-14 13:09 Fabian Groffen
2019-05-07  6:19 Fabian Groffen
2019-05-06 17:33 Fabian Groffen
2019-05-02 15:48 Fabian Groffen
2018-05-18 16:58 Fabian Groffen
2016-12-29  2:25 Mike Frysinger
2016-12-29  2:25 Mike Frysinger
2016-02-14  1:26 Mike Frysinger
2016-02-14  1:26 Mike Frysinger
2015-11-28  2:44 Mike Frysinger
2015-11-28  2:44 Mike Frysinger
2015-02-24  1:26 Mike Frysinger
2014-03-21  5:32 Mike Frysinger
2014-03-10  8:45 Mike Frysinger
2014-03-10  6:00 Mike Frysinger
2014-03-08  5:51 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392708373.e2af8a0e5a7d0e055e3007dd750d5754d952a71d.vapier@gentoo \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox