aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-02-18 07:26:13 +0000
committerMike Frysinger <vapier@gentoo.org>2014-02-18 07:26:13 +0000
commite2af8a0e5a7d0e055e3007dd750d5754d952a71d (patch)
treed725d236867ff9ef256e3ea9cfe879d2a3e54580
parentadd TODO for installing a binpkg directly (diff)
downloadportage-utils-e2af8a0e5a7d0e055e3007dd750d5754d952a71d.tar.gz
portage-utils-e2af8a0e5a7d0e055e3007dd750d5754d952a71d.tar.bz2
portage-utils-e2af8a0e5a7d0e055e3007dd750d5754d952a71d.zip
drop support for old style virtuals as the tree has not carried them in a long time
-rw-r--r--libq/virtuals.c128
-rw-r--r--main.c3
-rw-r--r--qdepends.c12
-rw-r--r--qmerge.c21
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);