From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage-utils:master commit in: /, libq/
Date: Mon, 6 May 2019 17:33:06 +0000 (UTC) [thread overview]
Message-ID: <1557163889.d87d181cd692247a5a7411fd6284c862bc73f28b.grobian@gentoo> (raw)
commit: d87d181cd692247a5a7411fd6284c862bc73f28b
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon May 6 17:31:29 2019 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon May 6 17:31:29 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d87d181c
libq/vdb: drop q_ prefix
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
TODO.md | 2 +-
libq/cache.c | 40 +++++++++----------
libq/cache.h | 6 +--
libq/vdb.c | 127 ++++++++++++++++++++++++++++++-----------------------------
libq/vdb.h | 74 +++++++++++++++++-----------------
qcheck.c | 10 ++---
qdepends.c | 8 ++--
qfile.c | 10 ++---
qgrep.c | 4 +-
qlist.c | 24 +++++------
qmerge.c | 48 +++++++++++-----------
qpkg.c | 14 +++----
qsize.c | 6 +--
13 files changed, 187 insertions(+), 186 deletions(-)
diff --git a/TODO.md b/TODO.md
index bc4f524..6fda56d 100644
--- a/TODO.md
+++ b/TODO.md
@@ -23,7 +23,7 @@
we end up getting just:<br>
`ACCEPT_LICENSE=" bar"`
-- q\_vdb\_foreach\_pkg should have variant that takes an atom (or just
+- vdb\_foreach\_pkg should have variant that takes an atom (or just
cat?) to reduce search space, same for cache\_foreach\_pkg
- vdb repo/slot think about when it is freed (see cache\_pkg\_close)
diff --git a/libq/cache.c b/libq/cache.c
index c0ea85e..304cd34 100644
--- a/libq/cache.c
+++ b/libq/cache.c
@@ -66,7 +66,7 @@ cache_open(const char *sroot, const char *portdir)
}
snprintf(buf, sizeof(buf), "%s/%s", portdir, portcachedir_md5);
- ret = q_vdb_open2(sroot, buf, true);
+ ret = vdb_open2(sroot, buf, true);
if (ret != NULL) {
ret->cachetype = CACHE_METADATA_MD5;
ret->repo = repo;
@@ -74,14 +74,14 @@ cache_open(const char *sroot, const char *portdir)
}
snprintf(buf, sizeof(buf), "%s/%s", portdir, portcachedir_pms);
- ret = q_vdb_open2(sroot, buf, true);
+ ret = vdb_open2(sroot, buf, true);
if (ret != NULL) {
ret->cachetype = CACHE_METADATA_PMS;
ret->repo = repo;
return ret;
}
- ret = q_vdb_open2(sroot, portdir, true);
+ ret = vdb_open2(sroot, portdir, true);
if (ret != NULL) {
ret->cachetype = CACHE_EBUILD;
ret->repo = repo;
@@ -101,31 +101,31 @@ cache_close(cache_ctx *ctx)
free(ctx->repo);
if (ctx->ebuilddir_ctx != NULL)
free(ctx->ebuilddir_ctx);
- q_vdb_close(ctx);
+ vdb_close(ctx);
}
cache_cat_ctx *
cache_open_cat(cache_ctx *ctx, const char *name)
{
- return q_vdb_open_cat(ctx, name);
+ return vdb_open_cat(ctx, name);
}
cache_cat_ctx *
cache_next_cat(cache_ctx *ctx)
{
- return q_vdb_next_cat(ctx);
+ return vdb_next_cat(ctx);
}
void
cache_close_cat(cache_cat_ctx *cat_ctx)
{
- return q_vdb_close_cat(cat_ctx);
+ return vdb_close_cat(cat_ctx);
}
cache_pkg_ctx *
cache_open_pkg(cache_cat_ctx *cat_ctx, const char *name)
{
- return q_vdb_open_pkg(cat_ctx, name);
+ return vdb_open_pkg(cat_ctx, name);
}
cache_pkg_ctx *
@@ -141,13 +141,13 @@ cache_next_pkg(cache_cat_ctx *cat_ctx)
* to CAT/P like in VDB and metadata */
do {
if (ctx->ebuilddir_pkg_ctx == NULL) {
- q_vdb_ctx *pkgdir = ctx->ebuilddir_ctx;
+ vdb_ctx *pkgdir = ctx->ebuilddir_ctx;
if (pkgdir == NULL)
- pkgdir = ctx->ebuilddir_ctx = xmalloc(sizeof(q_vdb_ctx));
+ pkgdir = ctx->ebuilddir_ctx = xmalloc(sizeof(vdb_ctx));
memset(ctx->ebuilddir_ctx, '\0', sizeof(*ctx->ebuilddir_ctx));
- if ((ctx->ebuilddir_pkg_ctx = q_vdb_next_pkg(cat_ctx)) == NULL)
+ if ((ctx->ebuilddir_pkg_ctx = vdb_next_pkg(cat_ctx)) == NULL)
return NULL;
pkgdir->portroot_fd = -1;
@@ -159,7 +159,7 @@ cache_next_pkg(cache_cat_ctx *cat_ctx)
pkgdir->cachetype = ctx->cachetype;
ctx->ebuilddir_cat_ctx =
- q_vdb_open_cat(pkgdir, ctx->ebuilddir_pkg_ctx->name);
+ vdb_open_cat(pkgdir, ctx->ebuilddir_pkg_ctx->name);
/* opening might fail if what we found wasn't a
* directory or something */
@@ -172,9 +172,9 @@ cache_next_pkg(cache_cat_ctx *cat_ctx)
ctx->ebuilddir_cat_ctx->name = cat_ctx->name;
}
- ret = q_vdb_next_pkg(ctx->ebuilddir_cat_ctx);
+ ret = vdb_next_pkg(ctx->ebuilddir_cat_ctx);
if (ret == NULL) {
- q_vdb_close_cat(ctx->ebuilddir_cat_ctx);
+ vdb_close_cat(ctx->ebuilddir_cat_ctx);
ctx->ebuilddir_pkg_ctx = NULL;
} else {
if ((p = strstr(ret->name, ".ebuild")) == NULL) {
@@ -186,7 +186,7 @@ cache_next_pkg(cache_cat_ctx *cat_ctx)
}
} while (ret == NULL);
} else {
- ret = q_vdb_next_pkg(cat_ctx);
+ ret = vdb_next_pkg(cat_ctx);
}
return ret;
@@ -627,16 +627,16 @@ cache_close_metadata(cache_metadata_xml *meta_ctx)
void
cache_close_pkg(cache_pkg_ctx *pkg_ctx)
{
- /* avoid free of cache_ctx' repo by q_vdb_close_pkg */
+ /* avoid free of cache_ctx' repo by vdb_close_pkg */
if (pkg_ctx->cat_ctx->ctx->repo == pkg_ctx->repo)
pkg_ctx->repo = NULL;
- q_vdb_close_pkg(pkg_ctx);
+ vdb_close_pkg(pkg_ctx);
}
static int
cache_foreach_pkg_int(const char *sroot, const char *portdir,
- q_vdb_pkg_cb callback, void *priv, q_vdb_cat_filter filter,
+ vdb_pkg_cb callback, void *priv, vdb_cat_filter filter,
bool sort, void *catsortfunc, void *pkgsortfunc)
{
cache_ctx *ctx;
@@ -671,7 +671,7 @@ cache_foreach_pkg_int(const char *sroot, const char *portdir,
int
cache_foreach_pkg(const char *sroot, const char *portdir,
- q_vdb_pkg_cb callback, void *priv, q_vdb_cat_filter filter)
+ vdb_pkg_cb callback, void *priv, vdb_cat_filter filter)
{
return cache_foreach_pkg_int(sroot, portdir, callback, priv,
filter, false, NULL, NULL);
@@ -679,7 +679,7 @@ cache_foreach_pkg(const char *sroot, const char *portdir,
int
cache_foreach_pkg_sorted(const char *sroot, const char *portdir,
- q_vdb_pkg_cb callback, void *priv,
+ vdb_pkg_cb callback, void *priv,
void *catsortfunc, void *pkgsortfunc)
{
return cache_foreach_pkg_int(sroot, portdir, callback, priv,
diff --git a/libq/cache.h b/libq/cache.h
index 2ad2e78..e863daf 100644
--- a/libq/cache.h
+++ b/libq/cache.h
@@ -13,9 +13,9 @@
#include "atom.h"
#include "vdb.h"
-#define cache_ctx q_vdb_ctx
-#define cache_cat_ctx q_vdb_cat_ctx
-#define cache_pkg_ctx q_vdb_pkg_ctx
+#define cache_ctx vdb_ctx
+#define cache_cat_ctx vdb_cat_ctx
+#define cache_pkg_ctx vdb_pkg_ctx
typedef struct {
char *_data;
diff --git a/libq/vdb.c b/libq/vdb.c
index 034a28c..5dc5e79 100644
--- a/libq/vdb.c
+++ b/libq/vdb.c
@@ -18,10 +18,10 @@
#include <ctype.h>
#include <xalloc.h>
-q_vdb_ctx *
-q_vdb_open2(const char *sroot, const char *svdb, bool quiet)
+vdb_ctx *
+vdb_open2(const char *sroot, const char *svdb, bool quiet)
{
- q_vdb_ctx *ctx = xmalloc(sizeof(*ctx));
+ vdb_ctx *ctx = xmalloc(sizeof(*ctx));
ctx->portroot_fd = open(sroot, O_RDONLY|O_CLOEXEC|O_PATH);
if (ctx->portroot_fd == -1) {
@@ -64,14 +64,14 @@ q_vdb_open2(const char *sroot, const char *svdb, bool quiet)
return NULL;
}
-q_vdb_ctx *
-q_vdb_open(const char *sroot, const char *svdb)
+vdb_ctx *
+vdb_open(const char *sroot, const char *svdb)
{
- return q_vdb_open2(sroot, svdb, false);
+ return vdb_open2(sroot, svdb, false);
}
void
-q_vdb_close(q_vdb_ctx *ctx)
+vdb_close(vdb_ctx *ctx)
{
closedir(ctx->dir);
/* closedir() above does this for us: */
@@ -83,7 +83,7 @@ q_vdb_close(q_vdb_ctx *ctx)
}
int
-q_vdb_filter_cat(const struct dirent *de)
+vdb_filter_cat(const struct dirent *de)
{
int i;
bool founddash;
@@ -124,10 +124,10 @@ q_vdb_filter_cat(const struct dirent *de)
return i;
}
-q_vdb_cat_ctx *
-q_vdb_open_cat(q_vdb_ctx *ctx, const char *name)
+vdb_cat_ctx *
+vdb_open_cat(vdb_ctx *ctx, const char *name)
{
- q_vdb_cat_ctx *cat_ctx;
+ vdb_cat_ctx *cat_ctx;
int fd;
DIR *dir;
@@ -151,21 +151,21 @@ q_vdb_open_cat(q_vdb_ctx *ctx, const char *name)
return cat_ctx;
}
-q_vdb_cat_ctx *
-q_vdb_next_cat(q_vdb_ctx *ctx)
+vdb_cat_ctx *
+vdb_next_cat(vdb_ctx *ctx)
{
/* search for a category directory */
- q_vdb_cat_ctx *cat_ctx = NULL;
+ vdb_cat_ctx *cat_ctx = NULL;
if (ctx->do_sort) {
if (ctx->cat_de == NULL) {
ctx->cat_cnt = scandirat(ctx->vdb_fd,
- ".", &ctx->cat_de, q_vdb_filter_cat, ctx->catsortfunc);
+ ".", &ctx->cat_de, vdb_filter_cat, ctx->catsortfunc);
ctx->cat_cur = 0;
}
while (ctx->cat_cur < ctx->cat_cnt) {
- cat_ctx = q_vdb_open_cat(ctx, ctx->cat_de[ctx->cat_cur++]->d_name);
+ cat_ctx = vdb_open_cat(ctx, ctx->cat_de[ctx->cat_cur++]->d_name);
if (!cat_ctx)
continue;
break;
@@ -178,10 +178,10 @@ q_vdb_next_cat(q_vdb_ctx *ctx)
if (!de)
break;
- if (q_vdb_filter_cat(de) == 0)
+ if (vdb_filter_cat(de) == 0)
continue;
- cat_ctx = q_vdb_open_cat(ctx, de->d_name);
+ cat_ctx = vdb_open_cat(ctx, de->d_name);
if (!cat_ctx)
continue;
@@ -193,7 +193,7 @@ q_vdb_next_cat(q_vdb_ctx *ctx)
}
void
-q_vdb_close_cat(q_vdb_cat_ctx *cat_ctx)
+vdb_close_cat(vdb_cat_ctx *cat_ctx)
{
closedir(cat_ctx->dir);
/* closedir() above does this for us: */
@@ -204,7 +204,7 @@ q_vdb_close_cat(q_vdb_cat_ctx *cat_ctx)
}
int
-q_vdb_filter_pkg(const struct dirent *de)
+vdb_filter_pkg(const struct dirent *de)
{
int i;
bool founddash = false;
@@ -235,33 +235,34 @@ q_vdb_filter_pkg(const struct dirent *de)
return i;
}
-q_vdb_pkg_ctx *
-q_vdb_open_pkg(q_vdb_cat_ctx *cat_ctx, const char *name)
+vdb_pkg_ctx *
+vdb_open_pkg(vdb_cat_ctx *cat_ctx, const char *name)
{
- q_vdb_pkg_ctx *pkg_ctx = xmalloc(sizeof(*pkg_ctx));
+ vdb_pkg_ctx *pkg_ctx = xmalloc(sizeof(*pkg_ctx));
pkg_ctx->name = name;
pkg_ctx->slot = NULL;
pkg_ctx->repo = cat_ctx->ctx->repo;
pkg_ctx->fd = -1;
pkg_ctx->cat_ctx = cat_ctx;
+ pkg_ctx->atom = NULL;
return pkg_ctx;
}
-q_vdb_pkg_ctx *
-q_vdb_next_pkg(q_vdb_cat_ctx *cat_ctx)
+vdb_pkg_ctx *
+vdb_next_pkg(vdb_cat_ctx *cat_ctx)
{
- q_vdb_pkg_ctx *pkg_ctx = NULL;
+ vdb_pkg_ctx *pkg_ctx = NULL;
if (cat_ctx->ctx->do_sort) {
if (cat_ctx->pkg_de == NULL) {
cat_ctx->pkg_cnt = scandirat(cat_ctx->fd, ".", &cat_ctx->pkg_de,
- q_vdb_filter_pkg, cat_ctx->ctx->pkgsortfunc);
+ vdb_filter_pkg, cat_ctx->ctx->pkgsortfunc);
cat_ctx->pkg_cur = 0;
}
while (cat_ctx->pkg_cur < cat_ctx->pkg_cnt) {
pkg_ctx =
- q_vdb_open_pkg(cat_ctx,
+ vdb_open_pkg(cat_ctx,
cat_ctx->pkg_de[cat_ctx->pkg_cur++]->d_name);
if (!pkg_ctx)
continue;
@@ -274,10 +275,10 @@ q_vdb_next_pkg(q_vdb_cat_ctx *cat_ctx)
if (!de)
break;
- if (q_vdb_filter_pkg(de) == 0)
+ if (vdb_filter_pkg(de) == 0)
continue;
- pkg_ctx = q_vdb_open_pkg(cat_ctx, de->d_name);
+ pkg_ctx = vdb_open_pkg(cat_ctx, de->d_name);
if (!pkg_ctx)
continue;
@@ -289,7 +290,7 @@ q_vdb_next_pkg(q_vdb_cat_ctx *cat_ctx)
}
int
-q_vdb_pkg_openat(q_vdb_pkg_ctx *pkg_ctx, const char *file, int flags, mode_t mode)
+vdb_pkg_openat(vdb_pkg_ctx *pkg_ctx, const char *file, int flags, mode_t mode)
{
if (pkg_ctx->fd == -1) {
pkg_ctx->fd = openat(pkg_ctx->cat_ctx->fd, pkg_ctx->name,
@@ -302,13 +303,13 @@ q_vdb_pkg_openat(q_vdb_pkg_ctx *pkg_ctx, const char *file, int flags, mode_t mod
}
FILE *
-q_vdb_pkg_fopenat(q_vdb_pkg_ctx *pkg_ctx, const char *file,
+vdb_pkg_fopenat(vdb_pkg_ctx *pkg_ctx, const char *file,
int flags, mode_t mode, const char *fmode)
{
FILE *fp;
int fd;
- fd = q_vdb_pkg_openat(pkg_ctx, file, flags, mode);
+ fd = vdb_pkg_openat(pkg_ctx, file, flags, mode);
if (fd == -1)
return NULL;
@@ -320,9 +321,9 @@ q_vdb_pkg_fopenat(q_vdb_pkg_ctx *pkg_ctx, const char *file,
}
bool
-q_vdb_pkg_eat(q_vdb_pkg_ctx *pkg_ctx, const char *file, char **bufptr, size_t *buflen)
+vdb_pkg_eat(vdb_pkg_ctx *pkg_ctx, const char *file, char **bufptr, size_t *buflen)
{
- int fd = q_vdb_pkg_openat(pkg_ctx, file, O_RDONLY, 0);
+ int fd = vdb_pkg_openat(pkg_ctx, file, O_RDONLY, 0);
bool ret = eat_file_fd(fd, bufptr, buflen);
rmspace(*bufptr);
if (fd != -1)
@@ -331,7 +332,7 @@ q_vdb_pkg_eat(q_vdb_pkg_ctx *pkg_ctx, const char *file, char **bufptr, size_t *b
}
void
-q_vdb_close_pkg(q_vdb_pkg_ctx *pkg_ctx)
+vdb_close_pkg(vdb_pkg_ctx *pkg_ctx)
{
if (pkg_ctx->fd != -1)
close(pkg_ctx->fd);
@@ -343,16 +344,16 @@ q_vdb_close_pkg(q_vdb_pkg_ctx *pkg_ctx)
}
static int
-q_vdb_foreach_pkg_int(const char *sroot, const char *svdb,
- q_vdb_pkg_cb callback, void *priv, q_vdb_cat_filter filter,
+vdb_foreach_pkg_int(const char *sroot, const char *svdb,
+ vdb_pkg_cb callback, void *priv, vdb_cat_filter filter,
bool sort, void *catsortfunc, void *pkgsortfunc)
{
- q_vdb_ctx *ctx;
- q_vdb_cat_ctx *cat_ctx;
- q_vdb_pkg_ctx *pkg_ctx;
+ vdb_ctx *ctx;
+ vdb_cat_ctx *cat_ctx;
+ vdb_pkg_ctx *pkg_ctx;
int ret;
- ctx = q_vdb_open(sroot, svdb);
+ ctx = vdb_open(sroot, svdb);
if (!ctx)
return EXIT_FAILURE;
@@ -363,38 +364,38 @@ q_vdb_foreach_pkg_int(const char *sroot, const char *svdb,
ctx->pkgsortfunc = pkgsortfunc;
ret = 0;
- while ((cat_ctx = q_vdb_next_cat(ctx))) {
+ while ((cat_ctx = vdb_next_cat(ctx))) {
if (filter && !filter(cat_ctx, priv))
continue;
- while ((pkg_ctx = q_vdb_next_pkg(cat_ctx))) {
+ while ((pkg_ctx = vdb_next_pkg(cat_ctx))) {
ret |= callback(pkg_ctx, priv);
- q_vdb_close_pkg(pkg_ctx);
+ vdb_close_pkg(pkg_ctx);
}
- q_vdb_close_cat(cat_ctx);
+ vdb_close_cat(cat_ctx);
}
- q_vdb_close(ctx);
+ vdb_close(ctx);
return ret;
}
int
-q_vdb_foreach_pkg(const char *sroot, const char *svdb,
- q_vdb_pkg_cb callback, void *priv, q_vdb_cat_filter filter)
+vdb_foreach_pkg(const char *sroot, const char *svdb,
+ vdb_pkg_cb callback, void *priv, vdb_cat_filter filter)
{
- return q_vdb_foreach_pkg_int(sroot, svdb, callback, priv,
+ return vdb_foreach_pkg_int(sroot, svdb, callback, priv,
filter, false, NULL, NULL);
}
int
-q_vdb_foreach_pkg_sorted(const char *sroot, const char *svdb,
- q_vdb_pkg_cb callback, void *priv)
+vdb_foreach_pkg_sorted(const char *sroot, const char *svdb,
+ vdb_pkg_cb callback, void *priv)
{
- return q_vdb_foreach_pkg_int(sroot, svdb, callback, priv,
+ return vdb_foreach_pkg_int(sroot, svdb, callback, priv,
NULL, true, NULL, NULL);
}
struct dirent *
-q_vdb_get_next_dir(DIR *dir)
+vdb_get_next_dir(DIR *dir)
{
/* search for a category directory */
struct dirent *ret;
@@ -406,23 +407,23 @@ next_entry:
return NULL;
}
- if (q_vdb_filter_cat(ret) == 0)
+ if (vdb_filter_cat(ret) == 0)
goto next_entry;
return ret;
}
depend_atom *
-q_vdb_get_atom(q_vdb_pkg_ctx *pkg_ctx)
+vdb_get_atom(vdb_pkg_ctx *pkg_ctx)
{
pkg_ctx->atom = atom_explode(pkg_ctx->name);
if (pkg_ctx->atom == NULL)
return NULL;
pkg_ctx->atom->CATEGORY = (char *)pkg_ctx->cat_ctx->name;
- q_vdb_pkg_eat(pkg_ctx, "SLOT", &pkg_ctx->slot, &pkg_ctx->slot_len);
+ vdb_pkg_eat(pkg_ctx, "SLOT", &pkg_ctx->slot, &pkg_ctx->slot_len);
pkg_ctx->atom->SLOT = pkg_ctx->slot;
- q_vdb_pkg_eat(pkg_ctx, "repository", &pkg_ctx->repo, &pkg_ctx->repo_len);
+ vdb_pkg_eat(pkg_ctx, "repository", &pkg_ctx->repo, &pkg_ctx->repo_len);
pkg_ctx->atom->REPO = pkg_ctx->repo;
return pkg_ctx->atom;
@@ -431,7 +432,7 @@ q_vdb_get_atom(q_vdb_pkg_ctx *pkg_ctx)
set *
get_vdb_atoms(const char *sroot, const char *svdb, int fullcpv)
{
- q_vdb_ctx *ctx;
+ vdb_ctx *ctx;
int cfd, j;
int dfd, i;
@@ -447,18 +448,18 @@ get_vdb_atoms(const char *sroot, const char *svdb, int fullcpv)
depend_atom *atom = NULL;
set *cpf = NULL;
- ctx = q_vdb_open(sroot, svdb);
+ ctx = vdb_open(sroot, svdb);
if (!ctx)
return NULL;
/* scan the cat first */
- cfd = scandirat(ctx->vdb_fd, ".", &cat, q_vdb_filter_cat, alphasort);
+ cfd = scandirat(ctx->vdb_fd, ".", &cat, vdb_filter_cat, alphasort);
if (cfd < 0)
goto fuckit;
for (j = 0; j < cfd; j++) {
dfd = scandirat(ctx->vdb_fd, cat[j]->d_name,
- &pf, q_vdb_filter_pkg, alphasort);
+ &pf, vdb_filter_pkg, alphasort);
if (dfd < 0)
continue;
for (i = 0; i < dfd; i++) {
@@ -499,6 +500,6 @@ get_vdb_atoms(const char *sroot, const char *svdb, int fullcpv)
scandir_free(cat, cfd);
fuckit:
- q_vdb_close(ctx);
+ vdb_close(ctx);
return cpf;
}
diff --git a/libq/vdb.h b/libq/vdb.h
index 3cfa95b..2954bef 100644
--- a/libq/vdb.h
+++ b/libq/vdb.h
@@ -11,12 +11,12 @@
#include "set.h"
-typedef struct q_vdb_ctx q_vdb_ctx;
-typedef struct q_vdb_cat_ctx q_vdb_cat_ctx;
-typedef struct q_vdb_pkg_ctx q_vdb_pkg_ctx;
+typedef struct vdb_ctx vdb_ctx;
+typedef struct vdb_cat_ctx vdb_cat_ctx;
+typedef struct vdb_pkg_ctx vdb_pkg_ctx;
/* VDB context */
-struct q_vdb_ctx {
+struct vdb_ctx {
int portroot_fd;
int vdb_fd;
DIR *dir;
@@ -33,64 +33,64 @@ struct q_vdb_ctx {
CACHE_EBUILD,
CACHE_VDB,
} cachetype:3;
- q_vdb_pkg_ctx *ebuilddir_pkg_ctx;
- q_vdb_cat_ctx *ebuilddir_cat_ctx;
- q_vdb_ctx *ebuilddir_ctx;
+ vdb_pkg_ctx *ebuilddir_pkg_ctx;
+ vdb_cat_ctx *ebuilddir_cat_ctx;
+ vdb_ctx *ebuilddir_ctx;
char *repo;
};
/* Category context */
-struct q_vdb_cat_ctx {
+struct vdb_cat_ctx {
const char *name;
int fd;
DIR *dir;
- const q_vdb_ctx *ctx;
+ const vdb_ctx *ctx;
struct dirent **pkg_de;
size_t pkg_cnt;
size_t pkg_cur;
};
/* Package context */
-struct q_vdb_pkg_ctx {
+struct vdb_pkg_ctx {
const char *name;
char *slot;
char *repo;
size_t slot_len;
size_t repo_len;
int fd;
- q_vdb_cat_ctx *cat_ctx;
+ vdb_cat_ctx *cat_ctx;
depend_atom *atom;
};
/* Global helpers */
-typedef int (q_vdb_pkg_cb)(q_vdb_pkg_ctx *, void *priv);
-typedef int (q_vdb_cat_filter)(q_vdb_cat_ctx *, void *priv);
+typedef int (vdb_pkg_cb)(vdb_pkg_ctx *, void *priv);
+typedef int (vdb_cat_filter)(vdb_cat_ctx *, void *priv);
-q_vdb_ctx *q_vdb_open(const char *sroot, const char *svdb);
-q_vdb_ctx *q_vdb_open2(const char *sroot, const char *svdb, bool quiet);
-void q_vdb_close(q_vdb_ctx *ctx);
-int q_vdb_filter_cat(const struct dirent *de);
-q_vdb_cat_ctx *q_vdb_open_cat(q_vdb_ctx *ctx, const char *name);
-q_vdb_cat_ctx *q_vdb_next_cat(q_vdb_ctx *ctx);
-void q_vdb_close_cat(q_vdb_cat_ctx *cat_ctx);
-int q_vdb_filter_pkg(const struct dirent *de);
-q_vdb_pkg_ctx *q_vdb_open_pkg(q_vdb_cat_ctx *cat_ctx, const char *name);
-q_vdb_pkg_ctx *q_vdb_next_pkg(q_vdb_cat_ctx *cat_ctx);
-int q_vdb_pkg_openat(q_vdb_pkg_ctx *pkg_ctx, const char *file, int flags, mode_t mode);
-FILE *q_vdb_pkg_fopenat(q_vdb_pkg_ctx *pkg_ctx, const char *file,
+vdb_ctx *vdb_open(const char *sroot, const char *svdb);
+vdb_ctx *vdb_open2(const char *sroot, const char *svdb, bool quiet);
+void vdb_close(vdb_ctx *ctx);
+int vdb_filter_cat(const struct dirent *de);
+vdb_cat_ctx *vdb_open_cat(vdb_ctx *ctx, const char *name);
+vdb_cat_ctx *vdb_next_cat(vdb_ctx *ctx);
+void vdb_close_cat(vdb_cat_ctx *cat_ctx);
+int vdb_filter_pkg(const struct dirent *de);
+vdb_pkg_ctx *vdb_open_pkg(vdb_cat_ctx *cat_ctx, const char *name);
+vdb_pkg_ctx *vdb_next_pkg(vdb_cat_ctx *cat_ctx);
+int vdb_pkg_openat(vdb_pkg_ctx *pkg_ctx, const char *file, int flags, mode_t mode);
+FILE *vdb_pkg_fopenat(vdb_pkg_ctx *pkg_ctx, const char *file,
int flags, mode_t mode, const char *fmode);
-#define q_vdb_pkg_fopenat_ro(pkg_ctx, file) \
- q_vdb_pkg_fopenat(pkg_ctx, file, O_RDONLY, 0, "r")
-#define q_vdb_pkg_fopenat_rw(pkg_ctx, file) \
- q_vdb_pkg_fopenat(pkg_ctx, file, O_RDWR|O_CREAT|O_TRUNC, 0644, "w")
-bool q_vdb_pkg_eat(q_vdb_pkg_ctx *pkg_ctx, const char *file, char **bufptr, size_t *buflen);
-void q_vdb_close_pkg(q_vdb_pkg_ctx *pkg_ctx);
-int q_vdb_foreach_pkg(const char *sroot, const char *svdb,
- q_vdb_pkg_cb callback, void *priv, q_vdb_cat_filter filter);
-int q_vdb_foreach_pkg_sorted(const char *sroot, const char *svdb,
- q_vdb_pkg_cb callback, void *priv);
-struct dirent *q_vdb_get_next_dir(DIR *dir);
+#define vdb_pkg_fopenat_ro(pkg_ctx, file) \
+ vdb_pkg_fopenat(pkg_ctx, file, O_RDONLY, 0, "r")
+#define vdb_pkg_fopenat_rw(pkg_ctx, file) \
+ vdb_pkg_fopenat(pkg_ctx, file, O_RDWR|O_CREAT|O_TRUNC, 0644, "w")
+bool vdb_pkg_eat(vdb_pkg_ctx *pkg_ctx, const char *file, char **bufptr, size_t *buflen);
+void vdb_close_pkg(vdb_pkg_ctx *pkg_ctx);
+int vdb_foreach_pkg(const char *sroot, const char *svdb,
+ vdb_pkg_cb callback, void *priv, vdb_cat_filter filter);
+int vdb_foreach_pkg_sorted(const char *sroot, const char *svdb,
+ vdb_pkg_cb callback, void *priv);
+struct dirent *vdb_get_next_dir(DIR *dir);
set *get_vdb_atoms(const char *sroot, const char *svdb, int fullcpv);
-depend_atom *q_vdb_get_atom(q_vdb_pkg_ctx *pkg_ctx);
+depend_atom *vdb_get_atom(vdb_pkg_ctx *pkg_ctx);
#endif
diff --git a/qcheck.c b/qcheck.c
index 0585396..377a187 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -65,7 +65,7 @@ struct qcheck_opt_state {
};
static int
-qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_state *state)
+qcheck_process_contents(vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_state *state)
{
int fd_contents;
FILE *fp_contents, *fp_contents_update;
@@ -81,7 +81,7 @@ qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_state *state)
fp_contents_update = NULL;
/* Open contents */
- fd_contents = q_vdb_pkg_openat(pkg_ctx, "CONTENTS", O_RDONLY|O_CLOEXEC, 0);
+ fd_contents = vdb_pkg_openat(pkg_ctx, "CONTENTS", O_RDONLY|O_CLOEXEC, 0);
if (fd_contents == -1)
return EXIT_SUCCESS;
if (fstat(fd_contents, &cst)) {
@@ -99,7 +99,7 @@ qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_state *state)
(state->qc_update ? "Updat" : "Check"),
GREEN, catname, pkgname, NORM);
if (state->qc_update) {
- fp_contents_update = q_vdb_pkg_fopenat_rw(pkg_ctx, "CONTENTS~");
+ fp_contents_update = vdb_pkg_fopenat_rw(pkg_ctx, "CONTENTS~");
if (fp_contents_update == NULL) {
fclose(fp_contents);
warnp("unable to fopen(%s/%s, w)", pkgname, "CONTENTS~");
@@ -363,7 +363,7 @@ qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_state *state)
}
static int
-qcheck_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+qcheck_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qcheck_opt_state *state = priv;
const char *catname = pkg_ctx->cat_ctx->name;
@@ -439,7 +439,7 @@ int qcheck_main(int argc, char **argv)
xarraypush_ptr(atoms, atom);
}
- ret = q_vdb_foreach_pkg_sorted(portroot, portvdb, qcheck_cb, &state);
+ ret = vdb_foreach_pkg_sorted(portroot, portvdb, qcheck_cb, &state);
{
void *regex;
array_for_each(regex_arr, i, regex)
diff --git a/qdepends.c b/qdepends.c
index 7bb8818..e49e533 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -92,7 +92,7 @@ qdepends_print_depend(FILE *fp, const char *depend)
}
static int
-qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+qdepends_results_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qdepends_opt_state *state = priv;
depend_atom *atom;
@@ -116,7 +116,7 @@ qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
* *DEPEND alters the search somewhat and affects results printing.
*/
- datom = q_vdb_get_atom(pkg_ctx);
+ datom = vdb_get_atom(pkg_ctx);
if (datom == NULL)
return ret;
@@ -145,7 +145,7 @@ qdepends_results_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
for (i = QMODE_DEPEND; i <= QMODE_BDEPEND; i <<= 1, dfile++) {
if (!(state->qmode & i))
continue;
- if (!q_vdb_pkg_eat(pkg_ctx, *dfile,
+ if (!vdb_pkg_eat(pkg_ctx, *dfile,
&state->depend, &state->depend_len))
continue;
@@ -302,7 +302,7 @@ int qdepends_main(int argc, char **argv)
xarraypush_ptr(atoms, atom);
}
- ret = q_vdb_foreach_pkg(portroot, portvdb,
+ ret = vdb_foreach_pkg(portroot, portvdb,
qdepends_results_cb, &state, NULL);
if (state.depend != NULL)
diff --git a/qfile.c b/qfile.c
index 19b156e..3d1543e 100644
--- a/qfile.c
+++ b/qfile.c
@@ -74,7 +74,7 @@ struct qfile_opt_state {
* We assume the people calling us have chdir(/var/db/pkg) and so
* we use relative paths throughout here.
*/
-static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+static int qfile_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qfile_opt_state *state = priv;
const char *catname = pkg_ctx->cat_ctx->name;
@@ -115,14 +115,14 @@ static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
}
if (state->exclude_slot == NULL)
goto qlist_done; /* "(CAT/)?(PN|PF)" matches, and no SLOT specified */
- q_vdb_pkg_eat(pkg_ctx, "SLOT", &state->buf, &state->buflen);
+ vdb_pkg_eat(pkg_ctx, "SLOT", &state->buf, &state->buflen);
rmspace(state->buf);
if (strcmp(state->exclude_slot, state->buf) == 0)
goto qlist_done; /* "(CAT/)?(PN|PF):SLOT" matches */
}
dont_skip_pkg: /* End of the package exclusion tests. */
- fp = q_vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS");
+ fp = vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS");
if (fp == NULL)
goto qlist_done;
@@ -227,7 +227,7 @@ static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
/* XXX: This assumes the buf is big enough. */
char *slot_hack = slot + 1;
size_t slot_len = sizeof(slot) - 1;
- q_vdb_pkg_eat(pkg_ctx, "SLOT", &slot_hack, &slot_len);
+ vdb_pkg_eat(pkg_ctx, "SLOT", &slot_hack, &slot_len);
rmspace(slot_hack);
slot[0] = ':';
} else
@@ -479,7 +479,7 @@ int qfile_main(int argc, char **argv)
nb_of_queries = prepare_qfile_args(argc, (const char **) argv, &state);
/* Now do the actual `qfile` checking */
if (nb_of_queries > 0)
- found += q_vdb_foreach_pkg_sorted(portroot, portvdb, qfile_cb, &state);
+ found += vdb_foreach_pkg_sorted(portroot, portvdb, qfile_cb, &state);
if (state.args.non_orphans) {
/* display orphan files */
diff --git a/qgrep.c b/qgrep.c
index 6cb5697..f38f461 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -441,7 +441,7 @@ qgrep_cache_cb(cache_pkg_ctx *pkg_ctx, void *priv)
}
static int
-qgrep_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+qgrep_vdb_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qgrep_grepargs *data = (struct qgrep_grepargs *)priv;
char buf[_Q_PATH_MAX];
@@ -687,7 +687,7 @@ int qgrep_main(int argc, char **argv)
}
closedir(eclass_dir);
} else if (do_installed) {
- status = q_vdb_foreach_pkg(portroot, portvdb,
+ status = vdb_foreach_pkg(portroot, portvdb,
qgrep_vdb_cb, &args, NULL);
} else { /* do_ebuild */
status = cache_foreach_pkg(portroot, overlay,
diff --git a/qlist.c b/qlist.c
index 313ff56..9314385 100644
--- a/qlist.c
+++ b/qlist.c
@@ -96,7 +96,7 @@ cmpstringp(const void *p1, const void *p2)
*/
static char _umapstr_buf[BUFSIZ];
static const char *
-umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
+umapstr(char display, vdb_pkg_ctx *pkg_ctx)
{
char *bufp = _umapstr_buf;
char *use = NULL;
@@ -115,10 +115,10 @@ umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
if (!display)
return bufp;
- q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
+ vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
if (!use[0])
return bufp;
- q_vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_len);
+ vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_len);
if (!iuse[0])
return bufp;
@@ -173,13 +173,13 @@ umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
/* forward declaration necessary for misuse from qmerge.c, see HACK there */
bool
qlist_match(
- q_vdb_pkg_ctx *pkg_ctx,
+ vdb_pkg_ctx *pkg_ctx,
const char *name,
depend_atom **name_atom,
bool exact);
bool
qlist_match(
- q_vdb_pkg_ctx *pkg_ctx,
+ vdb_pkg_ctx *pkg_ctx,
const char *name,
depend_atom **name_atom,
bool exact)
@@ -200,7 +200,7 @@ qlist_match(
uslot = NULL;
else {
if (!pkg_ctx->slot)
- q_vdb_pkg_eat(pkg_ctx, "SLOT", &pkg_ctx->slot,
+ vdb_pkg_eat(pkg_ctx, "SLOT", &pkg_ctx->slot,
&pkg_ctx->slot_len);
uslot_len = strlen(uslot);
}
@@ -209,7 +209,7 @@ qlist_match(
urepo = strstr(name, "::");
if (urepo) {
if (!pkg_ctx->repo)
- q_vdb_pkg_eat(pkg_ctx, "repository", &pkg_ctx->repo,
+ vdb_pkg_eat(pkg_ctx, "repository", &pkg_ctx->repo,
&pkg_ctx->repo_len);
urepo += 2;
urepo_len = strlen(urepo);
@@ -338,7 +338,7 @@ struct qlist_opt_state {
};
static int
-qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+qlist_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qlist_opt_state *state = priv;
int i;
@@ -359,7 +359,7 @@ 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",
+ vdb_pkg_eat(pkg_ctx, "SLOT",
&pkg_ctx->slot, &pkg_ctx->slot_len);
/* chop off the subslot if desired */
if (state->show_slots == 1) {
@@ -369,7 +369,7 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
}
}
if (state->show_repo && !pkg_ctx->repo)
- q_vdb_pkg_eat(pkg_ctx, "repository",
+ vdb_pkg_eat(pkg_ctx, "repository",
&pkg_ctx->repo, &pkg_ctx->repo_len);
/* display it */
printf("%s%s/%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
@@ -398,7 +398,7 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
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");
+ fp = vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS");
if (fp == NULL)
return 1;
@@ -489,7 +489,7 @@ 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(portroot, portvdb, qlist_cb, &state);
+ ret = vdb_foreach_pkg_sorted(portroot, portvdb, qlist_cb, &state);
free(state.buf);
for (i = optind; i < state.argc; ++i)
if (state.atoms[i - optind])
diff --git a/qmerge.c b/qmerge.c
index 97726db..41488fa 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -118,7 +118,7 @@ typedef struct llist_char_t llist_char;
static void pkg_fetch(int, const depend_atom *, const struct pkg_t *);
static void pkg_merge(int, const depend_atom *, const struct pkg_t *);
-static int pkg_unmerge(q_vdb_pkg_ctx *, set *, int, char **, int, char **);
+static int pkg_unmerge(vdb_pkg_ctx *, set *, int, char **, int, char **);
static struct pkg_t *grab_binpkg_info(const char *);
static char *find_binpkg(const char *);
@@ -282,7 +282,7 @@ struct qmerge_bv_state {
};
static int
-qmerge_filter_cat(q_vdb_cat_ctx *cat_ctx, void *priv)
+qmerge_filter_cat(vdb_cat_ctx *cat_ctx, void *priv)
{
struct qmerge_bv_state *state = priv;
return !state->catname || strcmp(cat_ctx->name, state->catname) == 0;
@@ -292,13 +292,13 @@ qmerge_filter_cat(q_vdb_cat_ctx *cat_ctx, void *priv)
* should however figure out how to do what match does here from e.g.
* atom */
extern bool qlist_match(
- q_vdb_pkg_ctx *pkg_ctx,
+ vdb_pkg_ctx *pkg_ctx,
const char *name,
depend_atom **name_atom,
bool exact);
static int
-qmerge_best_version_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+qmerge_best_version_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qmerge_bv_state *state = priv;
if (qlist_match(pkg_ctx, state->buf, NULL, true))
@@ -338,7 +338,7 @@ best_version(const char *catname, const char *pkgname, const char *slot)
retbuf[0] = '\0';
snprintf(state.buf, sizeof(state.buf), "%s%s%s:%s",
catname ? : "", catname ? "/" : "", pkgname, slot);
- q_vdb_foreach_pkg(portroot, portvdb,
+ vdb_foreach_pkg(portroot, portvdb,
qmerge_best_version_cb, &state, qmerge_filter_cat);
done:
@@ -999,8 +999,8 @@ static void
pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
{
set *objs;
- q_vdb_ctx *vdb_ctx;
- q_vdb_cat_ctx *cat_ctx;
+ vdb_ctx *vdb;
+ vdb_cat_ctx *cat_ctx;
FILE *fp, *contents;
static char *phases;
static size_t phases_len;
@@ -1122,19 +1122,19 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
}
/* Get a handle on the main vdb repo */
- vdb_ctx = q_vdb_open(portroot, portvdb);
- if (!vdb_ctx)
+ vdb = vdb_open(portroot, portvdb);
+ if (!vdb)
return;
- cat_ctx = q_vdb_open_cat(vdb_ctx, pkg->CATEGORY);
+ cat_ctx = vdb_open_cat(vdb, pkg->CATEGORY);
if (!cat_ctx) {
if (errno != ENOENT) {
- q_vdb_close(vdb_ctx);
+ vdb_close(vdb);
return;
}
- mkdirat(vdb_ctx->vdb_fd, pkg->CATEGORY, 0755);
- cat_ctx = q_vdb_open_cat(vdb_ctx, pkg->CATEGORY);
+ mkdirat(vdb->vdb_fd, pkg->CATEGORY, 0755);
+ cat_ctx = vdb_open_cat(vdb, pkg->CATEGORY);
if (!cat_ctx) {
- q_vdb_close(vdb_ctx);
+ vdb_close(vdb);
return;
}
}
@@ -1345,10 +1345,10 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
/* TODO: Should see about merging with unmerge_packages() */
while (1) {
int ret;
- q_vdb_pkg_ctx *pkg_ctx;
+ vdb_pkg_ctx *pkg_ctx;
depend_atom *old_atom;
- pkg_ctx = q_vdb_next_pkg(cat_ctx);
+ pkg_ctx = vdb_next_pkg(cat_ctx);
if (!pkg_ctx)
break;
@@ -1377,7 +1377,7 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
pkg_unmerge(pkg_ctx, objs, cp_argc, cp_argv, cpm_argc, cpm_argv);
next_pkg:
- q_vdb_close_pkg(pkg_ctx);
+ vdb_close_pkg(pkg_ctx);
}
freeargv(cp_argc, cp_argv);
@@ -1416,14 +1416,14 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
printf("%s>>>%s %s%s%s/%s%s%s\n",
YELLOW, NORM, WHITE, atom->CATEGORY, NORM, CYAN, atom->PN, NORM);
- q_vdb_close(vdb_ctx);
+ vdb_close(vdb);
}
static int
-pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, set *keep,
+pkg_unmerge(vdb_pkg_ctx *pkg_ctx, set *keep,
int cp_argc, char **cp_argv, int cpm_argc, char **cpm_argv)
{
- q_vdb_cat_ctx *cat_ctx = pkg_ctx->cat_ctx;
+ vdb_cat_ctx *cat_ctx = pkg_ctx->cat_ctx;
const char *cat = cat_ctx->name;
const char *pkgname = pkg_ctx->name;
size_t buflen;
@@ -1447,7 +1447,7 @@ pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, set *keep,
return 0;
/* First get a handle on the things to clean up */
- fp = q_vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS");
+ fp = vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS");
if (fp == NULL)
return ret;
@@ -1455,7 +1455,7 @@ pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, set *keep,
/* Then execute the pkg_prerm step */
if (!pretend) {
- q_vdb_pkg_eat(pkg_ctx, "DEFINED_PHASES", &phases, &phases_len);
+ vdb_pkg_eat(pkg_ctx, "DEFINED_PHASES", &phases, &phases_len);
mkdirat(pkg_ctx->fd, "temp", 0755);
pkg_run_func_at(pkg_ctx->fd, ".", phases, "pkg_prerm", T, T);
}
@@ -1776,7 +1776,7 @@ print_Pkg(int full, const depend_atom *atom, const struct pkg_t *pkg)
}
static int
-qmerge_unmerge_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+qmerge_unmerge_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
int cp_argc;
int cpm_argc;
@@ -1804,7 +1804,7 @@ qmerge_unmerge_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
static int
unmerge_packages(set *todo)
{
- return q_vdb_foreach_pkg(portroot, portvdb, qmerge_unmerge_cb, todo, NULL);
+ return vdb_foreach_pkg(portroot, portvdb, qmerge_unmerge_cb, todo, NULL);
}
static FILE *
diff --git a/qpkg.c b/qpkg.c
index af8df37..b93823b 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -334,9 +334,9 @@ qpkg_make(depend_atom *atom)
int qpkg_main(int argc, char **argv)
{
- q_vdb_ctx *ctx;
- q_vdb_cat_ctx *cat_ctx;
- q_vdb_pkg_ctx *pkg_ctx;
+ vdb_ctx *ctx;
+ vdb_cat_ctx *cat_ctx;
+ vdb_pkg_ctx *pkg_ctx;
size_t s, pkgs_made;
int i;
struct stat st;
@@ -417,15 +417,15 @@ retry_mkdir:
}
/* now try to run through vdb and locate matches for user inputs */
- ctx = q_vdb_open(portroot, portvdb);
+ ctx = vdb_open(portroot, portvdb);
if (!ctx)
return EXIT_FAILURE;
/* scan all the categories */
- while ((cat_ctx = q_vdb_next_cat(ctx))) {
+ while ((cat_ctx = vdb_next_cat(ctx))) {
/* scan all the packages in this category */
const char *catname = cat_ctx->name;
- while ((pkg_ctx = q_vdb_next_pkg(cat_ctx))) {
+ while ((pkg_ctx = vdb_next_pkg(cat_ctx))) {
const char *pkgname = pkg_ctx->name;
/* see if user wants any of these packages */
@@ -449,7 +449,7 @@ retry_mkdir:
atom_implode(atom);
next_pkg:
- q_vdb_close_pkg(pkg_ctx);
+ vdb_close_pkg(pkg_ctx);
}
}
diff --git a/qsize.c b/qsize.c
index 80d496c..4fbbe47 100644
--- a/qsize.c
+++ b/qsize.c
@@ -97,7 +97,7 @@ struct qsize_opt_state {
};
static int
-qsize_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
+qsize_cb(vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qsize_opt_state *state = priv;
const char *catname = pkg_ctx->cat_ctx->name;
@@ -126,7 +126,7 @@ qsize_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
if (!showit)
return EXIT_SUCCESS;
- if ((fp = q_vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS")) == NULL)
+ if ((fp = vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS")) == NULL)
return EXIT_SUCCESS;
num_ignored = num_files = num_nonfiles = num_bytes = 0;
@@ -230,7 +230,7 @@ int qsize_main(int argc, char **argv)
state.buflen = _Q_PATH_MAX;
state.buf = xmalloc(state.buflen);
- ret = q_vdb_foreach_pkg(portroot, portvdb, qsize_cb, &state, NULL);
+ ret = vdb_foreach_pkg(portroot, portvdb, qsize_cb, &state, NULL);
if (state.summary) {
printf(" %sTotals%s: %'zu files, %'zu non-files, ", BOLD, NORM,
next reply other threads:[~2019-05-06 17:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-06 17:33 Fabian Groffen [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-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
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=1557163889.d87d181cd692247a5a7411fd6284c862bc73f28b.grobian@gentoo \
--to=grobian@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