* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: c366372b1b05c83844902c1bbe19e020471c9c73
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 7 19:17:25 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jan 7 19:17:25 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=c366372b
qmerge: ignore unmerge errors due to missing files in case someone already did `rm` on it
---
qmerge.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 9b7f152..40d4139 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.130 2013/05/09 05:28:11 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.131 2014/01/07 19:17:25 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -65,7 +65,7 @@ static const char * const qmerge_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.130 2013/05/09 05:28:11 vapier Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.131 2014/01/07 19:17:25 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char search_pkgs = 0;
@@ -1157,8 +1157,11 @@ pkg_unmerge(const char *cat, const char *pkgname, queue *keep)
if (!keep || q) {
char *p;
- if (unlinkat(portroot_fd, e->name + 1, 0))
- errp("could not unlink: %s%s", portroot, e->name + 1);
+ if (unlinkat(portroot_fd, e->name + 1, 0)) {
+ /* If a file was already deleted, ignore the error */
+ if (errno != ENOENT)
+ errp("could not unlink: %s%s", portroot, e->name + 1);
+ }
p = strrchr(e->name, '/');
if (p) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 66abc9176f7916222cfb694ba04abd43c3690d27
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 22:19:39 2013 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 22:19:39 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=66abc917
qdepends: warn if no matches were found #459970
---
qdepends.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/qdepends.c b/qdepends.c
index a7bb8d5..dad3f02 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.65 2013/09/29 10:36:08 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.66 2013/09/29 22:19:39 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.65 2013/09/29 10:36:08 vapier Exp $";
+static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.66 2013/09/29 22:19:39 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;
@@ -465,7 +465,7 @@ _q_static int qdepends_main_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
dep_burn_tree(dep_tree);
- return EXIT_SUCCESS;
+ return 1;
}
_q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
@@ -523,7 +523,7 @@ _q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
}
dep_burn_tree(dep_tree);
- return EXIT_SUCCESS;
+ return 1;
}
int qdepends_main(int argc, char **argv)
@@ -533,7 +533,7 @@ int qdepends_main(int argc, char **argv)
.argv = argv,
};
q_vdb_pkg_cb *cb;
- int i;
+ int i, ret;
bool do_format = false;
const char *query = NULL;
const char *depend_file;
@@ -576,16 +576,18 @@ int qdepends_main(int argc, char **argv)
cb = query ? qdepends_vdb_deep_cb : qdepends_main_vdb_cb;
if (!depend_file) {
- int ret = 0;
+ ret = 0;
for (i = 0; depend_files[i]; ++i) {
printf(" %s*%s %s\n", GREEN, NORM, depend_files[i]);
state.depend_file = depend_files[i];
- ret += q_vdb_foreach_pkg(cb, &state, NULL);
+ ret |= q_vdb_foreach_pkg(cb, &state, NULL);
}
- return ret;
- }
+ } else
+ ret = q_vdb_foreach_pkg(cb, &state, NULL);
- return q_vdb_foreach_pkg(cb, &state, NULL);
+ if (!ret && !quiet)
+ warn("no matches found for your query");
+ return ret ? EXIT_SUCCESS : EXIT_FAILURE;
}
#else
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: c0117af5bc140fce36c76eb9f2ea70c23c352da5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 22:16:09 2013 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 22:16:09 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=c0117af5
add more todo stuff
---
TODO | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/TODO b/TODO
index efa89c6..5f1f382 100644
--- a/TODO
+++ b/TODO
@@ -36,6 +36,13 @@
- these limits should not be an issue for all practical purposes
- need to handle USE deps like: cat/pkg-123[foo(+)]
+- qcache:
+ - need to convert it to new metadata/md5 style
+
+- qdepends:
+ - support querying uninstalled packages (via metadata/md5 cache)
+ - verify version matching works: qdepend =nano-2*
+
- env vars only get expanded once, so this fails:
ACCEPT_LICENSE="foo"
ACCEPT_LICENSE="${ACCEPT_LICENSE} bar"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 607b2fbe22eaecd7d9779fe08842291f56900696
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 04:32:52 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 04:32:52 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=607b2fbe
qmerge: fix path use -- assign it to argv after we init it
---
qmerge.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 9a42269..1c5aaaa 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.133 2014/02/17 06:32:33 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.134 2014/02/18 04:32:52 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -65,7 +65,7 @@ static const char * const qmerge_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.133 2014/02/17 06:32:33 vapier Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.134 2014/02/18 04:32:52 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char search_pkgs = 0;
@@ -132,6 +132,8 @@ _q_static void fetch(const char *destdir, const char *src)
int status;
char *path;
+ xasprintf(&path, "%s/%s", binhost, src);
+
char prog[] = "wget";
char argv_c[] = "-c";
char argv_P[] = "-P";
@@ -148,7 +150,6 @@ _q_static void fetch(const char *destdir, const char *src)
};
if (!(force_download || install) && pretend)
strcpy(prog, "echo");
- xasprintf(&path, "%s/%s", binhost, src);
p = vfork();
switch (p) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 42813bf37d0aba98b534639928cb370359846a7e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 17 06:32:33 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 17 06:32:33 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=42813bf3
qmerge: do not require PORTAGE_BINHOST all the time
perfectly reasonable to only install local binpkgs
---
qmerge.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 5ec9be8..9a42269 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.132 2014/02/16 21:14:24 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.133 2014/02/17 06:32:33 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -65,7 +65,7 @@ static const char * const qmerge_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.132 2014/02/16 21:14:24 vapier Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.133 2014/02/17 06:32:33 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char search_pkgs = 0;
@@ -113,16 +113,15 @@ _q_static char *find_binpkg(const char *);
_q_static void fetch(const char *destdir, const char *src)
{
- char buf[BUFSIZ];
-
if (!binhost[0])
- errf("PORTAGE_BINHOST= does not appear to be valid");
+ return;
fflush(stdout);
fflush(stderr);
#if 0
if (getenv("FETCHCOMMAND") != NULL) {
+ char buf[BUFSIZ];
snprintf(buf, sizeof(buf), "(export DISTDIR='%s' URI='%s/%s'; %s)",
destdir, binhost, src, getenv("FETCHCOMMAND"));
xsystem(buf);
@@ -131,6 +130,7 @@ _q_static void fetch(const char *destdir, const char *src)
{
pid_t p;
int status;
+ char *path;
char prog[] = "wget";
char argv_c[] = "-c";
@@ -142,18 +142,23 @@ _q_static void fetch(const char *destdir, const char *src)
argv_c,
argv_P,
argv_dir,
- buf,
+ path,
quiet ? argv_q : NULL,
NULL,
};
if (!(force_download || install) && pretend)
strcpy(prog, "echo");
- snprintf(buf, sizeof(buf), "%s/%s", binhost, src);
+ xasprintf(&path, "%s/%s", binhost, src);
p = vfork();
- if (p == 0)
+ switch (p) {
+ case 0:
_exit(execvp(prog, argv));
+ case -1:
+ errp("vfork failed");
+ }
+ free(path);
free(argv_dir);
waitpid(p, &status, 0);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: d4721df8434a3c56cf8a246dd634bc7af7eee019
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 04:32:04 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 04:32:04 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=d4721df8
update default URL list to match current tinderbox server
---
main.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++----------------
1 file changed, 56 insertions(+), 17 deletions(-)
diff --git a/main.h b/main.h
index e2e82d1..43f219c 100644
--- a/main.h
+++ b/main.h
@@ -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/main.h,v 1.16 2013/09/29 22:42:36 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.h,v 1.17 2014/02/18 04:32:04 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -22,25 +22,64 @@
/* http://tinderbox.dev.gentoo.org/default-linux/hppa */
#ifdef __linux__
-#undef URL
-#define URL "http://tinderbox.dev.gentoo.org"
-# ifdef __i386__
-# ifdef __UCLIBC__
-# define DEFAULT_PORTAGE_BINHOST URL "/uclibc/i386"
+# undef URL_BASE
+# define URL_BASE "http://tinderbox.dev.gentoo.org"
+
+# undef URL_PROFILE
+# ifdef __UCLIBC__
+# define URL_PROFILE "uclibc"
+# else
+# ifdef __SSP__
+# define URL_PROFILE "hardened"
+# else
+# define URL_PROFILE "default/linux"
+# endif
+# endif
+
+# undef URL_ARCH
+# if 0
+# elif defined(__alpha__)
+# define URL_ARCH "alpha"
+# elif defined(__x86_64__)
+# define URL_ARCH "amd64"
+# elif defined(__arm__)
+# define URL_ARCH "arm"
+# elif defined(__aarch64__)
+# define URL_ARCH "arm64"
+# elif defined(__bfin__)
+# define URL_ARCH "bfin"
+# elif defined(__cris__)
+# define URL_ARCH "cris"
+# elif defined(__hppa__)
+# define URL_ARCH "hppa"
+# elif defined(__ia64__)
+# define URL_ARCH "ia64"
+# elif defined(__m68k__)
+# define URL_ARCH "m68k"
+# elif defined(__mips__)
+# define URL_ARCH "mips"
+# elif defined(__powerpc__)
+# if defined(__powerpc64__)
+# define URL_ARCH "ppc64"
# else
-# ifdef __SSP__
-# define DEFAULT_PORTAGE_BINHOST URL "/hardened/x86"
-# else
-# define DEFAULT_PORTAGE_BINHOST URL "/default-linux/x86/All"
-# endif
+# define URL_ARCH "ppc"
# endif
-# if defined(__powerpc__) && defined(__SSP__)
-# if !defined(__UCLIBC__)
-# define DEFAULT_PORTAGE_BINHOST URL "/hardened/ppc"
-# else
-# define DEFAULT_PORTAGE_BINHOST URL "/uclibc/ppc"
-# endif
+# elif defined(__s390__)
+# if defined(__s390x__)
+# define URL_ARCH "s390x"
+# else
+# define URL_ARCH "s390"
# endif
+# elif defined(__sh4__)
+# define URL_ARCH "sh"
+# elif defined(__sparc__)
+# define URL_ARCH "sparc"
+# elif defined(__i386__)
+# define URL_ARCH "x86"
+# endif
+
+# if defined(URL_PROFILE) && defined(URL_ARCH)
+# define DEFAULT_PORTAGE_BINHOST URL_BASE "/" URL_PROFILE "/" URL_ARCH
# endif
#endif
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: bc4ec7b25478551ea150794f4990c01c2424c3cf
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 06:57:41 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 06:57:41 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=bc4ec7b2
qmerge: fix has_version definition -- qlist always exits 0, but writes updates to stdout
---
qmerge.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 1c5aaaa..35be0f3 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.134 2014/02/18 04:32:52 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.135 2014/02/18 06:57:41 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -65,7 +65,7 @@ static const char * const qmerge_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.134 2014/02/18 04:32:52 vapier Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.135 2014/02/18 06:57:41 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char search_pkgs = 0;
@@ -437,7 +437,7 @@ pkg_run_func(const char *vdb_path, const char *phases, const char *func, const c
"debug-print-function() { :; }\n"
"debug-print-section() { :; }\n"
/* Not quite right */
- "has_version() { qlist -ICq -e '$1' >/dev/null; }\n"
+ "has_version() { [ -n \"$(qlist -ICqe \"$1\")\" ]; }\n"
/* best_version() */
"use() { useq \"$@\"; }\n"
"usex() { useq \"$1\" && echo \"${2-yes}$4\" || echo \"${3-no}$5\"; }\n"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 4d597a585db0fa017b373d2e096906b3df85fee3
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 7 19:48:45 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jan 7 19:48:45 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=4d597a58
qcache/qcheck: use O_CLOEXEC in more places
---
qcache.c | 8 ++++----
qcheck.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/qcache.c b/qcache.c
index 1d9a6eb..1218417 100644
--- a/qcache.c
+++ b/qcache.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/qcache.c,v 1.46 2013/09/29 18:40:22 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcache.c,v 1.47 2014/01/07 19:48:45 vapier Exp $
*
* Copyright 2006 Thomas A. Cort - <tcort@gentoo.org>
*/
@@ -47,7 +47,7 @@ static const char * const qcache_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qcache_rcsid[] = "$Id: qcache.c,v 1.46 2013/09/29 18:40:22 vapier Exp $";
+static const char qcache_rcsid[] = "$Id: qcache.c,v 1.47 2014/01/07 19:48:45 vapier Exp $";
#define qcache_usage(ret) usage(ret, QCACHE_FLAGS, qcache_long_opts, qcache_opts_help, lookup_applet_idx("qcache"))
/********************************************************************/
@@ -236,7 +236,7 @@ static unsigned int qcache_count_lines(char *filename)
int count, fd;
char c;
- if ((fd = open(filename, O_RDONLY)) != -1) {
+ if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) != -1) {
count = 0;
while (read(fd, &c, 1) == 1)
@@ -274,7 +274,7 @@ char **qcache_read_lines(char *filename)
len = sizeof(char*) * (num_lines + 1);
lines = xzalloc(len);
- if ((fd = open(filename, O_RDONLY)) != -1) {
+ if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) != -1) {
for (i = 0; i < num_lines; i++) {
count = 0;
diff --git a/qcheck.c b/qcheck.c
index a224a72..0cb5afe 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2011 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.58 2013/04/21 04:28:10 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.59 2014/01/07 19:48:45 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2011 Mike Frysinger - <vapier@gentoo.org>
@@ -36,7 +36,7 @@ static const char * const qcheck_opts_help[] = {
"Undo prelink when calculating checksums",
COMMON_OPTS_HELP
};
-static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.58 2013/04/21 04:28:10 vapier Exp $";
+static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.59 2014/01/07 19:48:45 vapier Exp $";
#define qcheck_usage(ret) usage(ret, QCHECK_FLAGS, qcheck_long_opts, qcheck_opts_help, lookup_applet_idx("qcheck"))
#define qcprintf(fmt, args...) if (!state->bad_only) printf(_(fmt), ## args)
@@ -71,7 +71,7 @@ static int qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_sta
fpx = NULL;
- fd = q_vdb_pkg_openat(pkg_ctx, "CONTENTS", O_RDONLY);
+ fd = q_vdb_pkg_openat(pkg_ctx, "CONTENTS", O_RDONLY|O_CLOEXEC);
if (fd == -1)
return EXIT_SUCCESS;
if (fstat(fd, &cst)) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 6b7e1d8f6a033b8ee25d422be8053280b0e0f248
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 06:58:13 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 06:58:13 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=6b7e1d8f
qmerge: add emake/FILESDIR definitions
for now, we disable FILESDIR on the assumption there is no PORTDIR anywhere
---
qmerge.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 35be0f3..63855b6 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.135 2014/02/18 06:57:41 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.136 2014/02/18 06:58:13 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -65,7 +65,7 @@ static const char * const qmerge_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.135 2014/02/18 06:57:41 vapier Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.136 2014/02/18 06:58:13 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char search_pkgs = 0;
@@ -453,11 +453,13 @@ pkg_run_func(const char *vdb_path, const char *phases, const char *func, const c
"die() { eerror \"$@\"; exit 1; }\n"
"ebegin() { printf ' * %%b ...' \"$*\"; }\n"
"eend() { local r=${1:-$?}; [ $# -gt 0 ] && shift; [ $r -eq 0 ] && echo ' [ ok ]' || echo \" $* \"'[ !! ]'; return $r; }\n"
+ "emake() { ${MAKE:-make} ${MAKEOPTS} \"$@\"; }\n"
/* Unpack the env if need be */
"[ -e '%1$s/environment' ] || { bzip2 -dc '%1$s/environment.bz2' > '%1$s/environment' || exit 1; }\n"
/* Load the main env */
". '%1$s/environment'\n"
/* Reload env vars that matter to us */
+ "FILESDIR=/.does/not/exist/anywhere\n"
"MERGE_TYPE=binary\n"
"ROOT='%4$s'\n"
"EROOT=\"${EPREFIX%%/}/${ROOT#/}\"\n"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 7b6a61e8015aa5790cd0a8e1f58a0bf442b88955
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 06:59:05 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 06:59:05 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=7b6a61e8
qmerge: add --debug option for auto running shell through `set -x`
---
qmerge.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 479c551..1a44e46 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.137 2014/02/18 06:58:45 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.138 2014/02/18 06:59:05 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -48,6 +48,7 @@ static struct option const qmerge_long_opts[] = {
{"yes", no_argument, NULL, 'y'},
{"nodeps", no_argument, NULL, 'O'},
{"nomd5", no_argument, NULL, '5'},
+ {"debug", no_argument, NULL, 128},
COMMON_LONG_OPTS
};
@@ -62,10 +63,11 @@ static const char * const qmerge_opts_help[] = {
"Don't prompt before overwriting",
"Don't merge dependencies",
"Don't verify MD5 digest of files",
+ "Run shell funcs with `set -x`",
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.137 2014/02/18 06:58:45 vapier Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.138 2014/02/18 06:59:05 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char search_pkgs = 0;
@@ -77,6 +79,7 @@ char follow_rdepends = 1;
char nomd5 = 0;
char qmerge_strict = 0;
char update_only = 0;
+bool debug = false;
const char Packages[] = "Packages";
/*
@@ -467,10 +470,16 @@ pkg_run_func(const char *vdb_path, const char *phases, const char *func, const c
"ED=\"${EPREFIX%%/}/${D#/}\"\n"
"T='%6$s'\n"
/* Finally run the func */
- "%2$s\n"
+ "%7$s%2$s\n"
/* Ignore func return values (not exit values) */
":",
- vdb_path, func, phase, portroot, D, T);
+ /*1*/ vdb_path,
+ /*2*/ func,
+ /*3*/ phase,
+ /*4*/ portroot,
+ /*5*/ D,
+ /*6*/ T,
+ /*7*/ debug ? "set -x;" : "");
xsystembash(script);
free(script);
}
@@ -1961,6 +1970,7 @@ int qmerge_main(int argc, char **argv)
case 'y': interactive = 0; break;
case 'O': follow_rdepends = 0; break;
case '5': nomd5 = 1; break;
+ case 128: debug = true; break;
COMMON_GETOPTS_CASES(qmerge)
}
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: e0bf9bdb6a07eca93015f99731211c19eca002c5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 25 21:30:50 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 25 21:30:50 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=e0bf9bdb
add support for setting ROOT via cmdline --root flag http://crbug.com/336871
---
main.c | 7 +++++--
q.c | 17 +++++++++--------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/main.c b/main.c
index 828c10f..38a447e 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.231 2014/02/18 07:31:33 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.232 2014/02/25 21:30:50 vapier Exp $
*
* Copyright 2005-2008 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2013 Mike Frysinger - <vapier@gentoo.org>
@@ -83,6 +83,7 @@ void no_colors(void)
/* Common usage for all applets */
#define COMMON_FLAGS "vqChV"
#define COMMON_LONG_OPTS \
+ {"root", a_argument, NULL, 0x1}, \
{"verbose", no_argument, NULL, 'v'}, \
{"quiet", no_argument, NULL, 'q'}, \
{"nocolor", no_argument, NULL, 'C'}, \
@@ -90,6 +91,7 @@ void no_colors(void)
{"version", no_argument, NULL, 'V'}, \
{NULL, no_argument, NULL, 0x0}
#define COMMON_OPTS_HELP \
+ "Set the ROOT env var", \
"Make a lot of noise", \
"Tighter output; suppress warnings", \
"Don't output color", \
@@ -97,6 +99,7 @@ void no_colors(void)
"Print version and exit", \
NULL
#define COMMON_GETOPTS_CASES(applet) \
+ case 0x1: portroot = optarg; break; \
case 'v': ++verbose; break; \
case 'q': ++quiet; if (freopen("/dev/null", "w", stderr)) { /* ignore errors */ } break; \
case 'V': version_barf( applet ## _rcsid ); break; \
@@ -137,7 +140,7 @@ static void usage(int status, const char *flags, struct option const opts[],
assert(help[i] != NULL);
/* first output the short flag if it has one */
- if (opts[i].val > '~')
+ if (opts[i].val > '~' || opts[i].val < ' ')
printf(" ");
else
printf(" -%c, ", opts[i].val);
diff --git a/q.c b/q.c
index c0494e4..a4a0012 100644
--- a/q.c
+++ b/q.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/q.c,v 1.52 2011/03/17 03:32:51 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/q.c,v 1.53 2014/02/25 21:30:50 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -22,7 +22,7 @@ static const char * const q_opts_help[] = {
"Module path",
COMMON_OPTS_HELP
};
-static const char q_rcsid[] = "$Id: q.c,v 1.52 2011/03/17 03:32:51 vapier Exp $";
+static const char q_rcsid[] = "$Id: q.c,v 1.53 2014/02/25 21:30:50 vapier Exp $";
#define q_usage(ret) usage(ret, Q_FLAGS, q_long_opts, q_opts_help, lookup_applet_idx("q"))
static APPLET lookup_applet(const char *applet)
@@ -145,16 +145,17 @@ int q_main(int argc, char **argv)
return 1;
/* In case of "q --option ... appletname ...", remove appletname from the
- * applet's args, exchange "appletname" and "--option". */
+ * applet's args. */
if (optind > 1) {
- char* appletname = argv[optind];
- argv[optind] = argv[1];
- argv[1] = appletname;
- }
+ argv[0] = argv[optind];
+ for (i = optind; i < argc; ++i)
+ argv[i] = argv[i + 1];
+ } else
+ ++argv;
optind = 0; /* reset so the applets can call getopt */
- return (func)(argc - 1, ++argv);
+ return (func)(argc - 1, argv);
}
static int run_applet_l(const char *arg, ...)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 9158e82a16eb224d4654de94ea896037d332b13e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 07:30:30 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 07:30:30 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=9158e82a
qcache: mark everything static
---
qcache.c | 55 ++++++++++++++++++++++++++++---------------------------
1 file changed, 28 insertions(+), 27 deletions(-)
diff --git a/qcache.c b/qcache.c
index 1218417..e8eedd0 100644
--- a/qcache.c
+++ b/qcache.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/qcache.c,v 1.47 2014/01/07 19:48:45 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcache.c,v 1.48 2014/02/18 07:30:30 vapier Exp $
*
* Copyright 2006 Thomas A. Cort - <tcort@gentoo.org>
*/
@@ -47,7 +47,7 @@ static const char * const qcache_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qcache_rcsid[] = "$Id: qcache.c,v 1.47 2014/01/07 19:48:45 vapier Exp $";
+static const char qcache_rcsid[] = "$Id: qcache.c,v 1.48 2014/02/18 07:30:30 vapier Exp $";
#define qcache_usage(ret) usage(ret, QCACHE_FLAGS, qcache_long_opts, qcache_opts_help, lookup_applet_idx("qcache"))
/********************************************************************/
@@ -100,7 +100,7 @@ enum { none = 0, testing, stable, minus };
* OUT:
* int - one of the following enum { none = 0, testing, stable, minus };
*/
-int decode_status(char c);
+_q_static
int decode_status(char c)
{
switch (c) {
@@ -120,7 +120,7 @@ int decode_status(char c)
* OUT:
* int pos - location of arch in archlist[]
*/
-int decode_arch(const char *arch);
+_q_static
int decode_arch(const char *arch)
{
int a;
@@ -146,8 +146,8 @@ int decode_arch(const char *arch)
* char *category - current category of the current package
* int *keywords - an array of keywords that coincides with archlist
*/
-void print_keywords(char *category, char *ebuild, int *keywords);
-void print_keywords(char *category, char *ebuild, int *keywords)
+_q_static
+void print_keywords(const char *category, const char *ebuild, int *keywords)
{
int a;
char *package;
@@ -184,7 +184,7 @@ void print_keywords(char *category, char *ebuild, int *keywords)
* ERR:
* int rc - -1 is returned on error (if !s || !keywords)
*/
-int read_keywords(char *s, int *keywords);
+_q_static
int read_keywords(char *s, int *keywords)
{
char *arch, delim[2] = { ' ', '\0' };
@@ -231,7 +231,8 @@ int read_keywords(char *s, int *keywords)
* ERR:
* -1 is returned if the file cannot be read.
*/
-static unsigned int qcache_count_lines(char *filename)
+_q_static
+unsigned int qcache_count_lines(char *filename)
{
int count, fd;
char c;
@@ -262,7 +263,7 @@ static unsigned int qcache_count_lines(char *filename)
* ERR:
* NULL is returned if an error occurs.
*/
-char **qcache_read_lines(char *filename);
+_q_static
char **qcache_read_lines(char *filename)
{
int len, fd, count, i, num_lines;
@@ -302,7 +303,7 @@ char **qcache_read_lines(char *filename)
*
* free()'s memory allocated by qcache_read_lines
*/
-void qcache_free_lines(char **lines);
+_q_static
void qcache_free_lines(char **lines)
{
int i;
@@ -325,7 +326,7 @@ void qcache_free_lines(char **lines)
* ERR:
* NULL is returned when an error occurs.
*/
-portage_cache *qcache_read_cache_file(const char *filename);
+_q_static
portage_cache *qcache_read_cache_file(const char *filename)
{
struct stat s;
@@ -396,7 +397,7 @@ portage_cache *qcache_read_cache_file(const char *filename)
return ret;
-err:
+ err:
if (ret)
cache_free(ret);
return NULL;
@@ -410,7 +411,7 @@ err:
* IN:
* portage_cache *cache - the portage_cache to be free()'d
*/
-void qcache_free_data(portage_cache *cache);
+_q_static
void qcache_free_data(portage_cache *cache)
{
int i;
@@ -444,7 +445,7 @@ void qcache_free_data(portage_cache *cache)
* 1 (OLDER)
* 0 (SAME)
*/
-int qcache_vercmp(const struct dirent **x, const struct dirent **y);
+_q_static
int qcache_vercmp(const struct dirent **x, const struct dirent **y)
{
switch (atom_compare_str((*x)->d_name, (*y)->d_name)) {
@@ -469,7 +470,7 @@ int qcache_vercmp(const struct dirent **x, const struct dirent **y)
* OUT:
* int - 0 if filename begins with '.' or is "metadata.xml", otherwise 1
*/
-int qcache_file_select(const struct dirent *entry);
+_q_static
int qcache_file_select(const struct dirent *entry)
{
return !(entry->d_name[0] == '.' || (strcmp(entry->d_name, "metadata.xml") == 0) || (strstr(entry->d_name, ".cpickle") != 0));
@@ -485,7 +486,7 @@ int qcache_file_select(const struct dirent *entry)
* OUT:
* int - 1 if the filename ends in ".ebuild", otherwise 0
*/
-int qcache_ebuild_select(const struct dirent *entry);
+_q_static
int qcache_ebuild_select(const struct dirent *entry)
{
return ((strlen(entry->d_name) > 7) && !strcmp(entry->d_name+strlen(entry->d_name)-7, ".ebuild"));
@@ -507,7 +508,7 @@ int qcache_ebuild_select(const struct dirent *entry)
* ERR:
* exit or return -1 on failure.
*/
-int qcache_traverse(void (*func)(qcache_data*));
+_q_static
int qcache_traverse(void (*func)(qcache_data*))
{
qcache_data data;
@@ -625,7 +626,7 @@ int qcache_traverse(void (*func)(qcache_data*))
/* functors */
/********************************************************************/
-void qcache_imlate(qcache_data *data);
+_q_static
void qcache_imlate(qcache_data *data)
{
int *keywords;
@@ -657,7 +658,7 @@ void qcache_imlate(qcache_data *data)
free(keywords);
}
-void qcache_not(qcache_data *data);
+_q_static
void qcache_not(qcache_data *data)
{
int *keywords;
@@ -679,7 +680,7 @@ void qcache_not(qcache_data *data)
free(keywords);
}
-void qcache_all(qcache_data *data);
+_q_static
void qcache_all(qcache_data *data)
{
int *keywords;
@@ -700,7 +701,7 @@ void qcache_all(qcache_data *data)
free(keywords);
}
-void qcache_dropped(qcache_data *data);
+_q_static
void qcache_dropped(qcache_data *data)
{
static int possible = 0;
@@ -741,7 +742,7 @@ void qcache_dropped(qcache_data *data)
free(keywords);
}
-void qcache_stats(qcache_data *data);
+_q_static
void qcache_stats(qcache_data *data)
{
static time_t runtime;
@@ -855,7 +856,7 @@ void qcache_stats(qcache_data *data)
}
}
-void qcache_testing_only(qcache_data *data);
+_q_static
void qcache_testing_only(qcache_data *data)
{
static int possible = 0;
@@ -903,8 +904,8 @@ void qcache_testing_only(qcache_data *data)
* ERR:
* -1 is returned on error.
*/
-int qcache_init();
-int qcache_init()
+_q_static
+int qcache_init(void)
{
char *filename;
unsigned int len;
@@ -933,8 +934,8 @@ int qcache_init()
*
* Deallocate variables (archlist)
*/
-void qcache_free();
-void qcache_free()
+_q_static
+void qcache_free(void)
{
qcache_free_lines(archlist);
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 6164509ba7996db4d9752f8d7fbba59d165222fe
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 07:33:20 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 07:33:20 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=6164509b
update ignores of old files
---
.cvsignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.cvsignore b/.cvsignore
index 54534d0..75310f6 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -18,13 +18,13 @@ configure
autotools
Makefile.in
+*.old.c
q
qatom
qcache
qcheck
qdepends
qfile
-qfile.old.c
qglsa
qgrep
qlist
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 005c787741d0506fbbd497c91a6f643f178bb7da
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 06:58:45 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 06:58:45 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=005c7877
qmerge: auto fix local Packages files via `emaint binhost --fix`
---
qmerge.c | 55 +++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 43 insertions(+), 12 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 63855b6..479c551 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.136 2014/02/18 06:58:13 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.137 2014/02/18 06:58:45 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -65,7 +65,7 @@ static const char * const qmerge_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.136 2014/02/18 06:58:13 vapier Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.137 2014/02/18 06:58:45 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char search_pkgs = 0;
@@ -1378,7 +1378,7 @@ pkg_fetch(int level, const depend_atom *atom, const struct pkg_t *pkg)
}
if (access(buf, R_OK) == 0) {
if (!pkg->SHA1[0] && !pkg->MD5[0]) {
- warn("No checksum data for %s", buf);
+ warn("No checksum data for %s (try `emaint binhost --fix`)", buf);
return;
} else {
if (pkg_verify_checksums(buf, pkg, atom, qmerge_strict, !quiet) == 0) {
@@ -1520,20 +1520,51 @@ _q_static FILE *
open_binpkg_index(void)
{
FILE *fp;
- char buf[BUFSIZ];
+ char *path;
- snprintf(buf, sizeof(buf), "%s/portage/%s", port_tmpdir, Packages);
- fp = fopen(buf, "r");
+ xasprintf(&path, "%s/portage/%s", port_tmpdir, Packages);
+ fp = fopen(path, "r");
if (fp)
- return fp;
+ goto done;
+ free(path);
- snprintf(buf, sizeof(buf), "%s/%s", pkgdir, Packages);
- fp = fopen(buf, "r");
+ xasprintf(&path, "%s/%s", pkgdir, Packages);
+ fp = fopen(path, "r");
if (fp)
- return fp;
+ goto done;
- errp("Unable to open package file %s in %s/portage or %s",
+ /* This is normal when installing from local repo only. */
+ warnp("Unable to open package file %s in %s/portage or %s",
Packages, port_tmpdir, pkgdir);
+ warn("Attempting to manually regen via `emaint binhost`");
+
+ pid_t p;
+ int status;
+
+ char argv_emaint[] = "emaint";
+ char argv_binhost[] = "binhost";
+ char argv_fix[] = "--fix";
+ char *argv[] = {
+ argv_emaint,
+ argv_binhost,
+ argv_fix,
+ NULL,
+ };
+
+ p = vfork();
+ switch (p) {
+ case 0:
+ _exit(execvp(argv[0], argv));
+ case -1:
+ errp("vfork failed");
+ }
+ waitpid(p, &status, 0);
+
+ fp = fopen(path, "r");
+
+ done:
+ free(path);
+ return fp;
}
_q_static struct pkg_t *
@@ -1812,7 +1843,7 @@ parse_packages(queue *todo)
free(buf);
fclose(fp);
- return 0;
+ return EXIT_SUCCESS;
}
_q_static queue *
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: be732fdeed85a315cf2f7e53ddd25354fd358c66
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 07:00:35 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 07:00:35 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=be732fde
add TODO for installing a binpkg directly
---
TODO | 1 +
1 file changed, 1 insertion(+)
diff --git a/TODO b/TODO
index 4bb86fb..86445a4 100644
--- a/TODO
+++ b/TODO
@@ -26,6 +26,7 @@
- parallel fetch tbz2s
- check order of pkg_{pre,post}{inst,rm} during install, unmerge, and upgrade
- env is not saved/restored between pkg_{pre,post}inst (see portage and REPO_LAYOUT_CONF_WARN)
+ - support installing via path to tbz2 package
- atoms:
- only 32bit values are supported for revision (-r#)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-08 5:51 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 53eb581c73a37cee5dbff7dd36f6c47379d97c02
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 07:31:33 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 07:31:33 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=53eb581c
build with -Wold-style-definition to weed out old bad func definitions
---
Makefile | 5 +++--
main.c | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 717352d..bda2deb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Copyright 2005-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.76 2013/09/29 22:12:51 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.77 2014/02/18 07:31:33 vapier Exp $
####################################################################
check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
@@ -13,7 +13,8 @@ WFLAGS := -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \
-Wchar-subscripts -Wcast-align -Wno-format-nonliteral \
$(call check_gcc, -Wsequence-point) \
$(call check_gcc, -Wextra) \
- $(call check_gcc, -Wno-sign-compare)
+ $(call check_gcc, -Wno-sign-compare) \
+ $(call check_gcc, -Wold-style-definition)
CFLAGS ?= -O2 -g -pipe
CFLAGS += -std=gnu99
diff --git a/main.c b/main.c
index e87dbee..828c10f 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.230 2014/02/18 07:26:14 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.231 2014/02/18 07:31:33 vapier Exp $
*
* Copyright 2005-2008 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2013 Mike Frysinger - <vapier@gentoo.org>
@@ -69,8 +69,8 @@ void init_coredumps(void)
/* include common library code */
#include "libq/libq.c"
-void no_colors(void);
-void no_colors()
+_q_static
+void no_colors(void)
{
/* echo $(awk '{print $4,"="}' libq/colors.c | grep ^* |cut -c 2-| grep ^[A-Z] |tr '\n' ' ') = \"\"\; */
BOLD = NORM = BLUE = DKBLUE = CYAN = GREEN = DKGREEN = MAGENTA = RED = YELLOW = BRYELLOW = WHITE = "";
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 6:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 6:00 UTC (permalink / raw
To: gentoo-commits
commit: 894976158d7c2cbc854304f05c9945626bb507fd
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 27 00:52:10 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Feb 27 00:52:10 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=89497615
fix indentation
---
main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index bb510a8..a9b5403 100644
--- a/main.c
+++ b/main.c
@@ -807,8 +807,8 @@ void initialize_portage_env(void)
enum {
CACHE_EBUILD = 1,
CACHE_METADATA = 2,
- CACHE_METADATA_PMS = 10,
- CACHE_METADATA_MD5 = 11,
+ CACHE_METADATA_PMS = 10,
+ CACHE_METADATA_MD5 = 11,
};
int filter_hidden(const struct dirent *dentry);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 6:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 6:00 UTC (permalink / raw
To: gentoo-commits
commit: 6cdfe87e10e9abbe03eba7a680dfb8aee1fafbf0
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 27 21:32:28 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Feb 27 21:32:28 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=6cdfe87e
qlist: drop old -L flag from options
---
qlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qlist.c b/qlist.c
index 5e2c365..a5a4908 100644
--- a/qlist.c
+++ b/qlist.c
@@ -9,7 +9,7 @@
#ifdef APPLET_qlist
-#define QLIST_FLAGS "ISULcDeados" COMMON_FLAGS
+#define QLIST_FLAGS "ISUcDeados" COMMON_FLAGS
static struct option const qlist_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
{"slots", no_argument, NULL, 'S'},
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 6:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 6:00 UTC (permalink / raw
To: gentoo-commits
commit: e849f8b058188b5371cc656056eb0aa32298cd9e
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 28 03:09:39 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 03:09:39 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=e849f8b0
qlist: fix minor memory leaks reported by valgrind
---
qlist.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qlist.c b/qlist.c
index a5a4908..5f8720f 100644
--- a/qlist.c
+++ b/qlist.c
@@ -437,6 +437,9 @@ int qlist_main(int argc, char **argv)
free_sets(state.sets);
}
+ free(state.buf);
+ free(state.atoms);
+
return ret;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 6:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 6:00 UTC (permalink / raw
To: gentoo-commits
commit: b4db4eeb7b8b5e3850fcdf931f1cf2f2b5375598
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 9 21:09:45 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 9 21:09:45 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=b4db4eeb
build: also use -Wold-style-definition w/configure
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 29063cf..8207189 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,7 @@ m4_foreach_w([flag], [
-Wcast-align
-Wno-format-nonliteral
-Wsequence-point
+ -Wold-style-definition
-Wextra
], [
AX_CHECK_COMPILE_FLAG(flag, AS_VAR_APPEND([CFLAGS], " flag"))
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 6:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 6:00 UTC (permalink / raw
To: gentoo-commits
commit: 9884a55a9b8a14e03f9e8d9d73925cea8fc045e2
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 28 06:43:44 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 06:43:44 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=9884a55a
build: regen Makefile.am
---
Makefile.am | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 2be96c8..531c7a0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -125,6 +125,7 @@ EXTRA_DIST += \
libq/xsystem.c \
main.c \
main.h \
+ porting.h \
q.c \
qatom.c \
qcache.c \
@@ -171,6 +172,14 @@ EXTRA_DIST += \
tests/profile/profile1/etc/portage/make.conf \
tests/profile/profile1/etc/portage/subdir/file.conf \
tests/profile/profile1/etc/portage/this.level.conf \
+ tests/qdepends/Makefile \
+ tests/qdepends/dotest \
+ tests/qdepends/list01.good \
+ tests/qdepends/list02.good \
+ tests/qdepends/list03.good \
+ tests/qdepends/list04.good \
+ tests/qdepends/list05.good \
+ tests/qdepends/list06.good \
tests/qfile/Makefile \
tests/qfile/dotest \
tests/qlist/Makefile \
@@ -220,5 +229,6 @@ EXTRA_DIST += \
tests/source/Makefile \
tests/source/dotest \
tests/source/space \
- tests/subdir.mk
+ tests/subdir.mk \
+ tests/tests.h
# @@@ GEN START @@@ #
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 8:45 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 8:45 UTC (permalink / raw
To: gentoo-commits
commit: 054269125460aadf20059019a7a106800160c69a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 10 07:12:02 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 10 07:12:02 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=05426912
eat_file: convert API to work on dynamic buffers
Rather than use static allocated buffers everywhere where we assume we
picked a size big enough for real world uses (and just silently truncate
or die in large edge cases), convert the API to use malloc instead. We
will grow the buffers (never shrink) so that repeat calls should ramp up
to the max quickly and thus avoid having to call malloc() repeatedly.
This might report memory leaks with some funcs as we hold on to some
buffers indefinitely since we know the buffer isn't used outside the
context of the func. Helps out when the func is called repeatedly.
This should make future enhancements (like eating more than one element
in a vdb pkg dir) a lot easier.
---
main.c | 108 +++++++++++++++++++++++++++++++++++++++++--------------------
qdepends.c | 14 ++++----
qfile.c | 9 ++++--
qlist.c | 5 +--
qlop.c | 13 ++++----
qmerge.c | 12 ++++---
6 files changed, 105 insertions(+), 56 deletions(-)
diff --git a/main.c b/main.c
index a9b5403..436387d 100644
--- a/main.c
+++ b/main.c
@@ -10,7 +10,9 @@
#include "main.h"
/* prototypes and such */
-static char eat_file(const char *file, char *buf, const size_t bufsize);
+static bool eat_file(const char *, char **, size_t *);
+static bool eat_file_fd(int, char **, size_t *);
+static bool eat_file_at(int, const char *, char **, size_t *);
int rematch(const char *, const char *, int);
static char *rmspace(char *);
@@ -170,47 +172,70 @@ static void version_barf(void)
exit(EXIT_SUCCESS);
}
-static char eat_file_fd(int fd, char *buf, const size_t bufsize)
+static bool eat_file_fd(int fd, char **bufptr, size_t *bufsize)
{
+ bool ret = true;
struct stat s;
+ char *buf;
+ size_t read_size;
+
+ /* First figure out how much data we should read from the fd. */
+ if (fd == -1 || fstat(fd, &s) != 0) {
+ ret = false;
+ read_size = 0;
+ /* Fall through so we set the first byte 0 */
+ } else if (!s.st_size) {
+ /* We might be trying to eat a virtual file like in /proc, so
+ * read an arbitrary size that should be "enough". */
+ read_size = BUFSIZE;
+ } else
+ read_size = (size_t)s.st_size;
+
+ /* Now allocate enough space (at least 1 byte). */
+ if (!*bufptr || *bufsize < read_size) {
+ /* We assume a min allocation size so that repeat calls don't
+ * hit ugly ramp ups -- if you read a file that is 1 byte, then
+ * 5 bytes, then 10 bytes, then 20 bytes, ... you'll allocate
+ * constantly. So we round up a few pages as wasiting virtual
+ * memory is cheap when it is unused. */
+ *bufsize = ((read_size + 1) + BUFSIZE - 1) & -BUFSIZE;
+ *bufptr = xrealloc(*bufptr, *bufsize);
+ }
+ buf = *bufptr;
+ /* Finally do the actual read. */
buf[0] = '\0';
- if (fstat(fd, &s) != 0)
- return 0;
- if (s.st_size) {
- if (bufsize < (size_t)s.st_size)
- return 0;
- if (read(fd, buf, s.st_size) != (ssize_t)s.st_size)
- return 0;
- buf[s.st_size] = '\0';
- } else {
- if (read(fd, buf, bufsize) == 0)
- return 0;
- buf[bufsize - 1] = '\0';
+ if (read_size) {
+ if (s.st_size) {
+ if (read(fd, buf, read_size) != (ssize_t)read_size)
+ return false;
+ buf[read_size] = '\0';
+ } else {
+ if (read(fd, buf, read_size) == 0)
+ return false;
+ buf[read_size - 1] = '\0';
+ }
}
- return 1;
+ return ret;
}
-static char eat_file_at(int dfd, const char *file, char *buf, const size_t bufsize)
+static bool eat_file_at(int dfd, const char *file, char **bufptr, size_t *bufsize)
{
+ bool ret;
int fd;
- char ret;
- if ((fd = openat(dfd, file, O_CLOEXEC|O_RDONLY)) == -1) {
- buf[0] = '\0';
- return 0;
- }
-
- ret = eat_file_fd(fd, buf, bufsize);
+ fd = openat(dfd, file, O_CLOEXEC|O_RDONLY);
+ ret = eat_file_fd(fd, bufptr, bufsize);
+ if (fd != -1)
+ close(fd);
- close(fd);
return ret;
}
-static char eat_file(const char *file, char *buf, const size_t bufsize)
+static bool eat_file(const char *file, char **bufptr, size_t *bufsize)
{
- return eat_file_at(AT_FDCWD, file, buf, bufsize);
+ return eat_file_at(AT_FDCWD, file, bufptr, bufsize);
}
static bool prompt(const char *p)
@@ -601,7 +626,10 @@ static void read_portage_profile(const char *configroot, const char *profile, en
{
size_t configroot_len, profile_len, sub_len;
char *profile_file, *sub_file;
- char buf[BUFSIZE], *s;
+ char *s;
+
+ static char *buf;
+ static size_t buf_len;
/* initialize the base profile path */
configroot_len = strlen(configroot);
@@ -620,7 +648,7 @@ static void read_portage_profile(const char *configroot, const char *profile, en
/* now walk all the parents */
strcpy(sub_file, "parent");
- if (eat_file(profile_file, buf, sizeof(buf)) == 0)
+ if (eat_file(profile_file, &buf, &buf_len) == 0)
goto done;
rmspace(buf);
@@ -1212,17 +1240,25 @@ char *atom_to_pvr(depend_atom *atom) {
return (atom->PR_int == 0 ? atom->P : atom->PVR );
}
+/* TODO: Delete this in favor of libq/vdb.c API. */
static char *grab_vdb_item(const char *item, const char *CATEGORY, const char *PF)
{
- static char buf[_Q_PATH_MAX];
+ static char *buf;
+ static size_t buf_len;
+
+ if (buf == NULL) {
+ buf_len = _Q_PATH_MAX;
+ buf = xmalloc(buf_len);
+ }
- snprintf(buf, sizeof(buf), "%s%s/%s/%s/%s", portroot, portvdb, CATEGORY, PF, item);
- eat_file(buf, buf, sizeof(buf));
+ snprintf(buf, buf_len, "%s%s/%s/%s/%s", portroot, portvdb, CATEGORY, PF, item);
+ eat_file(buf, &buf, &buf_len);
rmspace(buf);
return buf;
}
+/* TODO: Merge this into libq/vdb.c somehow. */
_q_static queue *get_vdb_atoms(int fullcpv)
{
q_vdb_ctx *ctx;
@@ -1232,6 +1268,7 @@ _q_static queue *get_vdb_atoms(int fullcpv)
char buf[_Q_PATH_MAX];
char slot[_Q_PATH_MAX];
+ size_t slot_len;
struct dirent **cat;
struct dirent **pf;
@@ -1255,11 +1292,12 @@ _q_static queue *get_vdb_atoms(int fullcpv)
if ((atom = atom_explode(buf)) == NULL)
continue;
- slot[0] = '0';
- slot[1] = 0;
+ /* XXX: This assumes static slot buf is big enough, but should be fine
+ * until this is rewritten & merged into libq/vdb.c. */
+ slot_len = sizeof(slot);
strncat(buf, "/SLOT", sizeof(buf));
- eat_file_at(ctx->vdb_fd, buf, buf, sizeof(buf));
- rmspace(buf);
+ eat_file_at(ctx->vdb_fd, buf, (char **)&slot, &slot_len);
+ rmspace(slot);
if (fullcpv) {
if (atom->PR_int)
diff --git a/qdepends.c b/qdepends.c
index eba8304..8a176b6 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -396,7 +396,8 @@ _q_static int qdepends_main_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
int i;
char *ptr;
char buf[_Q_PATH_MAX];
- char depend[65536], use[8192];
+ static char *depend, *use;
+ static size_t depend_len, use_len;
dep_node *dep_tree;
/* see if this cat/pkg is requested */
@@ -412,7 +413,7 @@ _q_static int qdepends_main_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
IF_DEBUG(warn("matched %s/%s", catname, pkgname));
- if (!eat_file_at(pkg_ctx->fd, state->depend_file, depend, sizeof(depend)))
+ if (!eat_file_at(pkg_ctx->fd, state->depend_file, &depend, &depend_len))
return 0;
IF_DEBUG(warn("growing tree..."));
@@ -433,7 +434,7 @@ _q_static int qdepends_main_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
printf("%s%s/%s%s%s: ", BOLD, catname, BLUE, pkgname, NORM);
}
- if (!eat_file_at(pkg_ctx->fd, "USE", use, sizeof(use))) {
+ if (!eat_file_at(pkg_ctx->fd, "USE", &use, &use_len)) {
warn("Could not eat_file(%s), you'll prob have incorrect output", buf);
} else {
for (ptr = use; *ptr; ++ptr)
@@ -466,12 +467,13 @@ _q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
size_t len;
char *ptr;
char buf[_Q_PATH_MAX];
- char depend[16384], use[8192];
+ static char *depend, *use;
+ static size_t depend_len, use_len;
dep_node *dep_tree;
IF_DEBUG(warn("matched %s/%s for %s", catname, pkgname, state->depend_file));
- if (!eat_file_at(pkg_ctx->fd, state->depend_file, depend, sizeof(depend)))
+ if (!eat_file_at(pkg_ctx->fd, state->depend_file, &depend, &depend_len))
return 0;
IF_DEBUG(warn("growing tree..."));
@@ -481,7 +483,7 @@ _q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
IF_DEBUG(puts(depend));
IF_DEBUG(dep_dump_tree(dep_tree));
- if (eat_file_at(pkg_ctx->fd, "USE", use, sizeof(use)) == 1)
+ if (eat_file_at(pkg_ctx->fd, "USE", &use, &use_len))
use[0] = ' ';
for (ptr = use; *ptr; ++ptr)
diff --git a/qfile.c b/qfile.c
index 174cb7d..7094034 100644
--- a/qfile.c
+++ b/qfile.c
@@ -114,7 +114,7 @@ _q_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 */
- eat_file_at(pkg_ctx->fd, "SLOT", state->buf, state->buflen);
+ eat_file_at(pkg_ctx->fd, "SLOT", &state->buf, &state->buflen);
rmspace(state->buf);
if (strcmp(state->exclude_slot, state->buf) == 0)
goto qlist_done; /* "(CAT/)?(PN|PF):SLOT" matches */
@@ -215,8 +215,11 @@ _q_static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
}
}
if (state->slotted) {
- eat_file_at(pkg_ctx->fd, "SLOT", slot+1, sizeof(slot)-1);
- rmspace(slot+1);
+ /* XXX: This assumes the buf is big enough. */
+ char *slot_hack = slot + 1;
+ size_t slot_len = sizeof(slot) - 1;
+ eat_file_at(pkg_ctx->fd, "SLOT", &slot_hack, &slot_len);
+ rmspace(slot_hack);
slot[0] = ':';
} else
slot[0] = '\0';
diff --git a/qlist.c b/qlist.c
index 5f8720f..cfb9d98 100644
--- a/qlist.c
+++ b/qlist.c
@@ -63,9 +63,10 @@ _q_static queue *filter_dups(queue *sets)
_q_static char *q_vdb_pkg_eat(q_vdb_pkg_ctx *pkg_ctx, const char *item)
{
- static char buf[_Q_PATH_MAX];
+ static char *buf;
+ static size_t buf_len;
- eat_file_at(pkg_ctx->fd, item, buf, sizeof(buf));
+ eat_file_at(pkg_ctx->fd, item, &buf, &buf_len);
rmspace(buf);
return buf;
diff --git a/qlop.c b/qlop.c
index 21e272d..d5e2226 100644
--- a/qlop.c
+++ b/qlop.c
@@ -385,7 +385,8 @@ void show_current_emerge(void)
DIR *proc;
struct dirent *de;
pid_t pid;
- char buf[BUFSIZE], bufstat[300];
+ static char *cmdline, *bufstat;
+ static size_t cmdline_len, bufstat_len;
char path[50];
char *p, *q;
unsigned long long start_time = 0;
@@ -407,17 +408,17 @@ void show_current_emerge(void)
/* portage renames the cmdline so the package name is first */
snprintf(path, sizeof(path), "/proc/%i/cmdline", pid);
- if (!eat_file(path, buf, sizeof(buf)))
+ if (!eat_file(path, &cmdline, &cmdline_len))
continue;
- if (buf[0] == '[' && (p = strchr(buf, ']')) != NULL && strstr(buf, "sandbox") != NULL) {
+ if (cmdline[0] == '[' && (p = strchr(cmdline, ']')) != NULL && strstr(cmdline, "sandbox") != NULL) {
*p = '\0';
- p = buf+1;
+ p = cmdline + 1;
q = p + strlen(p) + 1;
/* open the stat file to figure out how long we have been running */
snprintf(path, sizeof(path), "/proc/%i/stat", pid);
- if (!eat_file(path, bufstat, sizeof(bufstat)))
+ if (!eat_file(path, &bufstat, &bufstat_len))
continue;
/* ripped from procps/proc/readproc.c */
@@ -435,7 +436,7 @@ void show_current_emerge(void)
"%llu ",
&start_time);
/* get uptime */
- if (!eat_file("/proc/uptime", bufstat, sizeof(bufstat)))
+ if (!eat_file("/proc/uptime", &bufstat, &bufstat_len))
continue;
sscanf(bufstat, "%lf", &uptime_secs);
diff --git a/qmerge.c b/qmerge.c
index 1e07347..165caa9 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -754,7 +754,9 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
{
queue *objs;
FILE *fp, *contents;
- char buf[1024], phases[128];
+ static char *phases;
+ static size_t phases_len;
+ char buf[1024];
char *tbz2, *p, *D, *T;
int i;
char **ARGV;
@@ -891,7 +893,7 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
xsystem(buf);
fflush(stdout);
- eat_file("vdb/DEFINED_PHASES", phases, sizeof(phases));
+ eat_file("vdb/DEFINED_PHASES", &phases, &phases_len);
pkg_run_func("vdb", phases, "pkg_pretend", D, T);
pkg_run_func("vdb", phases, "pkg_setup", D, T);
pkg_run_func("vdb", phases, "pkg_preinst", D, T);
@@ -1019,7 +1021,9 @@ _q_static int
pkg_unmerge(const char *cat, const char *pkgname, queue *keep)
{
size_t buflen;
- char *buf, *vdb_path, *T, phases[128];
+ static char *phases;
+ static size_t phases_len;
+ char *buf, *vdb_path, *T;
FILE *fp;
int ret, fd, vdb_fd, portroot_fd;
int cp_argc, cpm_argc;
@@ -1061,7 +1065,7 @@ pkg_unmerge(const char *cat, const char *pkgname, queue *keep)
/* First execute the pkg_prerm step */
if (!pretend) {
- eat_file_at(vdb_fd, "DEFINED_PHASES", phases, sizeof(phases));
+ eat_file_at(vdb_fd, "DEFINED_PHASES", &phases, &phases_len);
mkdir_p(T, 0755);
pkg_run_func(vdb_path, phases, "pkg_prerm", T, T);
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 8:45 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 8:45 UTC (permalink / raw
To: gentoo-commits
commit: f9696bacb5d3feb2a1f7fce75e60ca1c692f37bf
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 10 07:08:43 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 10 07:08:43 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=f9696bac
qmerge: fix color used in displaying downgrades
We want to use a darker blue for D status instead of using the same
blue color as U status. This also matches portage behavior.
---
qmerge.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 572365e..1e07347 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -357,6 +357,7 @@ qprint_tree_node(int level, const depend_atom *atom, const struct pkg_t *pkg)
char install_ver[126] = "";
char c = 'N';
+ const char *color;
if (!pretend)
return 0;
@@ -385,10 +386,13 @@ qprint_tree_node(int level, const depend_atom *atom, const struct pkg_t *pkg)
return c;
if ((c == 'R' || c == 'D') && update_only && level)
return c;
- if (c == 'R')
- snprintf(buf, sizeof(buf), "%s%c%s", YELLOW, c, NORM);
- if (c == 'U' || c == 'D')
- snprintf(buf, sizeof(buf), "%s%c%s", BLUE, c, NORM);
+ switch (c) {
+ case 'R': color = YELLOW; break;
+ case 'U': color = BLUE; break;
+ case 'D': color = DKBLUE; break;
+ default: color = RED; break;
+ }
+ snprintf(buf, sizeof(buf), "%s%c%s", color, c, NORM);
#if 0
if (level) {
switch (c) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-10 8:45 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-10 8:45 UTC (permalink / raw
To: gentoo-commits
commit: b5b6a47bc9d24bd8869b1e5562f786227a6b828b
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 10 08:41:56 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 10 08:41:56 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=b5b6a47b
build: fix tarball/name creation with git tags
---
make-tarball.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make-tarball.sh b/make-tarball.sh
index 143a927..02cc501 100755
--- a/make-tarball.sh
+++ b/make-tarball.sh
@@ -26,7 +26,7 @@ git) ver="HEAD" ;;
fi
;;
esac
-p="portage-utils-$ver"
+p="portage-utils-${ver#v}"
rm -rf "${p}"
mkdir "${p}"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-11 4:53 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-11 4:53 UTC (permalink / raw
To: gentoo-commits
commit: 206a802baa29af093ca086a08f1d9aa5d9c91737
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 11 04:34:36 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Mar 11 04:34:36 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=206a802b
build: use -fsanitize=address when doing a debug build
Will help track down memory errors nicely.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index d202f54..79a19eb 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ CFLAGS ?= -O2 -g -pipe
CFLAGS += -std=gnu99
CPPFLAGS ?=
CPPFLAGS += -DENABLE_NLS=$(call istrue,$(NLS))
-#CFLAGS += -DEBUG -g
+DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc, -fsanitize=address)
#CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2 -falign-labels=2 -falign-loops=2
#LDFLAGS := -pie
LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo '-lkvm')
@@ -62,7 +62,7 @@ all: q
@true
debug:
- $(MAKE) CFLAGS="$(CFLAGS) -O0 -DEBUG -g3 -ggdb -fno-pie" clean symlinks
+ $(MAKE) CFLAGS="$(CFLAGS) $(DBG_CFLAGS)" clean symlinks
@-scanelf -o /dev/null -BXxz permsx q
q: $(SRC) libq/*.c *.h libq/*.h
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-11 4:53 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-11 4:53 UTC (permalink / raw
To: gentoo-commits
commit: 6f1994cabd7a3fe37ccb50d2036ebed5748bcf32
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 11 04:46:41 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> 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);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-15 6:02 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-15 6:02 UTC (permalink / raw
To: gentoo-commits
commit: 7edb85827c65468248d3d3352546fc076e822550
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 15 05:54:06 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Mar 15 05:54:06 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=7edb8582
qdepends: fix assert after eat_file rework
The assert no longer makes sense since the buffer is dynamically
allocated. Rework the logic to handle any sized buffer.
URL: https://bugs.gentoo.org/504636
---
qdepends.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/qdepends.c b/qdepends.c
index bc51e02..96f757b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -484,13 +484,16 @@ _q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
IF_DEBUG(dep_dump_tree(dep_tree));
if (q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len))
- use[0] = ' ';
+ use[0] = '\0';
for (ptr = use; *ptr; ++ptr)
if (*ptr == '\n' || *ptr == '\t')
*ptr = ' ';
- len = strlen(use);
- assert(len+1 < sizeof(use));
+ len = ptr - use;
+ if (len == use_len) {
+ use_len += BUFSIZE;
+ use = xrealloc(use, use_len);
+ }
use[len] = ' ';
use[len+1] = '\0';
memmove(use+1, use, len);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-16 6:14 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-16 6:14 UTC (permalink / raw
To: gentoo-commits
commit: 8f59ad7b9e732fa41f29c9c23ea42f68546d32ec
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 06:07:49 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 06:07:49 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=8f59ad7b
qlist: speed up -U flag slightly
No need to clear the whole buffer when we use this as a normal C string.
---
qlist.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/qlist.c b/qlist.c
index 0b0714e..fa5e652 100644
--- a/qlist.c
+++ b/qlist.c
@@ -56,7 +56,7 @@ static char *grab_pkg_umap(const char *CAT, const char *PV)
if ((use = grab_vdb_item("USE", CAT, PV)) == NULL)
return NULL;
- memset(umap, 0, sizeof(umap)); /* reset the buffer */
+ umap[0] = '\0'; /* reset the buffer */
/* grab_vdb is a static function so save it to memory right away */
makeargv(use, &use_argc, &use_argv);
@@ -85,8 +85,7 @@ static char *grab_pkg_umap(const char *CAT, const char *PV)
sets = del_set(use_argv[i], sets, &ok);
sets = add_set(use_argv[i], use_argv[i], sets);
}
- memset(umap, 0, sizeof(umap)); /* reset the buffer */
- strcpy(umap, "");
+ umap[0] = '\0'; /* reset the buffer */
for (ll = sets; ll != NULL; ll = ll->next) {
strncat(umap, ll->name, sizeof(umap)-strlen(umap)-1);
strncat(umap, " ", sizeof(umap)-strlen(umap)-1);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-16 6:14 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-16 6:14 UTC (permalink / raw
To: gentoo-commits
commit: b979418e34137c8044614bcbf3a2b25f775f353e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 06:10:34 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 06:10:34 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=b979418e
qlist: fix processing of IUSE
Stripping out all + and - chars is wrong as it means we turn "static-libs"
into "static libs". Make sure we nuke these only when they're the first
char in the flag.
---
qlist.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qlist.c b/qlist.c
index 0ffa716..1373361 100644
--- a/qlist.c
+++ b/qlist.c
@@ -63,9 +63,11 @@ static char *grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
umap[0] = '\0'; /* reset the buffer */
makeargv(use, &use_argc, &use_argv);
+ /* strip out possible leading +/- flags in IUSE */
for (i = 0; i < (int)strlen(iuse); i++)
if (iuse[i] == '+' || iuse[i] == '-')
- iuse[i] = ' ';
+ if (i == 0 || iuse[i - 1] == ' ')
+ iuse[i] = ' ';
makeargv(iuse, &iuse_argc, &iuse_argv);
for (u = 1; u < use_argc; u++) {
for (i = 1; i < iuse_argc; i++) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-16 6:14 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-16 6:14 UTC (permalink / raw
To: gentoo-commits
commit: f09d626416e60d9f87dc1aaf8bb59e1638b483e0
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 06:09:12 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 06:09:12 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=f09d6264
qlist: rewrite -U option to leverage q_vdb_pkg_eat
This lets us kill off most consumers of grab_vdb_item and use the new
vdb API which in turn makes the code cleaner and robust -- it can handle
any sized input file now and leverages the openat helpers.
---
qlist.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/qlist.c b/qlist.c
index fa5e652..0ffa716 100644
--- a/qlist.c
+++ b/qlist.c
@@ -42,39 +42,40 @@ 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"))
-static char *grab_pkg_umap(const char *CAT, const char *PV)
+static char *grab_pkg_umap(q_vdb_pkg_ctx *pkg_ctx)
{
static char umap[BUFSIZ];
- char *use = NULL;
- char *iuse = NULL;
+ static char *use, *iuse;
+ static size_t use_len, iuse_len;
int use_argc = 0, iuse_argc = 0;
char **use_argv = NULL, **iuse_argv = NULL;
queue *ll = NULL;
queue *sets = NULL;
int i, u;
- if ((use = grab_vdb_item("USE", CAT, PV)) == NULL)
+ q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len);
+ if (!use[0])
+ return NULL;
+ q_vdb_pkg_eat(pkg_ctx, "IUSE", &iuse, &iuse_len);
+ if (!iuse[0])
return NULL;
umap[0] = '\0'; /* reset the buffer */
- /* grab_vdb is a static function so save it to memory right away */
makeargv(use, &use_argc, &use_argv);
- if ((iuse = grab_vdb_item("IUSE", CAT, PV)) != NULL) {
- for (i = 0; i < (int)strlen(iuse); i++)
- if (iuse[i] == '+' || iuse[i] == '-')
- iuse[i] = ' ';
- makeargv(iuse, &iuse_argc, &iuse_argv);
- for (u = 1; u < use_argc; u++) {
- for (i = 1; i < iuse_argc; i++) {
- if (strcmp(use_argv[u], iuse_argv[i]) == 0) {
- strncat(umap, use_argv[u], sizeof(umap)-strlen(umap)-1);
- strncat(umap, " ", sizeof(umap)-strlen(umap)-1);
- }
+ for (i = 0; i < (int)strlen(iuse); i++)
+ if (iuse[i] == '+' || iuse[i] == '-')
+ iuse[i] = ' ';
+ makeargv(iuse, &iuse_argc, &iuse_argv);
+ for (u = 1; u < use_argc; u++) {
+ for (i = 1; i < iuse_argc; i++) {
+ if (strcmp(use_argv[u], iuse_argv[i]) == 0) {
+ strncat(umap, use_argv[u], sizeof(umap)-strlen(umap)-1);
+ strncat(umap, " ", sizeof(umap)-strlen(umap)-1);
}
}
- freeargv(iuse_argc, iuse_argv);
}
+ freeargv(iuse_argc, iuse_argv);
freeargv(use_argc, use_argv);
/* filter out the dup use flags */
@@ -97,7 +98,7 @@ static char *grab_pkg_umap(const char *CAT, const char *PV)
return umap;
}
-static const char *umapstr(char display, const char *cat, const char *name)
+static const char *umapstr(char display, q_vdb_pkg_ctx *pkg_ctx)
{
static char buf[BUFSIZ];
char *umap = NULL;
@@ -105,7 +106,7 @@ static const char *umapstr(char display, const char *cat, const char *name)
buf[0] = '\0';
if (!display)
return buf;
- if ((umap = grab_pkg_umap(cat, name)) == NULL)
+ if ((umap = grab_pkg_umap(pkg_ctx)) == NULL)
return buf;
rmspace(umap);
if (!strlen(umap))
@@ -191,7 +192,6 @@ qlist_match(q_vdb_pkg_ctx *pkg_ctx, const char *name, depend_atom **name_atom, b
return false;
}
- /* printf("buf=%s:%s\n", buf,grab_vdb_item("SLOT", catname, pkgname)); */
if (exact) {
int i;
@@ -296,7 +296,7 @@ _q_static int qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
(state->columns ? " " : ""), (state->columns ? atom->PV : ""),
NORM, YELLOW, state->show_slots ? ":" : "", state->show_slots ? pkg_ctx->slot : "", NORM,
NORM, GREEN, state->show_repo ? "::" : "", state->show_repo ? pkg_ctx->repo : "", NORM,
- umapstr(state->show_umap, catname, pkgname));
+ umapstr(state->show_umap, pkg_ctx));
}
if (atom)
atom_implode(atom);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-16 6:34 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-16 6:34 UTC (permalink / raw
To: gentoo-commits
commit: 8e5479494a1df4b326ca9715ee72897d2b98b06f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 06:22:38 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 06:22:38 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=8e547949
q: fix up --install a little
Update the outdated chdir error message, and use O_PATH with the dirfd.
---
q.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/q.c b/q.c
index 849f7ad..394a035 100644
--- a/q.c
+++ b/q.c
@@ -95,7 +95,7 @@ int q_main(int argc, char **argv)
if (install) {
char buf[_Q_PATH_MAX];
- const char *prog;
+ const char *prog, *dir;
ssize_t rret;
int fd, ret;
@@ -115,9 +115,10 @@ int q_main(int argc, char **argv)
buf[rret] = '\0';
prog = basename(buf);
- fd = open(dirname(buf), O_RDONLY|O_CLOEXEC);
+ dir = dirname(buf);
+ fd = open(dir, O_RDONLY|O_CLOEXEC|O_PATH);
if (fd < 0) {
- warnfp("chdir(%s) failed", buf);
+ warnfp("open(%s) failed", dir);
return 1;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-03-16 6:34 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-03-16 6:34 UTC (permalink / raw
To: gentoo-commits
commit: 260d67e07284b53e4d982e071d8463187566f8b2
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 16 06:34:29 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 06:34:29 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=260d67e0
qpkg: document the chdir() usage
---
qpkg.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qpkg.c b/qpkg.c
index 512a4b9..4a5d9fd 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -348,8 +348,6 @@ int qpkg_main(int argc, char **argv)
if (argc == optind)
qpkg_usage(EXIT_FAILURE);
- xchdir(portroot);
-
/* setup temp dirs */
i = 0;
bindir = qpkg_get_bindir();
@@ -368,6 +366,10 @@ retry_mkdir:
errp("could not chmod(0750) temp bindir '%s'", bindir);
}
+ /* we have to change to the root so that we can feed the full paths
+ * to tar when we create the binary package. */
+ xchdir(portroot);
+
/* first process any arguments which point to /var/db/pkg */
pkgs_made = 0;
s = strlen(portvdb);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-06-16 18:01 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-06-16 18:01 UTC (permalink / raw
To: gentoo-commits
commit: 119ad4c193f5689953a32babbc6a3a7eed041f3a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 16 17:49:23 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Jun 16 17:49:23 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=119ad4c1
import more modules from gnulib to handle older systems
URL: https://bugs.gentoo.org/513484
---
Makefile.am | 12 ++++++++++++
autogen.sh | 4 ++++
porting.h | 1 +
3 files changed, 17 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 14bc649..3a33bbe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -179,6 +179,14 @@ EXTRA_DIST += \
tests/qdepends/list04.good \
tests/qdepends/list05.good \
tests/qdepends/list06.good \
+ tests/qdepends/list07.good \
+ tests/qdepends/list08.good \
+ tests/qdepends/root/app-arch/cpio-2.11/CONTENTS \
+ tests/qdepends/root/app-arch/cpio-2.11/SLOT \
+ tests/qdepends/root/app-arch/cpio-2.11/repository \
+ tests/qdepends/root/x11-apps/xdm-1.1.11-r3/DEPEND \
+ tests/qdepends/root/x11-apps/xdm-1.1.11-r3/RDEPEND \
+ tests/qdepends/root/x11-apps/xdm-1.1.11-r3/USE \
tests/qfile/Makefile \
tests/qfile/dotest \
tests/qlist/Makefile \
@@ -196,6 +204,7 @@ EXTRA_DIST += \
tests/qlist/list11.good \
tests/qlist/list12.good \
tests/qlist/list13.good \
+ tests/qlist/list14.good \
tests/qlist/root/-merge-foo/CONTENTS \
tests/qlist/root/a-b/a-0/CONTENTS \
tests/qlist/root/a-b/a-0/SLOT \
@@ -209,6 +218,9 @@ EXTRA_DIST += \
tests/qlist/root/cat/pkg-1/CONTENTS \
tests/qlist/root/cat/pkg-1/SLOT \
tests/qlist/root/cat/pkg-1/repository \
+ tests/qlist/root/cat/sub-2/CONTENTS \
+ tests/qlist/root/cat/sub-2/SLOT \
+ tests/qlist/root/cat/sub-2/repository \
tests/qlist/root/sys-fs/mtools-4.0.13/CONTENTS \
tests/qlist/root/sys-fs/mtools-4.0.13/SLOT \
tests/qlist/root/sys-fs/mtools-4.0.13/repository \
diff --git a/autogen.sh b/autogen.sh
index 903a00c..622ab16 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -12,22 +12,26 @@ fi
# reload the gnulib code if possible
PATH=/usr/local/src/gnu/gnulib:${PATH}
mods="
+ alloca
faccessat
fdopendir
fstatat
futimens
getline
+ getopt-posix
mkdirat
openat
progname
readlinkat
renameat
stat-time
+ strcasestr-simple
strncat
symlinkat
sys_stat
unlinkat
utimensat
+ vasprintf-posix
"
v gnulib-tool \
--source-base=autotools/gnulib --m4-base=autotools/m4 \
diff --git a/porting.h b/porting.h
index 352d3bf..3235542 100644
--- a/porting.h
+++ b/porting.h
@@ -25,6 +25,7 @@
#define _LINUX_SOURCE_COMPAT
#endif
+#include <alloca.h>
#include <assert.h>
#include <ctype.h>
#include <dirent.h>
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2014-10-19 16:56 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2014-10-19 16:56 UTC (permalink / raw
To: gentoo-commits
commit: 4d13a78af43afe479799d2753254802c5f39740a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 19 16:56:04 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Oct 19 16:56:04 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=4d13a78a
gitignore: update
---
.gitignore | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
index 79ad336..769c4a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,11 @@
*bz2
*~
-*.o
+*.[adio]
+*.l[ao]
+*.gdb
+*.pyc
+*.deps
+*.libs
*.patch
*.orig
@@ -9,14 +14,25 @@
/portage-utils-*
contrib
+a.out*
+lib*.so*
+core
+.gdb_history
+.gdbinit
+
aclocal.m4
autom4te.cache
build
+config.cache
config.h
config.h.in
+config.log
+config.status
configure
autotools
+libtool
Makefile.in
+stamp-h1
/*.old.c
/q
@@ -35,8 +51,3 @@ Makefile.in
/qsize
/quse
/qxpak
-
-a.out
-core
-.gdb_history
-.gdbinit
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-19 7:49 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-19 7:49 UTC (permalink / raw
To: gentoo-commits
commit: 502518899f60bde86ba2d2e5c0e400d7142d2096
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 19 07:48:53 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Feb 19 07:48:53 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=50251889
qmerge: add usev & nonfatal
---
qmerge.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/qmerge.c b/qmerge.c
index 165caa9..e4b8f96 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -444,7 +444,8 @@ pkg_run_func(const char *vdb_path, const char *phases, const char *func, const c
/* best_version() */
"use() { useq \"$@\"; }\n"
"usex() { useq \"$1\" && echo \"${2-yes}$4\" || echo \"${3-no}$5\"; }\n"
- "useq() { hasq \"$1\" $USE; }\n"
+ "useq() { hasq \"$1\" ${USE}; }\n"
+ "usev() { hasv \"$1\" ${USE}; }\n"
"has() { hasq \"$@\"; }\n"
"hasq() { local h=$1; shift; case \" $* \" in *\" $h \"*) return 0;; *) return 1;; esac; }\n"
"hasv() { hasq \"$@\" && echo \"$1\"; }\n"
@@ -454,8 +455,11 @@ pkg_run_func(const char *vdb_path, const char *phases, const char *func, const c
"eqawarn() { elog \"QA: \"\"$@\"; }\n"
"eerror() { elog \"$@\"; }\n"
"die() { eerror \"$@\"; exit 1; }\n"
+ /* TODO: This should suppress `die` */
+ "nonfatal() { \"$@\"; }\n"
"ebegin() { printf ' * %%b ...' \"$*\"; }\n"
"eend() { local r=${1:-$?}; [ $# -gt 0 ] && shift; [ $r -eq 0 ] && echo ' [ ok ]' || echo \" $* \"'[ !! ]'; return $r; }\n"
+ /* TODO: This should be fatal upon error */
"emake() { ${MAKE:-make} ${MAKEOPTS} \"$@\"; }\n"
/* Unpack the env if need be */
"[ -e '%1$s/environment' ] || { bzip2 -dc '%1$s/environment.bz2' > '%1$s/environment' || exit 1; }\n"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-20 22:28 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-20 22:28 UTC (permalink / raw
To: gentoo-commits
commit: 4e9fab3118078f618aceaa5f50131cc709701e84
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 20 22:30:10 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Feb 20 22:30:46 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=4e9fab31
qcheck: add a short option for --skip-protected
Reported-by: Ben Kohler <bkohler <AT> gmail.com>
URL: https://bugs.gentoo.org/505122
---
qcheck.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qcheck.c b/qcheck.c
index 0a98398..86d7aa6 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -8,7 +8,7 @@
#ifdef APPLET_qcheck
-#define QCHECK_FLAGS "aes:uABHTp" COMMON_FLAGS
+#define QCHECK_FLAGS "aes:uABHTPp" COMMON_FLAGS
static struct option const qcheck_long_opts[] = {
{"all", no_argument, NULL, 'a'},
{"exact", no_argument, NULL, 'e'},
@@ -18,7 +18,7 @@ static struct option const qcheck_long_opts[] = {
{"badonly", no_argument, NULL, 'B'},
{"nohash", no_argument, NULL, 'H'},
{"nomtime", no_argument, NULL, 'T'},
- {"skip-protected", no_argument, NULL, 128},
+ {"skip-protected", no_argument, NULL, 'P'},
{"prelink", no_argument, NULL, 'p'},
COMMON_LONG_OPTS
};
@@ -392,7 +392,7 @@ int qcheck_main(int argc, char **argv)
case 'B': state.bad_only = true; break;
case 'H': state.chk_hash = false; break;
case 'T': state.chk_mtime = false; break;
- case 128: state.chk_config_protect = false; break;
+ case 'P': state.chk_config_protect = false; break;
case 'p': state.undo_prelink = prelink_available(); break;
}
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-21 0:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-21 0:00 UTC (permalink / raw
To: gentoo-commits
commit: d2e2f768505412f8c4bad0e799eaaffc694c8949
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 21 00:01:56 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Feb 21 00:01:56 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=d2e2f768
quse: various style fixes
No real functional changes in here.
---
quse.c | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/quse.c b/quse.c
index 875733c..534cf41 100644
--- a/quse.c
+++ b/quse.c
@@ -36,11 +36,10 @@ static const char * const quse_opts_help[] = {
};
#define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, lookup_applet_idx("quse"))
-int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv);
-
char quse_name_only = 0;
-static void print_highlighted_use_flags(char *string, int ind, int argc, char **argv)
+static void
+print_highlighted_use_flags(char *string, int ind, int argc, char **argv)
{
char *str, *p;
char buf[BUFSIZ];
@@ -79,7 +78,8 @@ static void print_highlighted_use_flags(char *string, int ind, int argc, char **
}
}
-int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
+static int
+quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
{
#define NUM_SEARCH_FILES ARRAY_SIZE(search_files)
size_t buflen;
@@ -91,7 +91,8 @@ int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
DIR *d;
struct dirent *de;
- buflen = _Q_PATH_MAX;
+ /* pick 1000 arbitrarily long enough for all files under desc/ */
+ buflen = strlen(portdir) + 1000;
buf = xmalloc(buflen);
for (i = 0; i < NUM_SEARCH_FILES; ++i) {
@@ -117,8 +118,8 @@ int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
switch (f) {
case 0: /* Global use.desc */
if (!strncmp(buf, argv[i], s))
- if (buf[s] == ' ' && buf[s+1] == '-') {
- printf(" %sglobal%s:%s%s%s: %s\n", BOLD, NORM, BLUE, argv[i], NORM, buf+s+3);
+ if (buf[s] == ' ' && buf[s + 1] == '-') {
+ printf(" %sglobal%s:%s%s%s: %s\n", BOLD, NORM, BLUE, argv[i], NORM, buf + s + 3);
goto skip_file;
}
break;
@@ -128,9 +129,9 @@ int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
break;
++p;
if (!strncmp(p, argv[i], s)) {
- if (p[s] == ' ' && p[s+1] == '-') {
+ if (p[s] == ' ' && p[s + 1] == '-') {
*p = '\0';
- printf(" %slocal%s:%s%s%s:%s%s%s %s\n", BOLD, NORM, BLUE, argv[i], NORM, BOLD, buf, NORM, p+s+3);
+ printf(" %slocal%s:%s%s%s:%s%s%s %s\n", BOLD, NORM, BLUE, argv[i], NORM, BOLD, buf, NORM, p + s + 3);
}
}
break;
@@ -144,12 +145,12 @@ int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
}
}
-skip_file:
+ skip_file:
rewind(fp[f]);
}
}
- for (f=0; f < NUM_SEARCH_FILES; ++f)
+ for (f = 0; f < NUM_SEARCH_FILES; ++f)
if (fp[f] != NULL)
fclose(fp[f]);
@@ -185,13 +186,13 @@ skip_file:
*p = '\0';
if ((p = strchr(buf, '-')) == NULL) {
-invalid_line:
+ invalid_line:
warn("Invalid line in '%s': %s", de->d_name, buf);
continue;
}
while (p[-1] != ' ' && p[1] != ' ') {
/* maybe the flag has a '-' in it ... */
- if ((p = strchr(p+1, '-')) == NULL)
+ if ((p = strchr(p + 1, '-')) == NULL)
goto invalid_line;
}
p[-1] = '\0';
@@ -303,7 +304,7 @@ int quse_main(int argc, char **argv)
}
}
#ifdef THIS_SUCKS
- if ((p = strrchr(&buf0[search_len+1], '\\')) != NULL) {
+ if ((p = strrchr(&buf0[search_len + 1], '\\')) != NULL) {
multiline:
*p = ' ';
@@ -323,13 +324,13 @@ int quse_main(int argc, char **argv)
#else
remove_extra_space(buf0);
#endif
- while ((p = strrchr(&buf0[search_len+1], '"')) != NULL) *p = 0;
- while ((p = strrchr(&buf0[search_len+1], '\'')) != NULL) *p = 0;
- while ((p = strrchr(&buf0[search_len+1], '\\')) != NULL) *p = ' ';
+ while ((p = strrchr(&buf0[search_len + 1], '"')) != NULL) *p = 0;
+ while ((p = strrchr(&buf0[search_len + 1], '\'')) != NULL) *p = 0;
+ while ((p = strrchr(&buf0[search_len + 1], '\\')) != NULL) *p = ' ';
if (verbose && warned == 0) {
if ((strchr(buf0, '$') != NULL) || (strchr(buf0, '\\') != NULL)) {
- warned=1;
+ warned = 1;
warn("# Line %d of %s has an annoying %s", lineno, ebuild, buf0);
}
}
@@ -345,14 +346,14 @@ int quse_main(int argc, char **argv)
ok = 0;
if (regexp_matching) {
for (i = optind; i < argc; ++i) {
- if (rematch(argv[i], &buf0[search_len+1], REG_NOSUB) == 0) {
+ if (rematch(argv[i], &buf0[search_len + 1], REG_NOSUB) == 0) {
ok = 1;
break;
}
}
} else {
remove_extra_space(buf0);
- strcpy(buf1, &buf0[search_len+1]);
+ strcpy(buf1, &buf0[search_len + 1]);
for (i = (size_t) optind; i < argc && argv[i] != NULL; i++) {
if (strcmp(buf1, argv[i]) == 0) {
@@ -372,9 +373,8 @@ int quse_main(int argc, char **argv)
strcpy(buf1, buf2);
if (strchr(buf1, ' ') == NULL)
for (i = (size_t) optind; i < argc && argv[i] != NULL; i++) {
- if (strcmp(buf1, argv[i]) == 0) {
+ if (strcmp(buf1, argv[i]) == 0)
ok = 1;
- }
}
}
}
@@ -384,12 +384,12 @@ int quse_main(int argc, char **argv)
printf("%s %s %s ", *user ? user : "MISSING", *revision ? revision : "MISSING", *date ? date : "MISSING");
printf("%s%s%s ", CYAN, ebuild, NORM);
- print_highlighted_use_flags(&buf0[search_len+1], optind, argc, argv);
+ print_highlighted_use_flags(&buf0[search_len + 1], optind, argc, argv);
puts(NORM);
if (verbose > 1) {
char **ARGV = NULL;
int ARGC = 0;
- makeargv(&buf0[search_len+1], &ARGC, &ARGV);
+ makeargv(&buf0[search_len + 1], &ARGC, &ARGV);
if (ARGC > 0) {
quse_describe_flag(1, ARGC, ARGV);
for (i = 0; i < ARGC; i++)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-21 0:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-21 0:00 UTC (permalink / raw
To: gentoo-commits
commit: 39c083580b63e1e80d952e91ae3155739034632b
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 20 23:54:38 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Feb 20 23:54:38 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=39c08358
quse: drop lang.desc support
This file hasn't been generated in a long time since it was migrated
to the desc/linguas.desc file.
---
quse.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/quse.c b/quse.c
index 8ee37f4..825fba3 100644
--- a/quse.c
+++ b/quse.c
@@ -86,7 +86,7 @@ int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
char *buf, *p;
unsigned int i, f;
size_t s;
- const char *search_files[] = { "use.desc", "use.local.desc", "arch.list", "lang.desc" };
+ const char * const search_files[] = { "use.desc", "use.local.desc", "arch.list", };
FILE *fp[NUM_SEARCH_FILES];
DIR *d;
struct dirent *de;
@@ -97,8 +97,7 @@ int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
for (i = 0; i < NUM_SEARCH_FILES; ++i) {
snprintf(buf, buflen, "%s/profiles/%s", portdir, search_files[i]);
if ((fp[i] = fopen(buf, "r")) == NULL)
- if (strcmp(search_files[i], "lang.desc") != 0)
- warnp("skipping %s", search_files[i]);
+ warnp("skipping %s", search_files[i]);
}
for (i = ind; i < argc; i++) {
@@ -142,14 +141,6 @@ int quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
goto skip_file;
}
break;
-
- case 3: /* Languages lang.desc */
- if (!strncmp(buf, argv[i], s))
- if (buf[s] == ' ' && buf[s+1] == '-') {
- printf(" %slang%s:%s%s%s: %s lingua\n", BOLD, NORM, BLUE, argv[i], NORM, buf+s+3);
- goto skip_file;
- }
- break;
}
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-21 18:06 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-21 18:06 UTC (permalink / raw
To: gentoo-commits
commit: b23f8bb7a222f06d89918601778581f21413fc38
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 21 18:01:09 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Feb 21 18:01:09 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=b23f8bb7
qmerge: fix use-after-freed error
---
qmerge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qmerge.c b/qmerge.c
index e4b8f96..44b2f47 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1197,9 +1197,9 @@ pkg_unmerge(const char *cat, const char *pkgname, queue *keep)
qprintf("%s%s%s %s%s%s/\n", rm ? YELLOW : GREEN, rm ? "---" : "<<<",
NORM, DKBLUE, dir, NORM);
+ dirs = dirs->next;
free(list->data);
free(list);
- dirs = dirs->next;
}
freeargv(cp_argc, cp_argv);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: b6e7aef905639342dea38511ccc413eaf9f9dbe8
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 08:55:01 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 08:55:01 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=b6e7aef9
debug: build with more sanitize modes
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 6c05dbd..4e65396 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ CFLAGS ?= -O2 -g -pipe
CFLAGS += -std=gnu99
CPPFLAGS ?=
CPPFLAGS += -DENABLE_NLS=$(call istrue,$(NLS))
-DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc, -fsanitize=address)
+DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc, -fsanitize=address -fsanitize=leak -fsanitize=undefined)
#CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2 -falign-labels=2 -falign-loops=2
#LDFLAGS := -pie
LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo '-lkvm')
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 558fa6e799b8ffd919cf592b8d5802db13e05521
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 08:59:14 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 08:59:14 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=558fa6e7
qmerge: run search in interactive mode
This mode never actually modifies anything, so no need to run it twice.
---
qmerge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qmerge.c b/qmerge.c
index f713a7f..c58e4f2 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1959,7 +1959,7 @@ int qmerge_main(int argc, char **argv)
switch (i) {
case 'f': force_download = 1; break;
case 'F': force_download = 2; break;
- case 's': search_pkgs = 1; break;
+ case 's': search_pkgs = 1; interactive = 0; break;
/* case 'i': case 'g': */
case 'K': install = 1; break;
case 'U': uninstall = 1; break;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 3ab82ae3e1773915e25b3a3dafe57ef97375982a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 23 22:48:29 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 23 22:48:35 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=3ab82ae3
fix debug/symlinks targets to work in parallel
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 4e65396..137b505 100644
--- a/Makefile
+++ b/Makefile
@@ -62,8 +62,8 @@ CPPFLAGS += $(APP_FLAGS)
all: q
@true
-debug:
- $(MAKE) CFLAGS="$(CFLAGS) $(DBG_CFLAGS)" clean symlinks
+debug: clean
+ $(MAKE) CFLAGS="$(CFLAGS) $(DBG_CFLAGS)" symlinks
@-scanelf -o /dev/null -BXxz permsx q
q: $(SRC) libq/*.c *.h libq/*.h
@@ -123,7 +123,7 @@ endif
man: q
./man/mkman.py
-symlinks: all
+symlinks: q
./q --install
-include .depend
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: c77ee400e1be0c40d5fecdb85c168756d258f4d9
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 09:09:37 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 09:09:37 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=c77ee400
qmerge: use free_sets helper
---
qmerge.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index e125258..b2ef9a7 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -995,13 +995,7 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
}
/* Clean up the package state */
- while (objs) {
- queue *q = objs;
- objs = q->next;
- free(q->name);
- free(q->item);
- free(q);
- }
+ free_sets(objs);
free(D);
free(T);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 667542314e66dda0897778b0ce75dd56d9adddc7
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 08:57:22 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 08:57:22 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=66754231
qmerge: push down global Pkg state to funcs that use it
---
qmerge.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/qmerge.c b/qmerge.c
index 44b2f47..f713a7f 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -95,7 +95,7 @@ struct pkg_t {
size_t SIZE;
char USE[BUFSIZ];
char REPO[64];
-} Pkg;
+};
struct llist_char_t {
char *data;
@@ -1579,6 +1579,7 @@ grab_binpkg_info(const char *name)
char *p;
depend_atom *atom;
+ struct pkg_t Pkg;
struct pkg_t *pkg = xzalloc(sizeof(struct pkg_t));
struct pkg_t *rpkg = xzalloc(sizeof(struct pkg_t));
@@ -1678,6 +1679,7 @@ find_binpkg(const char *name)
FILE *fp;
char buf[BUFSIZ];
char *p;
+ struct pkg_t Pkg;
char PF[sizeof(Pkg.PF)];
char CATEGORY[sizeof(Pkg.CATEGORY)];
@@ -1759,6 +1761,7 @@ parse_packages(queue *todo)
size_t buflen;
char *buf, *p;
long lineno = 0;
+ struct pkg_t Pkg;
fp = open_binpkg_index();
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 029a18c5e4ab408c7eadc10693bcf7056b8ab171
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 18:05:49 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 18:05:49 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=029a18c5
qdepends: avoid warning when DEBUG is enabled
---
qdepends.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/qdepends.c b/qdepends.c
index 648d8e2..bcdeaa5 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -76,7 +76,8 @@ int qdepends_main_vdb(const char *depend_file, int argc, char **argv);
int qdepends_vdb_deep(const char *depend_file, const char *query);
#ifdef EBUG
-_q_static void print_word(const char *ptr, size_t num)
+void print_word(const char *ptr, size_t num);
+void print_word(const char *ptr, size_t num)
{
while (num--)
printf("%c", *ptr++);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 8c6955ca99d10ebae0b7431c3ec572f55b9daa6f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 22 20:34:04 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 20:34:04 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=8c6955ca
qmerge: drop --nomd5 flag
---
qmerge.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 7556b4b..3281424 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -35,7 +35,7 @@
int old_repo = 0;
-#define QMERGE_FLAGS "fFsKUpuyO5" COMMON_FLAGS
+#define QMERGE_FLAGS "fFsKUpuyO" COMMON_FLAGS
static struct option const qmerge_long_opts[] = {
{"fetch", no_argument, NULL, 'f'},
{"force", no_argument, NULL, 'F'},
@@ -46,7 +46,6 @@ static struct option const qmerge_long_opts[] = {
{"update", no_argument, NULL, 'u'},
{"yes", no_argument, NULL, 'y'},
{"nodeps", no_argument, NULL, 'O'},
- {"nomd5", no_argument, NULL, '5'},
{"debug", no_argument, NULL, 128},
COMMON_LONG_OPTS
};
@@ -60,7 +59,6 @@ static const char * const qmerge_opts_help[] = {
"Update only",
"Don't prompt before overwriting",
"Don't merge dependencies",
- "Don't verify MD5 digest of files",
"Run shell funcs with `set -x`",
COMMON_OPTS_HELP
};
@@ -72,7 +70,6 @@ char install = 0;
char uninstall = 0;
char force_download = 0;
char follow_rdepends = 1;
-char nomd5 = 0;
char qmerge_strict = 0;
char update_only = 0;
bool debug = false;
@@ -1254,9 +1251,6 @@ pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *at
char *hash = NULL;
int ret = 0;
- if (nomd5)
- return ret;
-
if (pkg->MD5[0]) {
if ((hash = (char*) hash_file(fname, HASH_MD5)) == NULL) {
errf("hash is NULL for %s", fname);
@@ -1898,7 +1892,6 @@ int qmerge_main(int argc, char **argv)
case 'u': update_only = 1;
case 'y': interactive = 0; break;
case 'O': follow_rdepends = 0; break;
- case '5': nomd5 = 1; break;
case 128: debug = true; break;
COMMON_GETOPTS_CASES(qmerge)
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 4db515ff005a0107d4f25d6d6889d05a920ac435
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 24 01:01:53 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 24 01:01:53 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=4db515ff
main: drop __DATE__ from version info to let ccache work better
---
main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/main.c b/main.c
index 1ee8816..51c48aa 100644
--- a/main.c
+++ b/main.c
@@ -165,10 +165,9 @@ static void version_barf(void)
#ifndef VCSID
# define VCSID "<unknown>"
#endif
- printf("portage-utils-%s: compiled on %s\n"
- "vcs id: %s\n"
+ printf("portage-utils-%s: %s\n"
"%s written for Gentoo by <solar and vapier @ gentoo.org>\n",
- VERSION, __DATE__, VCSID, argv0);
+ VERSION, VCSID, argv0);
exit(EXIT_SUCCESS);
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: dca0ef37f0895f169be61657b5704b45d124e6dd
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 23 23:02:11 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 23 23:02:11 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=dca0ef37
qmerge: simplify Packages parsing slightly
---
qmerge.c | 66 ++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 314a114..4660eff 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1565,28 +1565,28 @@ grab_binpkg_info(const char *name)
}
continue;
}
+
if ((p = strchr(buf, '\n')) != NULL)
*p = 0;
-
if ((p = strchr(buf, ':')) == NULL)
continue;
- if ((p = strchr(buf, ' ')) == NULL)
+ if (p[1] != ' ')
continue;
*p = 0;
- ++p;
+ p += 2;
if (*buf) {
/* we dont need all the info */
- if (strcmp(buf, "RDEPEND:") == 0)
+ if (strcmp(buf, "RDEPEND") == 0)
strncpy(pkg->RDEPEND, p, sizeof(Pkg.RDEPEND));
- if (strcmp(buf, "PF:") == 0)
+ if (strcmp(buf, "PF") == 0)
strncpy(pkg->PF, p, sizeof(Pkg.PF));
- if (strcmp(buf, "CATEGORY:") == 0)
+ if (strcmp(buf, "CATEGORY") == 0)
strncpy(pkg->CATEGORY, p, sizeof(Pkg.CATEGORY));
- if (strcmp(buf, "REPO:") == 0)
+ if (strcmp(buf, "REPO") == 0)
strncpy(pkg->REPO, p, sizeof(Pkg.REPO));
- if (strcmp(buf, "CPV:") == 0) {
+ if (strcmp(buf, "CPV") == 0) {
if ((atom = atom_explode(p)) != NULL) {
snprintf(buf, sizeof(buf), "%s-%s", atom->PN, atom->PV);
if (atom->PR_int)
@@ -1596,15 +1596,15 @@ grab_binpkg_info(const char *name)
atom_implode(atom);
}
}
- if (strcmp(buf, "SLOT:") == 0)
+ if (strcmp(buf, "SLOT") == 0)
strncpy(pkg->SLOT, p, sizeof(Pkg.SLOT));
- if (strcmp(buf, "USE:") == 0)
+ if (strcmp(buf, "USE") == 0)
strncpy(pkg->USE, p, sizeof(Pkg.USE));
/* checksums. We must have 1 or the other unless --*/
- if (strcmp(buf, "MD5:") == 0)
+ if (strcmp(buf, "MD5") == 0)
strncpy(pkg->MD5, p, sizeof(Pkg.MD5));
- if (strcmp(buf, "SHA1:") == 0)
+ if (strcmp(buf, "SHA1") == 0)
strncpy(pkg->SHA1, p, sizeof(Pkg.SHA1));
}
}
@@ -1662,18 +1662,18 @@ find_binpkg(const char *name)
}
continue;
}
+
if ((p = strchr(buf, '\n')) != NULL)
*p = 0;
-
if ((p = strchr(buf, ':')) == NULL)
continue;
- if ((p = strchr(buf, ' ')) == NULL)
+ if (p[1] != ' ')
continue;
*p = 0;
- ++p;
+ p += 2;
if (*buf) {
- if (strcmp(buf, "CPV:") == 0) {
+ if (strcmp(buf, "CPV") == 0) {
depend_atom *atom;
if ((atom = atom_explode(p)) != NULL) {
snprintf(buf, sizeof(buf), "%s-%s", atom->PN, atom->PV);
@@ -1684,9 +1684,9 @@ find_binpkg(const char *name)
atom_implode(atom);
}
}
- if (strcmp(buf, "PF:") == 0)
+ if (strcmp(buf, "PF") == 0)
strncpy(PF, p, sizeof(PF));
- if (strcmp(buf, "CATEGORY:") == 0)
+ if (strcmp(buf, "CATEGORY") == 0)
strncpy(CATEGORY, p, sizeof(CATEGORY));
}
}
@@ -1731,41 +1731,41 @@ parse_packages(queue *todo)
memset(&Pkg, 0, sizeof(Pkg));
continue;
}
+
if ((p = strchr(buf, '\n')) != NULL)
*p = 0;
-
if ((p = strchr(buf, ':')) == NULL)
continue;
- if ((p = strchr(buf, ' ')) == NULL)
+ if (p[1] != ' ')
continue;
*p = 0;
- ++p;
+ p += 2;
switch (*buf) {
case 'U':
- if (strcmp(buf, "USE:") == 0) strncpy(Pkg.USE, p, sizeof(Pkg.USE));
+ if (strcmp(buf, "USE") == 0) strncpy(Pkg.USE, p, sizeof(Pkg.USE));
break;
case 'P':
- if (strcmp(buf, "PF:") == 0) strncpy(Pkg.PF, p, sizeof(Pkg.PF));
+ if (strcmp(buf, "PF") == 0) strncpy(Pkg.PF, p, sizeof(Pkg.PF));
break;
case 'S':
- if (strcmp(buf, "SIZE:") == 0) Pkg.SIZE = atol(p);
- if (strcmp(buf, "SLOT:") == 0) strncpy(Pkg.SLOT, p, sizeof(Pkg.SLOT));
- if (strcmp(buf, "SHA1:") == 0) strncpy(Pkg.SHA1, p, sizeof(Pkg.SHA1));
+ if (strcmp(buf, "SIZE") == 0) Pkg.SIZE = atol(p);
+ if (strcmp(buf, "SLOT") == 0) strncpy(Pkg.SLOT, p, sizeof(Pkg.SLOT));
+ if (strcmp(buf, "SHA1") == 0) strncpy(Pkg.SHA1, p, sizeof(Pkg.SHA1));
break;
case 'M':
- if (strcmp(buf, "MD5:") == 0) strncpy(Pkg.MD5, p, sizeof(Pkg.MD5));
+ if (strcmp(buf, "MD5") == 0) strncpy(Pkg.MD5, p, sizeof(Pkg.MD5));
break;
case 'R':
- if (strcmp(buf, "REPO:") == 0) strncpy(Pkg.REPO, p, sizeof(Pkg.REPO));
- if (strcmp(buf, "RDEPEND:") == 0) strncpy(Pkg.RDEPEND, p, sizeof(Pkg.RDEPEND));
+ if (strcmp(buf, "REPO") == 0) strncpy(Pkg.REPO, p, sizeof(Pkg.REPO));
+ if (strcmp(buf, "RDEPEND") == 0) strncpy(Pkg.RDEPEND, p, sizeof(Pkg.RDEPEND));
break;
case 'L':
- if (strcmp(buf, "LICENSE:") == 0) strncpy(Pkg.LICENSE, p, sizeof(Pkg.LICENSE));
+ if (strcmp(buf, "LICENSE") == 0) strncpy(Pkg.LICENSE, p, sizeof(Pkg.LICENSE));
break;
case 'C':
- if (strcmp(buf, "CATEGORY:") == 0) strncpy(Pkg.CATEGORY, p, sizeof(Pkg.CATEGORY));
- if (strcmp(buf, "CPV:") == 0) {
+ if (strcmp(buf, "CATEGORY") == 0) strncpy(Pkg.CATEGORY, p, sizeof(Pkg.CATEGORY));
+ if (strcmp(buf, "CPV") == 0) {
depend_atom *atom;
if ((atom = atom_explode(p)) != NULL) {
if (atom->PR_int)
@@ -1778,7 +1778,7 @@ parse_packages(queue *todo)
}
break;
case 'D':
- if (strcmp(buf, "DESC:") == 0) strncpy(Pkg.DESC, p, sizeof(Pkg.DESC));
+ if (strcmp(buf, "DESC") == 0) strncpy(Pkg.DESC, p, sizeof(Pkg.DESC));
break;
default:
break;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 8db61f8ea34c8b306aca3518c4a4d4e6ca674b4f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 23 22:52:25 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 23 22:52:25 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=8db61f8e
qmerge: drop unused lineno var
---
qmerge.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 3281424..314a114 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1700,7 +1700,6 @@ parse_packages(queue *todo)
FILE *fp;
size_t buflen;
char *buf, *p;
- long lineno = 0;
struct pkg_t Pkg;
fp = open_binpkg_index();
@@ -1709,7 +1708,6 @@ parse_packages(queue *todo)
buf = NULL;
while (getline(&buf, &buflen, fp) != -1) {
- lineno++;
if (*buf == '\n') {
if ((strlen(Pkg.PF) > 0) && (strlen(Pkg.CATEGORY) > 0)) {
struct pkg_t *pkg = xmalloc(sizeof(*pkg));
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: f61120de1a713ae221e9a5b869bb75c74301f6bd
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 24 00:33:43 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 24 00:33:43 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=f61120de
qmerge: use atom_compare to figure out matches
This brings proper version/slot/etc... matching when installing packages:
qmerge nano:0
qmerge '>python-3.1'
---
qmerge.c | 74 ++++++++++++++++------------------------------------------------
1 file changed, 18 insertions(+), 56 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 1bd860d..9df9384 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1210,31 +1210,6 @@ _q_static int unlink_empty(const char *buf)
return -1;
}
-_q_static int match_pkg(const queue *ll, const depend_atom *atom, const struct pkg_t *pkg)
-{
- char buf[255];
- int match = 0;
-
- snprintf(buf, sizeof(buf), "%s/%s", pkg->CATEGORY, pkg->PF);
-
- /* verify this is the requested package */
- if (strcmp(ll->name, buf) == 0)
- match = 1;
-
- if (strcmp(ll->name, pkg->PF) == 0)
- match = 2;
-
- snprintf(buf, sizeof(buf), "%s/%s", atom->CATEGORY, atom->PN);
-
- if (strcmp(ll->name, buf) == 0)
- match = 3;
-
- if (strcmp(ll->name, atom->PN) == 0)
- match = 4;
-
- return match;
-}
-
_q_static int
pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *atom,
int strict, int display)
@@ -1277,22 +1252,6 @@ pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *at
return ret;
}
-_q_static
-void pkg_process(const queue *todo, const depend_atom *atom, const struct pkg_t *pkg)
-{
- const queue *ll;
-
- ll = todo;
- while (ll) {
- if (ll->name[0] != '-' && match_pkg(ll, atom, pkg)) {
- /* fetch all requested packages */
- pkg_fetch(0, atom, pkg);
- }
-
- ll = ll->next;
- }
-}
-
_q_static void
pkg_fetch(int level, const depend_atom *atom, const struct pkg_t *pkg)
{
@@ -1712,23 +1671,26 @@ parse_packages(queue *todo)
while (getline(&buf, &buflen, fp) != -1) {
if (*buf == '\n') {
if (pkg_atom) {
- struct pkg_t *pkg = xmalloc(sizeof(*pkg));
- *pkg = Pkg;
-
- if (search_pkgs) {
- if (todo) {
- queue *ll = todo;
- while (ll) {
- if ((match_pkg(ll, pkg_atom, pkg) > 0) || (strcmp(ll->name, pkg->CATEGORY) == 0))
- print_Pkg(verbose, pkg_atom, pkg);
- ll = ll->next;
+ if (search_pkgs && !todo) {
+ print_Pkg(verbose, pkg_atom, &Pkg);
+ } else {
+ const queue *ll = todo;
+ depend_atom *todo_atom;
+ while (ll) {
+ todo_atom = atom_explode(ll->name);
+ pkg_atom->REPO = todo_atom->REPO ? Pkg.REPO : NULL;
+ pkg_atom->SLOT = todo_atom->SLOT ? Pkg.SLOT : NULL;
+ if (atom_compare(todo_atom, pkg_atom) == EQUAL) {
+ if (search_pkgs)
+ print_Pkg(verbose, pkg_atom, &Pkg);
+ else
+ pkg_fetch(0, pkg_atom, &Pkg);
}
- } else
- print_Pkg(verbose, pkg_atom, pkg);
- } else
- pkg_process(todo, pkg_atom, pkg);
+ atom_implode(todo_atom);
+ ll = ll->next;
+ }
+ }
- free(pkg);
atom_implode(pkg_atom);
pkg_atom = NULL;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: c85ef7b89c7b7bf9a7b462e76c309855b1be4e4e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 24 00:03:15 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 24 00:08:07 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=c85ef7b8
qmerge: pull atom up a level in the merge logic
---
qmerge.c | 75 ++++++++++++++++++++++------------------------------------------
1 file changed, 26 insertions(+), 49 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 4660eff..be28cb7 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1210,15 +1210,12 @@ _q_static int unlink_empty(const char *buf)
return -1;
}
-_q_static int match_pkg(queue *ll, const struct pkg_t *pkg)
+_q_static int match_pkg(const queue *ll, const depend_atom *atom, const struct pkg_t *pkg)
{
- depend_atom *atom;
- char buf[255], buf2[255];
+ char buf[255];
int match = 0;
snprintf(buf, sizeof(buf), "%s/%s", pkg->CATEGORY, pkg->PF);
- if ((atom = atom_explode(buf)) == NULL)
- errf("%s/%s is not a valid atom", pkg->CATEGORY, pkg->PF);
/* verify this is the requested package */
if (strcmp(ll->name, buf) == 0)
@@ -1227,20 +1224,14 @@ _q_static int match_pkg(queue *ll, const struct pkg_t *pkg)
if (strcmp(ll->name, pkg->PF) == 0)
match = 2;
- snprintf(buf2, sizeof(buf2), "%s/%s", pkg->CATEGORY, atom->PN);
+ snprintf(buf, sizeof(buf), "%s/%s", atom->CATEGORY, atom->PN);
- if (strcmp(ll->name, buf2) == 0)
+ if (strcmp(ll->name, buf) == 0)
match = 3;
if (strcmp(ll->name, atom->PN) == 0)
match = 4;
- if (match)
- goto match_done;
-
-match_done:
- atom_implode(atom);
-
return match;
}
@@ -1287,28 +1278,19 @@ pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *at
}
_q_static
-void pkg_process(queue *todo, const struct pkg_t *pkg)
+void pkg_process(const queue *todo, const depend_atom *atom, const struct pkg_t *pkg)
{
- queue *ll;
- depend_atom *atom;
- char buf[255];
-
- snprintf(buf, sizeof(buf), "%s/%s", pkg->CATEGORY, pkg->PF);
- if ((atom = atom_explode(buf)) == NULL)
- errf("%s/%s is not a valid atom", pkg->CATEGORY, pkg->PF);
+ const queue *ll;
ll = todo;
while (ll) {
- if (ll->name[0] != '-' && match_pkg(ll, pkg)) {
+ if (ll->name[0] != '-' && match_pkg(ll, atom, pkg)) {
/* fetch all requested packages */
pkg_fetch(0, atom, pkg);
}
ll = ll->next;
}
-
- /* free the atom */
- atom_implode(atom);
}
_q_static void
@@ -1382,19 +1364,15 @@ pkg_fetch(int level, const depend_atom *atom, const struct pkg_t *pkg)
}
_q_static void
-print_Pkg(int full, struct pkg_t *pkg)
+print_Pkg(int full, const depend_atom *atom, const struct pkg_t *pkg)
{
char *p = NULL;
char buf[512];
- depend_atom *atom = NULL;
-
- if (!pkg->CATEGORY[0]) errf("CATEGORY is NULL");
- if (!pkg->PF[0]) errf("PF is NULL");
- printf("%s%s/%s%s%s%s%s%s\n", BOLD, pkg->CATEGORY, BLUE, pkg->PF, NORM,
+ printf("%s%s/%s%s%s%s%s%s\n", BOLD, atom->CATEGORY, BLUE, pkg->PF, NORM,
!quiet ? " [" : "",
!quiet ? make_human_readable_str(pkg->SIZE, 1, KILOBYTE) : "",
- !quiet ? "KiB]" : "");
+ !quiet ? " KiB]" : "");
if (full == 0)
return;
@@ -1419,10 +1397,6 @@ print_Pkg(int full, struct pkg_t *pkg)
if (strcmp(pkg->REPO, "gentoo") != 0)
printf(" %sRepo%s:%s %s\n", DKGREEN, YELLOW, NORM, pkg->REPO);
- snprintf(buf, sizeof(buf), "%s/%s", pkg->CATEGORY, pkg->PF);
- atom = atom_explode(buf);
- if ((atom = atom_explode(buf)) == NULL)
- return;
if ((p = best_version(pkg->CATEGORY, atom->PN)) != NULL) {
if (*p) {
int ret;
@@ -1437,7 +1411,6 @@ print_Pkg(int full, struct pkg_t *pkg)
printf(" %sInstalled%s:%s %s%s%s\n", DKGREEN, YELLOW, NORM, icolor, p, NORM);
}
}
- atom_implode(atom);
}
_q_static int
@@ -1701,15 +1674,17 @@ parse_packages(queue *todo)
size_t buflen;
char *buf, *p;
struct pkg_t Pkg;
+ depend_atom *pkg_atom;
fp = open_binpkg_index();
+ pkg_atom = NULL;
memset(&Pkg, 0, sizeof(Pkg));
buf = NULL;
while (getline(&buf, &buflen, fp) != -1) {
if (*buf == '\n') {
- if ((strlen(Pkg.PF) > 0) && (strlen(Pkg.CATEGORY) > 0)) {
+ if (pkg_atom) {
struct pkg_t *pkg = xmalloc(sizeof(*pkg));
*pkg = Pkg;
@@ -1717,16 +1692,18 @@ parse_packages(queue *todo)
if (todo) {
queue *ll = todo;
while (ll) {
- if ((match_pkg(ll, pkg) > 0) || (strcmp(ll->name, pkg->CATEGORY) == 0))
- print_Pkg(verbose, pkg);
+ if ((match_pkg(ll, pkg_atom, pkg) > 0) || (strcmp(ll->name, pkg->CATEGORY) == 0))
+ print_Pkg(verbose, pkg_atom, pkg);
ll = ll->next;
}
} else
- print_Pkg(verbose, pkg);
+ print_Pkg(verbose, pkg_atom, pkg);
} else
- pkg_process(todo, pkg);
+ pkg_process(todo, pkg_atom, pkg);
free(pkg);
+ atom_implode(pkg_atom);
+ pkg_atom = NULL;
}
memset(&Pkg, 0, sizeof(Pkg));
continue;
@@ -1766,14 +1743,12 @@ parse_packages(queue *todo)
case 'C':
if (strcmp(buf, "CATEGORY") == 0) strncpy(Pkg.CATEGORY, p, sizeof(Pkg.CATEGORY));
if (strcmp(buf, "CPV") == 0) {
- depend_atom *atom;
- if ((atom = atom_explode(p)) != NULL) {
- if (atom->PR_int)
- snprintf(Pkg.PF, sizeof(Pkg.PF), "%s-%s-r%i", atom->PN, atom->PV, atom->PR_int);
+ if ((pkg_atom = atom_explode(p)) != NULL) {
+ if (pkg_atom->PR_int)
+ snprintf(Pkg.PF, sizeof(Pkg.PF), "%s-%s-r%i", pkg_atom->PN, pkg_atom->PV, pkg_atom->PR_int);
else
- snprintf(Pkg.PF, sizeof(Pkg.PF), "%s-%s", atom->PN, atom->PV);
- strncpy(Pkg.CATEGORY, atom->CATEGORY, sizeof(Pkg.CATEGORY));
- atom_implode(atom);
+ snprintf(Pkg.PF, sizeof(Pkg.PF), "%s-%s", pkg_atom->PN, pkg_atom->PV);
+ strncpy(Pkg.CATEGORY, pkg_atom->CATEGORY, sizeof(Pkg.CATEGORY));
}
}
break;
@@ -1787,6 +1762,8 @@ parse_packages(queue *todo)
free(buf);
fclose(fp);
+ if (pkg_atom)
+ atom_implode(pkg_atom);
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: f72c81d161a174d683d81aa8747e38f3a364dc58
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 24 01:02:15 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 24 01:02:15 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=f72c81d1
regen .depend when applets.h updates since we pull from that
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 137b505..7304559 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,7 @@ endif
endif
$(Q)$(CC) $(WFLAGS) $(PYFLAGS) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) main.c -o q $(LIBADD)
-.depend: $(SRC)
+.depend: $(SRC) applets.h
sed -n '/^DECLARE_APPLET/s:.*(\(.*\)).*:#include "\1.c":p' applets.h > include_applets.h
@#$(CC) $(CFLAGS) -MM $(SRC) > .depend
$(CC) $(CPPFLAGS) $(CFLAGS) -MM main.c > .depend
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-02-24 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-02-24 1:26 UTC (permalink / raw
To: gentoo-commits
commit: f23fa9375a936d3d7d565175dfe39a2dd209d45e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 24 00:21:25 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 24 00:21:25 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=f23fa937
qmerge: parse the binpkg header first
This contains common details (like REPO) that are not repeated for every
entry. We'll propagate that back out whenever we reset the Pkg state.
Also seed the SLOT value with 0 every time. Its value is omitted when it
is the default, so we have to do this ourselves.
---
qmerge.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/qmerge.c b/qmerge.c
index be28cb7..1bd860d 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1675,13 +1675,40 @@ parse_packages(queue *todo)
char *buf, *p;
struct pkg_t Pkg;
depend_atom *pkg_atom;
+ char repo[sizeof(Pkg.REPO)];
fp = open_binpkg_index();
+ buf = NULL;
+ repo[0] = '\0';
+
+ /* First consume the header with the common data. */
+ while (getline(&buf, &buflen, fp) != -1) {
+ if (*buf == '\n')
+ break;
+
+ if ((p = strchr(buf, '\n')) != NULL)
+ *p = 0;
+ if ((p = strchr(buf, ':')) == NULL)
+ continue;
+ if (p[1] != ' ')
+ continue;
+ *p = 0;
+ p += 2;
+
+ switch (*buf) {
+ case 'R':
+ if (!strcmp(buf, "REPO"))
+ strncpy(repo, p, sizeof(repo));
+ break;
+ }
+ }
+
pkg_atom = NULL;
memset(&Pkg, 0, sizeof(Pkg));
+ strcpy(Pkg.SLOT, "0");
- buf = NULL;
+ /* Then walk all the package entries. */
while (getline(&buf, &buflen, fp) != -1) {
if (*buf == '\n') {
if (pkg_atom) {
@@ -1706,6 +1733,8 @@ parse_packages(queue *todo)
pkg_atom = NULL;
}
memset(&Pkg, 0, sizeof(Pkg));
+ strcpy(Pkg.SLOT, "0");
+ strcpy(Pkg.REPO, repo);
continue;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-05-19 17:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-05-19 17:37 UTC (permalink / raw
To: gentoo-commits
commit: c6bd6041822a9f968c068757722858f6e481c341
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue May 19 15:57:54 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue May 19 15:57:54 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c6bd6041
quse: use the cache file given and avoid cwd assumptions
This allows us to rework the internals of the cache funcs and not need
any specific chdir configuration by switching to the *at style funcs.
quse.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/quse.c b/quse.c
index 534cf41..dddbf5b 100644
--- a/quse.c
+++ b/quse.c
@@ -214,6 +214,7 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
int quse_main(int argc, char **argv)
{
FILE *fp;
+ const char *cache_file;
char *p;
char buf0[_Q_PATH_MAX];
@@ -251,19 +252,31 @@ int quse_main(int argc, char **argv)
return quse_describe_flag(optind, argc, argv);
if (quse_all) optind = argc;
- initialize_ebuild_flat(); /* sets our pwd to $PORTDIR */
+ cache_file = initialize_ebuild_flat();
search_len = strlen(search_vars[idx]);
assert(search_len < sizeof(buf0));
- if ((fp = fopen(CACHE_EBUILD_FILE, "r")) == NULL)
+ if ((fp = fopen(cache_file, "r")) == NULL) {
+ warnp("could not read cache: %s", cache_file);
return 1;
+ }
+
+ int portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
+
ebuild = NULL;
while (getline(&ebuild, &ebuildlen, fp) != -1) {
FILE *newfp;
+ int fd;
+
if ((p = strchr(ebuild, '\n')) != NULL)
*p = 0;
- if ((newfp = fopen(ebuild, "r")) != NULL) {
+
+ fd = openat(portdir_fd, ebuild, O_RDONLY|O_CLOEXEC);
+ if (fd < 0)
+ continue;
+ newfp = fdopen(fd, "r");
+ if (newfp != NULL) {
unsigned int lineno = 0;
char revision[sizeof(buf0)];
char date[sizeof(buf0)];
@@ -408,6 +421,7 @@ int quse_main(int argc, char **argv)
}
}
fclose(fp);
+ close(portdir_fd);
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-05-19 17:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-05-19 17:37 UTC (permalink / raw
To: gentoo-commits
commit: d9eb678ae9f359a1b8e22ab3eca2d70a886b497e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue May 19 15:55:14 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue May 19 15:55:14 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d9eb678a
qglsa: update code to latest APIs
qglsa.c | 51 ++++++++++++++++++++++++++-------------------------
1 file changed, 26 insertions(+), 25 deletions(-)
diff --git a/qglsa.c b/qglsa.c
index 4ac3d19..328bbd8 100644
--- a/qglsa.c
+++ b/qglsa.c
@@ -34,19 +34,9 @@ static const char * const qglsa_opts_help[] = {
static char *qglsa_load_list(void);
static char *qglsa_load_list(void)
{
- char *ret;
- struct stat st;
-
- if (stat(QGLSA_DB, &st))
- return NULL;
-
- ret = xmalloc(st.st_size+1);
-
- if (!eat_file(QGLSA_DB, ret, st.st_size)) {
- free(ret);
- return NULL;
- }
-
+ char *ret = NULL;
+ size_t size = 0;
+ eat_file(QGLSA_DB, &ret, &size);
return ret;
}
static void qglsa_append_to_list(const char *glsa);
@@ -158,8 +148,8 @@ int qglsa_main(int argc, char **argv)
int i;
DIR *dir;
struct dirent *dentry;
- struct stat st;
- char buf[BUFSIZE*4];
+ char *buf;
+ size_t buflen = 0;
char *s, *p, *glsa_fixed_list;
int action = GLSA_FUNKYTOWN;
int all_glsas = 0;
@@ -198,16 +188,19 @@ int qglsa_main(int argc, char **argv)
}
glsa_fixed_list = qglsa_load_list();
- xchdir(portdir);
- xchdir("./metadata/glsa");
+ int portdir_fd, glsa_fd;
+ portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
+ glsa_fd = openat(portdir_fd, "metadata/glsa", O_RDONLY|O_CLOEXEC);
switch (action) {
/*case GLSA_FIX:*/
case GLSA_INJECT:
+ buf = NULL;
for (i = optind; i < argc; ++i) {
- snprintf(buf, sizeof(buf), "glsa-%s.xml", argv[i]);
- if (stat(buf, &st)) {
- warn("Skipping invalid GLSA '%s'", argv[i]);
+ free(buf);
+ xasprintf(&buf, "glsa-%s.xml", argv[i]);
+ if (faccessat(glsa_fd, buf, R_OK, 0)) {
+ warnp("Skipping invalid GLSA '%s'", argv[i]);
continue;
}
if (glsa_fixed_list) {
@@ -223,21 +216,27 @@ int qglsa_main(int argc, char **argv)
printf("Injecting GLSA %s%s%s\n", GREEN, argv[i], NORM);
qglsa_append_to_list(argv[i]);
}
+ free(buf);
break;
default:
- if ((dir = opendir(".")) == NULL)
+ if ((dir = fdopendir(glsa_fd)) == NULL)
return EXIT_FAILURE;
+ buf = NULL;
+ buflen = 0;
while ((dentry = readdir(dir)) != NULL) {
/* validate this file as a proper glsa */
char glsa_id[20];
if (strncmp(dentry->d_name, "glsa-", 5))
continue;
- strcpy(glsa_id, dentry->d_name + 5);
- if ((s = strchr(glsa_id, '.')) == NULL || memcmp(s, ".xml\0", 5))
+ if ((s = strchr(dentry->d_name, '.')) == NULL || memcmp(s, ".xml\0", 5))
+ continue;
+ size_t len = s - dentry->d_name;
+ if (len >= sizeof(glsa_id) || len <= 5)
continue;
- *s = '\0';
+ memcpy(glsa_id, dentry->d_name + 5, len - 5);
+ glsa_id[len - 5] = '\0';
/* see if we want to skip glsa's already fixed */
if (!all_glsas && glsa_fixed_list) {
@@ -246,7 +245,7 @@ int qglsa_main(int argc, char **argv)
}
/* load the glsa into memory */
- if (eat_file(dentry->d_name, buf, sizeof(buf)) == 0)
+ if (!eat_file_at(glsa_fd, dentry->d_name, &buf, &buflen))
errp("could not eat %s", dentry->d_name);
/* now lets figure out what to do with this memory */
@@ -300,6 +299,8 @@ int qglsa_main(int argc, char **argv)
}
free(glsa_fixed_list);
+ close(glsa_fd);
+ close(portdir_fd);
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-05-19 17:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-05-19 17:37 UTC (permalink / raw
To: gentoo-commits
commit: 357a4c2d329ccf46cddb96e07c9308105e977fd3
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue May 19 16:17:05 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue May 19 16:17:05 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=357a4c2d
cache: rework and move to /var/cache/edb
Since we want the portdir to be read-only when possible, move our
cache files to /var/cache/edb. This means the cache regeneration
logic isn't as robust (as we can't rely on rsync deleting it), but
so be it. We can see about improving this in the future.
URL: https://bugs.gentoo.org/548052
Reported-by: Martin Väth <martin <AT> mvath.de>
main.c | 125 ++++++++++++++++++++++++++++----------------------------------
qcache.c | 14 +------
qglsa.c | 16 +++++---
qsearch.c | 2 +-
4 files changed, 69 insertions(+), 88 deletions(-)
diff --git a/main.c b/main.c
index 51c48aa..d127621 100644
--- a/main.c
+++ b/main.c
@@ -35,6 +35,7 @@ char reinitialize_metacache = 0;
static char *portdir;
static char *portarch;
static char *portvdb;
+static char *portedb;
const char portcachedir_pms[] = "metadata/cache";
const char portcachedir_md5[] = "metadata/md5-cache";
static char *portroot;
@@ -698,6 +699,7 @@ void initialize_portage_env(void)
_Q_EVS(STR, PORTAGE_TMPDIR, port_tmpdir, CONFIG_EPREFIX "var/tmp/portage/")
_Q_EVS(STR, PKGDIR, pkgdir, CONFIG_EPREFIX "usr/portage/packages/")
_Q_EVS(STR, Q_VDB, portvdb, CONFIG_EPREFIX "var/db/pkg")
+ _Q_EVS(STR, Q_EDB, portedb, CONFIG_EPREFIX "var/cache/edb")
{ NULL, 0, _Q_BOOL, { NULL }, 0, NULL, }
#undef _Q_EV
@@ -846,92 +848,83 @@ int filter_hidden(const struct dirent *dentry)
return 1;
}
-#define CACHE_EBUILD_FILE (getenv("CACHE_EBUILD_FILE") ? getenv("CACHE_EBUILD_FILE") : ".ebuild.x")
-#define CACHE_METADATA_FILE ".metadata.x"
-const char *initialize_flat(int cache_type);
-const char *initialize_flat(int cache_type)
+static const char *
+initialize_flat(int cache_type, bool force)
{
struct dirent **category, **pn, **eb;
struct stat st;
struct timeval start, finish;
- static const char *cache_file;
- const char *portcachedir_actual;
+ char *cache_file;
char *p;
- int a, b, c, d, e, i;
+ int i;
int frac, secs, count;
FILE *fp;
- a = b = c = d = e = i = 0;
count = frac = secs = 0;
- cache_file = (cache_type == CACHE_EBUILD ? CACHE_EBUILD_FILE : CACHE_METADATA_FILE);
-
- if (chdir(portdir) != 0) {
- warnp("chdir to PORTDIR '%s' failed", portdir);
- goto ret;
- }
+ int portdir_fd, subdir_fd;
+ portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
if (cache_type == CACHE_METADATA) {
- if (chdir(portcachedir_md5) == 0) {
- portcachedir_type = CACHE_METADATA_MD5;
- portcachedir_actual = portcachedir_md5;
- } else if (chdir(portcachedir_pms) == 0) {
+ subdir_fd = openat(portdir_fd, portcachedir_md5, O_RDONLY|O_CLOEXEC);
+ if (subdir_fd == -1) {
+ subdir_fd = openat(portdir_fd, portcachedir_pms, O_RDONLY|O_CLOEXEC);
+ if (subdir_fd == -1) {
+ warnp("could not read md5 or pms cache dirs in %s", portdir);
+ goto ret;
+ }
portcachedir_type = CACHE_METADATA_PMS;
- portcachedir_actual = portcachedir_pms;
- } else {
- warnp("chdir to portage cache '%s/%s' or '%s/%s' failed", portdir, portcachedir_md5, portdir, portcachedir_pms);
- goto ret;
- }
- }
+ } else
+ portcachedir_type = CACHE_METADATA_MD5;
+ } else
+ subdir_fd = portdir_fd;
+ xasprintf(&cache_file, "%s/dep/%s/%s", portedb, portdir,
+ (cache_type == CACHE_EBUILD ? ".ebuild.x" : ".metadata.x"));
- if (stat(cache_file, &st) != -1)
+ if (stat(cache_file, &st) != -1) {
if (st.st_size == 0)
unlink(cache_file);
-
- /* assuming --sync is used with --delete this will get recreated after every merge */
- if (access(cache_file, R_OK) == 0)
+ } else if (!force) {
+ /* assuming --sync is used with --delete this will get recreated after every merge */
goto ret;
+ }
if (!quiet)
warn("Updating ebuild %scache ... ", cache_type == CACHE_EBUILD ? "" : "meta");
- unlink(cache_file);
- if (errno != ENOENT) {
- warnfp("unlinking '%s/%s' failed", portdir, cache_file);
- goto ret;
- }
-
- if ((fp = fopen(cache_file, "w")) == NULL) {
- if (cache_type == CACHE_EBUILD)
- warnfp("opening '%s/%s' failed", portdir, cache_file);
- else
- warnfp("opening '%s/%s/%s' failed", portdir, portcachedir_actual, cache_file);
+ if ((fp = fopen(cache_file, "we")) == NULL) {
+ warnfp("opening cache failed: %s", cache_file);
if (errno == EACCES)
warnf("You should run this command as root: q -%c",
- cache_type == CACHE_EBUILD ? 'r' : 'm');
+ cache_type == CACHE_EBUILD ? 'r' : 'm');
goto ret;
}
gettimeofday(&start, NULL);
- if ((a = scandir(".", &category, q_vdb_filter_cat, alphasort)) < 0)
+ int cat_cnt;
+ cat_cnt = scandirat(subdir_fd, ".", &category, q_vdb_filter_cat, alphasort);
+ if (cat_cnt < 0)
goto ret;
- for (i = 0; i < a; i++) {
- stat(category[i]->d_name, &st);
+ for (i = 0; i < cat_cnt; i++) {
+ if (fstatat(subdir_fd, category[i]->d_name, &st, 0))
+ continue;
if (!S_ISDIR(st.st_mode))
continue;
if (strchr(category[i]->d_name, '-') == NULL)
if (strncmp(category[i]->d_name, "virtual", 7) != 0)
continue;
- if ((b = scandir(category[i]->d_name, &pn, q_vdb_filter_pkg, alphasort)) < 0)
+ int c, pkg_cnt;
+ pkg_cnt = scandirat(subdir_fd, category[i]->d_name, &pn, q_vdb_filter_pkg, alphasort);
+ if (pkg_cnt < 0)
continue;
- for (c = 0; c < b; c++) {
+ for (c = 0; c < pkg_cnt; c++) {
char de[_Q_PATH_MAX];
snprintf(de, sizeof(de), "%s/%s", category[i]->d_name, pn[c]->d_name);
- if (stat(de, &st) < 0)
+ if (fstatat(subdir_fd, de, &st, 0) < 0)
continue;
switch (cache_type) {
@@ -943,24 +936,25 @@ const char *initialize_flat(int cache_type)
if (S_ISREG(st.st_mode))
fprintf(fp, "%s\n", de);
continue;
- break;
}
- if ((e = scandir(de, &eb, filter_hidden, alphasort)) < 0)
+
+ int e, ebuild_cnt;
+ ebuild_cnt = scandirat(subdir_fd, de, &eb, filter_hidden, alphasort);
+ if (ebuild_cnt < 0)
continue;
- for (d = 0; d < e; d++) {
- if ((p = strrchr(eb[d]->d_name, '.')) != NULL)
+ for (e = 0; e < ebuild_cnt; ++e) {
+ if ((p = strrchr(eb[e]->d_name, '.')) != NULL)
if (strcmp(p, ".ebuild") == 0) {
count++;
- fprintf(fp, "%s/%s/%s\n", category[i]->d_name, pn[c]->d_name, eb[d]->d_name);
+ fprintf(fp, "%s/%s\n", de, eb[e]->d_name);
}
}
- while (d--) free(eb[d]);
- free(eb);
+ scandir_free(eb, ebuild_cnt);
}
- scandir_free(pn, b);
+ scandir_free(pn, pkg_cnt);
}
fclose(fp);
- scandir_free(category, a);
+ scandir_free(category, cat_cnt);
if (quiet) goto ret;
@@ -978,27 +972,20 @@ const char *initialize_flat(int cache_type)
if (secs > 120)
warn("You should consider using the noatime mount option for PORTDIR='%s' if it's not already enabled", portdir);
ret:
+ close(subdir_fd);
+ if (subdir_fd != portdir_fd)
+ close(portdir_fd);
return cache_file;
}
-#define initialize_ebuild_flat() initialize_flat(CACHE_EBUILD)
-#define initialize_metadata_flat() initialize_flat(CACHE_METADATA)
-
-void reinitialize_ebuild_flat(void)
-{
- if (chdir(portdir) != 0) {
- warnp("chdir to PORTDIR '%s' failed", portdir);
- return;
- }
- unlink(CACHE_EBUILD_FILE);
- initialize_ebuild_flat();
-}
+#define initialize_ebuild_flat() initialize_flat(CACHE_EBUILD, false)
+#define initialize_metadata_flat() initialize_flat(CACHE_METADATA, false)
void reinitialize_as_needed(void)
{
if (reinitialize)
- reinitialize_ebuild_flat();
+ initialize_flat(CACHE_EBUILD, true);
if (reinitialize_metacache)
- initialize_metadata_flat();
+ initialize_flat(CACHE_METADATA, true);
}
typedef struct {
diff --git a/qcache.c b/qcache.c
index d0bab3b..0968d33 100644
--- a/qcache.c
+++ b/qcache.c
@@ -47,13 +47,6 @@ static const char * const qcache_opts_help[] = {
#define qcache_usage(ret) usage(ret, QCACHE_FLAGS, qcache_long_opts, qcache_opts_help, lookup_applet_idx("qcache"))
/********************************************************************/
-/* Constants */
-/********************************************************************/
-
-/* TODO: allow the user to override this value if s/he wishes */
-#define QCACHE_EDB "/var/cache/edb/dep"
-
-/********************************************************************/
/* Structs */
/********************************************************************/
@@ -512,7 +505,7 @@ int qcache_traverse(void (*func)(qcache_data*))
int i, j, k, len, num_cat, num_pkg, num_ebuild;
struct dirent **categories, **packages, **ebuilds;
- xasprintf(&catpath, "%s%s", QCACHE_EDB, portdir);
+ xasprintf(&catpath, "%s/dep/%s", portedb, portdir);
if (-1 == (num_cat = scandir(catpath, &categories, qcache_file_select, alphasort))) {
errp("%s", catpath);
@@ -754,11 +747,8 @@ void qcache_stats(qcache_data *data)
if (!numpkg) {
struct dirent **categories;
char *catpath;
- int len;
- len = sizeof(char) * (strlen(QCACHE_EDB) + strlen(portdir) + 1);
- catpath = xzalloc(len);
- snprintf(catpath, len, "%s%s", QCACHE_EDB, portdir);
+ xasprintf(&catpath, "%s/dep/%s", portedb, portdir);
if (-1 == (numcat = scandir(catpath, &categories, qcache_file_select, alphasort))) {
errp("%s", catpath);
diff --git a/qglsa.c b/qglsa.c
index 328bbd8..7fba5c7 100644
--- a/qglsa.c
+++ b/qglsa.c
@@ -8,8 +8,6 @@
#ifdef APPLET_qglsa
-#define QGLSA_DB "/var/cache/edb/glsa"
-
#define QGLSA_FLAGS "ldtpfi" COMMON_FLAGS
static struct option const qglsa_long_opts[] = {
{"list", no_argument, NULL, 'l'},
@@ -34,19 +32,25 @@ static const char * const qglsa_opts_help[] = {
static char *qglsa_load_list(void);
static char *qglsa_load_list(void)
{
- char *ret = NULL;
+ char *file, *ret = NULL;
size_t size = 0;
- eat_file(QGLSA_DB, &ret, &size);
+ xasprintf(&file, "%s/glsa", portedb);
+ eat_file(file, &ret, &size);
+ free(file);
return ret;
}
static void qglsa_append_to_list(const char *glsa);
static void qglsa_append_to_list(const char *glsa)
{
+ char *file;
FILE *f;
- if ((f = fopen(QGLSA_DB, "a")) != NULL) {
- fprintf(f, "%s\n", glsa);
+ xasprintf(&file, "%s/glsa", portedb);
+ if ((f = fopen(file, "a")) != NULL) {
+ fputs(glsa, f);
+ fputc('\n', f);
fclose(f);
}
+ free(file);
}
static void qglsa_decode_entities(char *xml_buf, size_t len);
diff --git a/qsearch.c b/qsearch.c
index e1285a3..ce36df2 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -88,7 +88,7 @@ int qsearch_main(int argc, char **argv)
}
#endif
last[0] = 0;
- fp = fopen(initialize_flat(search_cache), "r");
+ fp = fopen(initialize_flat(search_cache, false), "r");
if (!fp)
return 1;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-05-19 17:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-05-19 17:37 UTC (permalink / raw
To: gentoo-commits
commit: 28d0df0c3be0042006fbf39ff83d4d0342832caa
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue May 19 16:04:57 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue May 19 16:04:57 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=28d0df0c
qgrep/qpkg: use the cache file given
The qgrep code needs a rework to avoid chdir assumptions, but that's
much larger than fixing the cache file name, so punt for later.
qgrep.c | 4 ++--
qpkg.c | 14 +-------------
2 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/qgrep.c b/qgrep.c
index 982672d..de018ea 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -371,9 +371,9 @@ int qgrep_main(int argc, char **argv)
/* go look either in ebuilds or eclasses or VDB */
if (!do_eclass && !do_installed) {
- initialize_ebuild_flat(); /* sets our pwd to $PORTDIR */
- if ((fp = fopen(CACHE_EBUILD_FILE, "r")) == NULL)
+ if ((fp = fopen(initialize_ebuild_flat(), "r")) == NULL)
return 1;
+ xchdir(portdir);
} else if (do_eclass) {
xchdir(portdir);
if ((eclass_dir = opendir("eclass")) == NULL)
diff --git a/qpkg.c b/qpkg.c
index 5b63ec2..50d79f6 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -122,19 +122,7 @@ int qpkg_clean(char *dirp)
}
if (eclean) {
- char fname[_Q_PATH_MAX] = "";
- const char *ecache;
-
- /* CACHE_EBUILD_FILE is a macro so don't put it in the .bss */
- ecache = CACHE_EBUILD_FILE;
-
- if (ecache) {
- if (*ecache != '/')
- snprintf(fname, sizeof(fname), "%s/%s", portdir, ecache);
- else
- strncpy(fname, ecache, sizeof(fname));
- }
- if ((fp = fopen(fname, "r")) != NULL) {
+ if ((fp = fopen(initialize_ebuild_flat(), "r")) != NULL) {
size_t buflen;
char *buf;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-05-19 17:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-05-19 17:37 UTC (permalink / raw
To: gentoo-commits
commit: eeb816f6dcf9a634303e3f1bd1e43d472a3fcff6
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue May 19 16:56:10 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue May 19 16:56:10 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=eeb816f6
qlop: support $EMERGE_LOG_DIR
Portage stores its emerge.log in the $EMERGE_LOG_DIR dir, so try loading
that setting instead of hardcoding /var/log ourselves.
URL: https://bugs.gentoo.org/513592
Reported-by: Kerin Millar <kerframil <AT> fastmail.co.uk>
main.c | 2 ++
qlop.c | 18 ++++++++----------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/main.c b/main.c
index d127621..29a889f 100644
--- a/main.c
+++ b/main.c
@@ -32,6 +32,7 @@ int portcachedir_type = 0;
char pretend = 0;
char reinitialize = 0;
char reinitialize_metacache = 0;
+static char *portlogdir;
static char *portdir;
static char *portarch;
static char *portvdb;
@@ -694,6 +695,7 @@ void initialize_portage_env(void)
_Q_EVB(BOOL, NOCOLOR, nocolor, 0)
_Q_EVS(ISTR, FEATURES, features, "noman noinfo nodoc")
_Q_EVS(STR, EPREFIX, eprefix, CONFIG_EPREFIX)
+ _Q_EVS(STR, EMERGE_LOG_DIR, portlogdir, CONFIG_EPREFIX "var/log")
_Q_EVS(STR, PORTDIR, portdir, CONFIG_EPREFIX "usr/portage")
_Q_EVS(STR, PORTAGE_BINHOST, binhost, DEFAULT_PORTAGE_BINHOST)
_Q_EVS(STR, PORTAGE_TMPDIR, port_tmpdir, CONFIG_EPREFIX "var/tmp/portage/")
diff --git a/qlop.c b/qlop.c
index 93dbcc8..390865a 100644
--- a/qlop.c
+++ b/qlop.c
@@ -26,7 +26,7 @@
# include <sys/sysctl.h>
#endif
-#define QLOP_DEFAULT_LOGFILE CONFIG_EPREFIX "var/log/emerge.log"
+#define QLOP_DEFAULT_LOGFILE "emerge.log"
#define QLOP_FLAGS "gtHluscf:" COMMON_FLAGS
static struct option const qlop_long_opts[] = {
@@ -48,7 +48,7 @@ static const char * const qlop_opts_help[] = {
"Show unmerge history",
"Show sync history",
"Show current emerging packages",
- "Read emerge logfile instead of " QLOP_DEFAULT_LOGFILE,
+ "Read emerge logfile instead of $EMERGE_LOG_DIR/" QLOP_DEFAULT_LOGFILE,
COMMON_OPTS_HELP
};
#define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, lookup_applet_idx("qlop"))
@@ -646,13 +646,11 @@ int qlop_main(int argc, char **argv)
{
int i, average = 1;
char do_time, do_list, do_unlist, do_sync, do_current, do_human_readable = 0;
- char *opt_logfile;
- const char *logfile = QLOP_DEFAULT_LOGFILE;
+ char *logfile = NULL;
DBG("argc=%d argv[0]=%s argv[1]=%s",
argc, argv[0], argc > 1 ? argv[1] : "NULL?");
- opt_logfile = NULL;
do_time = do_list = do_unlist = do_sync = do_current = 0;
while ((i = GETOPT_LONG(QLOP, qlop, "")) != -1) {
@@ -667,15 +665,15 @@ int qlop_main(int argc, char **argv)
case 'g': do_time = 1; average = 0; break;
case 'H': do_human_readable = 1; break;
case 'f':
- if (opt_logfile) err("Only use -f once");
- opt_logfile = xstrdup(optarg);
+ if (logfile) err("Only use -f once");
+ logfile = xstrdup(optarg);
break;
}
}
if (!do_list && !do_unlist && !do_time && !do_sync && !do_current)
qlop_usage(EXIT_FAILURE);
- if (opt_logfile != NULL)
- logfile = opt_logfile;
+ if (logfile == NULL)
+ xasprintf(&logfile, "%s/%s", portlogdir, QLOP_DEFAULT_LOGFILE);
argc -= optind;
argv += optind;
@@ -696,7 +694,7 @@ int qlop_main(int argc, char **argv)
show_merge_times(argv[i], logfile, average, do_human_readable);
}
- if (opt_logfile) free(opt_logfile);
+ free(logfile);
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-05-19 17:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-05-19 17:37 UTC (permalink / raw
To: gentoo-commits
commit: 3044a7a90ef35ae564bfdf2d44fbb75920ce0c61
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue May 19 16:58:22 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue May 19 16:58:22 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3044a7a9
regen autotools
Makefile.am | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 3a33bbe..5ffa339 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,6 +94,7 @@ EXTRA_DIST += \
libq/atom_compare.c \
libq/atom_explode.c \
libq/basename.c \
+ libq/binpackages.c \
libq/busybox.h \
libq/colors.c \
libq/compat.c \
@@ -171,6 +172,29 @@ EXTRA_DIST += \
tests/profile/profile1/etc/portage/make.conf \
tests/profile/profile1/etc/portage/subdir/file.conf \
tests/profile/profile1/etc/portage/this.level.conf \
+ tests/qcheck/Makefile \
+ tests/qcheck/dotest \
+ tests/qcheck/list01.good \
+ tests/qcheck/list02.good \
+ tests/qcheck/list03.good \
+ tests/qcheck/list04.good \
+ tests/qcheck/list05.good \
+ tests/qcheck/list06.good \
+ tests/qcheck/list07.good \
+ tests/qcheck/list08.good \
+ tests/qcheck/list09.good \
+ tests/qcheck/root/a-b/pkg-1.0/CONTENTS \
+ tests/qcheck/root/a-b/pkg-1.0/SLOT \
+ tests/qcheck/root/a-b/pkg-1.0/repository \
+ tests/qcheck/root/bin/bad-md5 \
+ tests/qcheck/root/bin/bad-mtime \
+ tests/qcheck/root/bin/bad-mtime-obj \
+ tests/qcheck/root/bin/bad-sha1 \
+ tests/qcheck/root/bin/good-md5 \
+ tests/qcheck/root/bin/good-sha1 \
+ tests/qcheck/root/cat/pkg-1/CONTENTS \
+ tests/qcheck/root/cat/pkg-1/SLOT \
+ tests/qcheck/root/cat/pkg-1/repository \
tests/qdepends/Makefile \
tests/qdepends/dotest \
tests/qdepends/list01.good \
@@ -205,6 +229,7 @@ EXTRA_DIST += \
tests/qlist/list12.good \
tests/qlist/list13.good \
tests/qlist/list14.good \
+ tests/qlist/list15.good \
tests/qlist/root/-merge-foo/CONTENTS \
tests/qlist/root/a-b/a-0/CONTENTS \
tests/qlist/root/a-b/a-0/SLOT \
@@ -224,6 +249,11 @@ EXTRA_DIST += \
tests/qlist/root/sys-fs/mtools-4.0.13/CONTENTS \
tests/qlist/root/sys-fs/mtools-4.0.13/SLOT \
tests/qlist/root/sys-fs/mtools-4.0.13/repository \
+ tests/qlop/Makefile \
+ tests/qlop/dotest \
+ tests/qlop/list01.good \
+ tests/qlop/sync.log \
+ tests/qmerge/.gdb_history \
tests/qmerge/Makefile \
tests/qmerge/dotest \
tests/qmerge/packages/Packages \
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-05-31 8:31 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-05-31 8:31 UTC (permalink / raw
To: gentoo-commits
commit: ed40d1927d6bed3dc8f0cd5eb10e2bdc65397cfb
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun May 31 08:11:54 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun May 31 08:14:17 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ed40d192
qmerge: do not warn about missing symlinks when unmerging
We were going to delete them anyways, so if they weren't found, it's
not actually a problem we should warn about.
qmerge.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index a3e2fd2..ddc0a10 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1107,8 +1107,11 @@ pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, queue *keep)
case CONTENTS_SYM:
if (fstatat(portroot_fd, e->name + 1, &st, AT_SYMLINK_NOFOLLOW)) {
- warnp("stat failed for %s -> '%s'", e->name, e->sym_target);
- continue;
+ if (errno != ENOENT) {
+ warnp("stat failed for %s -> '%s'", e->name, e->sym_target);
+ continue;
+ } else
+ break;
}
/* Hrm, if it isn't a symlink anymore, then leave it be */
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-06-03 15:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-06-03 15:44 UTC (permalink / raw
To: gentoo-commits
commit: baa1bfde6b1210ee37a193d3cd258477e02457b5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 3 15:33:36 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Jun 3 15:33:36 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=baa1bfde
tweak s390/sh ARCH defaults
main.h | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/main.h b/main.h
index 0b125ac..877c1ec 100644
--- a/main.h
+++ b/main.h
@@ -64,12 +64,8 @@
# define URL_ARCH "ppc"
# endif
# elif defined(__s390__)
-# if defined(__s390x__)
-# define URL_ARCH "s390x"
-# else
-# define URL_ARCH "s390"
-# endif
-# elif defined(__sh4__)
+# define URL_ARCH "s390"
+# elif defined(__sh__)
# define URL_ARCH "sh"
# elif defined(__sparc__)
# define URL_ARCH "sparc"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-06-03 15:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-06-03 15:44 UTC (permalink / raw
To: gentoo-commits
commit: facaa636947ceeffce0c7a5a5dd52fee8e9175ca
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 3 15:40:42 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Jun 3 15:40:42 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=facaa636
support repos.conf files
Since the system is moving away from PORTDIR/etc... and to a more
flexible repos.conf setup, make sure we support that stuff.
This pulls in an external dependency which is new for us, but the
iniparser library is very small (<20k on x86_64), written in pure
C, and is used by big projects already (like samba). Doing an NIH
thing here would be a waste of time.
URL: https://bugs.gentoo.org/540620
Reported-by: Elias Probst <mail <AT> eliasprobst.eu>
Makefile | 1 +
main.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
porting.h | 2 ++
3 files changed, 63 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 7304559..fe6092f 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc, -fsanitize=address
#CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2 -falign-labels=2 -falign-loops=2
#LDFLAGS := -pie
LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo '-lkvm')
+LIBADD += -liniparser
DESTDIR :=
PREFIX := $(DESTDIR)/usr
STRIP := strip
diff --git a/main.c b/main.c
index 29a889f..cb180df 100644
--- a/main.c
+++ b/main.c
@@ -421,6 +421,57 @@ contents_entry *contents_parse_line(char *line)
return &e;
}
+/* Handle a single file in the repos.conf format. */
+static void read_one_repos_conf(const char *repos_conf)
+{
+ char *conf;
+ const char *repo, *path;
+ dictionary *dict;
+
+ dict = iniparser_load(repos_conf);
+
+ repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
+ if (repo) {
+ xasprintf(&conf, "%s:location", repo);
+ path = iniparser_getstring(dict, conf, NULL);
+ if (path) {
+ free(portdir);
+ portdir = xstrdup(path);
+ }
+ free(conf);
+ }
+
+ iniparser_freedict(dict);
+}
+
+/* Handle a possible directory of files. */
+static void read_repos_conf(const char *configroot, const char *repos_conf)
+{
+ char *top_conf, *sub_conf;
+ int i, count;
+ struct dirent **confs;
+
+ xasprintf(&top_conf, "%s%s", configroot, repos_conf);
+ count = scandir(top_conf, &confs, NULL, alphasort);
+ if (count == -1) {
+ if (errno == ENOTDIR)
+ read_one_repos_conf(top_conf);
+ } else {
+ for (i = 0; i < count; ++i) {
+ const char *name = confs[i]->d_name;
+
+ if (name[0] == '.' || confs[i]->d_type != DT_REG)
+ continue;
+
+ xasprintf(&sub_conf, "%s/%s", top_conf, name);
+ read_one_repos_conf(sub_conf);
+ free(sub_conf);
+ }
+ scandir_free(confs, count);
+ }
+ free(top_conf);
+}
+
static void strincr_var(const char *name, const char *s, char **value, size_t *value_len)
{
size_t len;
@@ -715,18 +766,18 @@ void initialize_portage_env(void)
}
/* figure out where to find our config files */
- s = getenv("PORTAGE_CONFIGROOT");
- if (!s)
- s = "/";
+ const char *configroot = getenv("PORTAGE_CONFIGROOT");
+ if (!configroot)
+ configroot = "/";
/* walk all the stacked profiles */
- read_portage_profile(s, CONFIG_EPREFIX "etc/make.profile", vars_to_read);
- read_portage_profile(s, CONFIG_EPREFIX "etc/portage/make.profile", vars_to_read);
+ read_portage_profile(configroot, CONFIG_EPREFIX "etc/make.profile", vars_to_read);
+ read_portage_profile(configroot, CONFIG_EPREFIX "etc/portage/make.profile", vars_to_read);
/* now read all the config files */
read_portage_env_file("", CONFIG_EPREFIX "usr/share/portage/config/make.globals", vars_to_read);
- read_portage_env_file(s, CONFIG_EPREFIX "etc/make.conf", vars_to_read);
- read_portage_env_file(s, CONFIG_EPREFIX "etc/portage/make.conf", vars_to_read);
+ read_portage_env_file(configroot, CONFIG_EPREFIX "etc/make.conf", vars_to_read);
+ read_portage_env_file(configroot, CONFIG_EPREFIX "etc/portage/make.conf", vars_to_read);
/* finally, check the env */
for (i = 0; vars_to_read[i].name; ++i) {
@@ -826,6 +877,8 @@ void initialize_portage_env(void)
portroot[var->value_len + 1] = '\0';
}
+ read_repos_conf(configroot, CONFIG_EPREFIX "etc/portage/repos.conf");
+
if (getenv("PORTAGE_QUIET") != NULL)
quiet = 1;
diff --git a/porting.h b/porting.h
index 3235542..8045813 100644
--- a/porting.h
+++ b/porting.h
@@ -49,6 +49,8 @@
#include <sys/time.h>
#include <sys/types.h>
+#include <iniparser.h>
+
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr)))
#ifndef BUFSIZE
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-06-06 6:20 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-06-06 6:20 UTC (permalink / raw
To: gentoo-commits
commit: 248e2d0ba29dad806840b151ae80d4c0fe728724
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 6 05:33:49 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Jun 6 05:33:49 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=248e2d0b
qsearch: update cache handling
The cache rewrite dropped the implicit chdir (by design), but the qsearch
code was still relying on that. Update qsearch to use *at style functions
and also convert the fgets usage to getline.
URL: https://bugs.gentoo.org/551206
Reported-by: Guilherme Amadio <amadio <AT> gentoo.org>
qsearch.c | 61 +++++++++++++++++++++++++++++++++++++++----------------------
1 file changed, 39 insertions(+), 22 deletions(-)
diff --git a/qsearch.c b/qsearch.c
index ce36df2..05a54e6 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -34,15 +34,14 @@ static const char * const qsearch_opts_help[] = {
int qsearch_main(int argc, char **argv)
{
FILE *fp;
- char buf[_Q_PATH_MAX];
- char ebuild[_Q_PATH_MAX];
+ char *ebuild = NULL;
char last[126] = "";
char *p, *q, *str;
char *search_me = NULL;
char show_homepage = 0, show_name_only = 0;
char search_desc = 0, search_all = 0, search_name = 1, search_cache = CACHE_EBUILD;
const char *search_vars[] = { "DESCRIPTION=", "HOMEPAGE=" };
- size_t search_len;
+ size_t search_len, ebuild_len;
int i, idx=0;
DBG("argc=%d argv[0]=%s argv[1]=%s",
@@ -92,9 +91,14 @@ int qsearch_main(int argc, char **argv)
if (!fp)
return 1;
+ int portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
+ if (portdir_fd < 0)
+ errp("open(%s) failed", portdir);
+
+ q = NULL; /* Silence a gcc warning. */
search_len = strlen(search_vars[idx]);
- while (fgets(ebuild, sizeof(ebuild), fp) != NULL) {
+ while (getline(&ebuild, &ebuild_len, fp) != -1) {
if ((p = strchr(ebuild, '\n')) != NULL)
*p = 0;
if (!ebuild[0])
@@ -139,35 +143,46 @@ int qsearch_main(int argc, char **argv)
}
}
- if ((ebuildfp = fopen(ebuild, "r")) != NULL) {
- while (fgets(buf, sizeof(buf), ebuildfp) != NULL) {
- if (strlen(buf) <= search_len)
- continue;
- if (strncmp(buf, search_vars[idx], search_len) == 0) {
- if ((q = strrchr(buf, '"')) != NULL)
- *q = 0;
- if (strlen(buf) <= search_len)
- break;
- q = buf + search_len + 1;
- if (!search_all && !search_name && rematch(search_me, q, REG_EXTENDED | REG_ICASE) != 0)
- break;
- show_it = true;
- break;
- }
+ int fd = openat(portdir_fd, ebuild, O_RDONLY|O_CLOEXEC);
+ if (fd != -1) {
+ ebuildfp = fdopen(fd, "r");
+ if (ebuildfp == NULL) {
+ close(fd);
+ continue;
}
- fclose(ebuildfp);
} else {
if (!reinitialize)
warnfp("(cache update pending) %s", ebuild);
reinitialize = 1;
+ goto no_cache_ebuild_match;
+ }
+
+ char *buf = NULL;
+ size_t buflen;
+ while (getline(&buf, &buflen, ebuildfp) != -1) {
+ if (strlen(buf) <= search_len)
+ continue;
+ if (strncmp(buf, search_vars[idx], search_len) != 0)
+ continue;
+ if ((q = strrchr(buf, '"')) != NULL)
+ *q = 0;
+ if (strlen(buf) <= search_len)
+ break;
+ q = buf + search_len + 1;
+ if (!search_all && !search_name && rematch(search_me, q, REG_EXTENDED | REG_ICASE) != 0)
+ break;
+ show_it = true;
+ break;
}
if (show_it) {
- const char *b = basename(p);
printf("%s%s/%s%s%s %s\n",
- BOLD, dirname(p), BLUE, b, NORM,
+ BOLD, dirname(p), BLUE, basename(p), NORM,
(show_name_only ? "" : q ? : "<no DESCRIPTION found>"));
}
+
+ free(buf);
+ fclose(ebuildfp);
}
no_cache_ebuild_match:
free(str);
@@ -176,6 +191,8 @@ no_cache_ebuild_match:
} /* case CACHE_EBUILD */
} /* switch (search_cache) */
}
+ free(ebuild);
+ close(portdir_fd);
fclose(fp);
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-06-06 6:20 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-06-06 6:20 UTC (permalink / raw
To: gentoo-commits
commit: 7772431040d65329435a08ac31e7d4e4beec056a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 6 06:11:46 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Jun 6 06:11:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=77724310
autotools: also add -liniparser
Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.am b/Makefile.am
index 5ffa339..225c979 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,7 @@ q_CPPFLAGS = \
-I$(top_srcdir)/autotools/gnulib
q_LDADD = \
$(top_builddir)/autotools/gnulib/libgnu.a \
+ -liniparser \
$(LIB_CLOCK_GETTIME) \
$(LIB_EACCESS)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-06-06 6:20 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-06-06 6:20 UTC (permalink / raw
To: gentoo-commits
commit: 5d20d5da741d6e6665b7c1e4fb6873d22f186222
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 6 05:54:34 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Jun 6 05:54:34 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5d20d5da
cache: optimize the common case slightly
Do the cache sanity check immediately on the assumption that it will be
sane the majority of the time. No point in opening the portdir and such
just to close it immediately.
main.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/main.c b/main.c
index df1e309..66b3b30 100644
--- a/main.c
+++ b/main.c
@@ -915,6 +915,19 @@ initialize_flat(int cache_type, bool force)
int frac, secs, count;
FILE *fp;
+ xasprintf(&cache_file, "%s/dep/%s/%s", portedb, portdir,
+ (cache_type == CACHE_EBUILD ? ".ebuild.x" : ".metadata.x"));
+
+ /* If we aren't forcing a regen, make sure the file is somewhat sane. */
+ if (!force) {
+ if (stat(cache_file, &st) != -1)
+ if (st.st_size)
+ return cache_file;
+ }
+
+ if (!quiet)
+ warn("Updating ebuild %scache ... ", cache_type == CACHE_EBUILD ? "" : "meta");
+
count = frac = secs = 0;
int portdir_fd, subdir_fd;
@@ -933,17 +946,6 @@ initialize_flat(int cache_type, bool force)
portcachedir_type = CACHE_METADATA_MD5;
} else
subdir_fd = portdir_fd;
- xasprintf(&cache_file, "%s/dep/%s/%s", portedb, portdir,
- (cache_type == CACHE_EBUILD ? ".ebuild.x" : ".metadata.x"));
-
- /* If we aren't forcing a regen, make sure the file is somewhat sane. */
- if (!force) {
- if (stat(cache_file, &st) != -1)
- if (st.st_size)
- goto ret;
- }
- if (!quiet)
- warn("Updating ebuild %scache ... ", cache_type == CACHE_EBUILD ? "" : "meta");
if ((fp = fopen(cache_file, "we")) == NULL) {
warnfp("opening cache failed: %s", cache_file);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-06-06 6:20 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-06-06 6:20 UTC (permalink / raw
To: gentoo-commits
commit: b9a5aef5d7c6b7ed55c1441a7f74221bda694a23
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 6 05:31:44 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Jun 6 05:31:44 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b9a5aef5
cache: do not reinit every time
The rework accidentally changed the behavior so we would rebuild the
cache everytime we tried to load it.
main.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/main.c b/main.c
index cb180df..df1e309 100644
--- a/main.c
+++ b/main.c
@@ -936,12 +936,11 @@ initialize_flat(int cache_type, bool force)
xasprintf(&cache_file, "%s/dep/%s/%s", portedb, portdir,
(cache_type == CACHE_EBUILD ? ".ebuild.x" : ".metadata.x"));
- if (stat(cache_file, &st) != -1) {
- if (st.st_size == 0)
- unlink(cache_file);
- } else if (!force) {
- /* assuming --sync is used with --delete this will get recreated after every merge */
- goto ret;
+ /* If we aren't forcing a regen, make sure the file is somewhat sane. */
+ if (!force) {
+ if (stat(cache_file, &st) != -1)
+ if (st.st_size)
+ goto ret;
}
if (!quiet)
warn("Updating ebuild %scache ... ", cache_type == CACHE_EBUILD ? "" : "meta");
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-06-23 8:58 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-06-23 8:58 UTC (permalink / raw
To: gentoo-commits
commit: bb47adc4544369167b931113600d292d2b77c97a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 23 08:57:17 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jun 23 08:57:17 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=bb47adc4
repos.conf: fix behavior on systems w/out d_type
URL: https://bugs.gentoo.org/551696
Reported-by: Fabian Groffen <grobian <AT> gentoo.org>
main.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 66b3b30..609ed54 100644
--- a/main.c
+++ b/main.c
@@ -460,10 +460,27 @@ static void read_repos_conf(const char *configroot, const char *repos_conf)
for (i = 0; i < count; ++i) {
const char *name = confs[i]->d_name;
- if (name[0] == '.' || confs[i]->d_type != DT_REG)
+ if (name[0] == '.')
continue;
+#ifdef DT_UNKNOWN
+ if (confs[i]->d_type != DT_UNKNOWN &&
+ confs[i]->d_type != DT_REG &&
+ confs[i]->d_type != DT_LNK)
+ continue;
+#endif
+
xasprintf(&sub_conf, "%s/%s", top_conf, name);
+
+#ifdef DT_UNKNOWN
+ if (confs[i]->d_type != DT_REG)
+#endif
+ {
+ struct stat st;
+ if (stat(sub_conf, &st) || S_ISREG(st.st_mode))
+ continue;
+ }
+
read_one_repos_conf(sub_conf);
free(sub_conf);
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-09-15 18:27 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-09-15 18:27 UTC (permalink / raw
To: gentoo-commits
commit: e275dfedc41cecf51d96484eb34505d12dca5678
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 15 18:27:02 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Sep 15 18:27:02 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e275dfed
qatom: always display SLOT in verbose mode
URL: https://bugs.gentoo.org/560320
qatom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qatom.c b/qatom.c
index 25eee8e..f2c7ae4 100644
--- a/qatom.c
+++ b/qatom.c
@@ -56,8 +56,8 @@ int qatom_main(int argc, char **argv)
printf("%s %s %s", atom->CATEGORY, atom->PN, atom->PV);
if (verbose || atom->PR_int)
printf(" r%i", atom->PR_int);
- if (atom->SLOT)
- printf(" :%s", atom->SLOT);
+ if (verbose || atom->SLOT)
+ printf(" :%s", atom->SLOT ? atom->SLOT : "-");
if (verbose || atom->pfx_op != ATOM_OP_NONE)
printf(" %s", atom->pfx_op == ATOM_OP_NONE ? "-" : atom_op_str[atom->pfx_op]);
if (verbose || atom->sfx_op != ATOM_OP_NONE)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 8:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 8:00 UTC (permalink / raw
To: gentoo-commits
commit: a30baf6e2163eb4ed4dd6c9b5beee2473c775377
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 07:58:21 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 07:58:21 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a30baf6e
qdepends: rework dep tree flattening
By leveraging stpcpy, we don't need to call strlen at all, or update the
length of the buffer we've written to. Instead, make the func recursive
and pass around the start of the buffer that is ready to accept more data.
While we're here, increase the static buffer to 1MiB. Some packages (e.g.
qemu) are larger than the 8KiB we have which causes corruption/crashes.
There's no way we'd exceed 1MiB! </last-words>
qdepends.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/qdepends.c b/qdepends.c
index bcdeaa5..5ded84b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -70,7 +70,6 @@ _q_static void _dep_print_tree(FILE *fp, const dep_node *root, size_t space);
void dep_burn_tree(dep_node *root);
char *dep_flatten_tree(const dep_node *root);
_q_static void _dep_attach(dep_node *root, dep_node *attach_me, int type);
-_q_static void _dep_flatten_tree(const dep_node *root, char *buf, size_t *pos);
_q_static void _dep_burn_node(dep_node *node);
int qdepends_main_vdb(const char *depend_file, int argc, char **argv);
int qdepends_vdb_deep(const char *depend_file, const char *query);
@@ -352,33 +351,33 @@ _q_static void dep_prune_use(dep_node *root, const char *use)
if (root->children) dep_prune_use(root->children, use);
}
-void _dep_flatten_tree(const dep_node *root, char *buf, size_t *pos)
+_q_static char *
+_dep_flatten_tree(const dep_node *root, char *buf)
{
if (root->type == DEP_NULL) goto this_node_sucks;
if (root->type == DEP_NORM) {
- size_t len = strlen(root->info);
- memcpy(buf + *pos, root->info, len);
- *pos += len+1;
- buf[*pos-1] = ' ';
+ buf[0] = ' ';
+ buf = stpcpy(buf + 1, root->info);
}
- if (root->children) _dep_flatten_tree(root->children, buf, pos);
+ if (root->children)
+ buf = _dep_flatten_tree(root->children, buf);
this_node_sucks:
- if (root->neighbor) _dep_flatten_tree(root->neighbor, buf, pos);
+ if (root->neighbor)
+ buf = _dep_flatten_tree(root->neighbor, buf);
+ return buf;
}
char *dep_flatten_tree(const dep_node *root)
{
- static char flat[8192];
- size_t pos = 0;
- _dep_flatten_tree(root, flat, &pos);
- if (pos == 0) {
+ static char flat[1024 * 1024];
+ char *buf = _dep_flatten_tree(root, flat);
+ if (buf == flat) {
/* all the nodes were squashed ... for example:
* USE=-selinux RDEPEND="selinux? ( sys-libs/libselinux )"
*/
return NULL;
}
- flat[pos-1] = '\0';
- return flat;
+ return flat + 1;
}
struct qdepends_opt_state {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 8:59 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 8:59 UTC (permalink / raw
To: gentoo-commits
commit: 9a800fe6ba0176691c81f42ef50dcf37976e74ca
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 08:49:06 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 08:49:06 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9a800fe6
q: disable colors for pipes
There's no way to detect whether the output is going to a pager (and
we want color) or to another program (and we don't want color), so
turn off color for all pipes. This matches standard *nix behavior.
URL: https://bugs.gentoo.org/550556
Reported-by: Toralf Förster <toralf.foerster <AT> gmx.de>
main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/main.c b/main.c
index 609ed54..c4b9bcc 100644
--- a/main.c
+++ b/main.c
@@ -1376,12 +1376,9 @@ int main(int argc, char **argv)
bindtextdomain(argv0, CONFIG_EPREFIX "usr/share/locale");
textdomain(argv0);
-#if 1
if (fstat(fileno(stdout), &st) != -1)
if (!isatty(fileno(stdout)))
- if (S_ISFIFO(st.st_mode) == 0)
- no_colors();
-#endif
+ no_colors();
if ((getenv("TERM") == NULL) || (strcmp(getenv("TERM"), "dumb") == 0))
no_colors();
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
To: gentoo-commits
commit: 9ff62a4efd3cc34e852c55b3c52441a2a481d7cf
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 10:23:21 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 10:23:21 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9ff62a4e
qglsa: rewrite main body to support overlays
Mostly mechanical changes to split the large body of code out of
main and into a standalone function. Don't spend time splitting
this up into smaller commits as qglsa has been disabled for quite
some time.
URL: https://bugs.gentoo.org/553260
qglsa.c | 115 +++++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 66 insertions(+), 49 deletions(-)
diff --git a/qglsa.c b/qglsa.c
index 7fba5c7..7bc350f 100644
--- a/qglsa.c
+++ b/qglsa.c
@@ -29,6 +29,10 @@ static const char * const qglsa_opts_help[] = {
};
#define qglsa_usage(ret) usage(ret, QGLSA_FLAGS, qglsa_long_opts, qglsa_opts_help, lookup_applet_idx("qglsa"))
+typedef enum {
+ GLSA_FUNKYTOWN, GLSA_LIST, GLSA_DUMP, GLSA_TEST, GLSA_FIX, GLSA_INJECT
+} qglsa_action;
+
static char *qglsa_load_list(void);
static char *qglsa_load_list(void)
{
@@ -146,69 +150,35 @@ static void qglsa_act_list(char *glsa)
}
*/
-int qglsa_main(int argc, char **argv)
+
+static int
+qglsa_run_action(const char *overlay, qglsa_action action, const char *fixed_list,
+ bool all_glsas, unsigned int ind, int argc, char **argv)
{
- enum { GLSA_FUNKYTOWN, GLSA_LIST, GLSA_DUMP, GLSA_TEST, GLSA_FIX, GLSA_INJECT };
int i;
DIR *dir;
struct dirent *dentry;
char *buf;
size_t buflen = 0;
- char *s, *p, *glsa_fixed_list;
- int action = GLSA_FUNKYTOWN;
- int all_glsas = 0;
+ char *s, *p;
+ int overlay_fd, glsa_fd;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
- while ((i = GETOPT_LONG(QGLSA, qglsa, "")) != -1) {
-#define set_action(a) { if (action == 0) action = a; else err("cannot specify more than one action at a time"); }
- switch (i) {
- case 'l': set_action(GLSA_LIST); break;
- case 'd': set_action(GLSA_DUMP); break;
- case 't': set_action(GLSA_TEST); break;
- case 'p': pretend = 1; break;
- case 'f': set_action(GLSA_FIX); break;
- case 'i': set_action(GLSA_INJECT); break;
- COMMON_GETOPTS_CASES(qglsa)
- }
- }
- if (action == GLSA_FUNKYTOWN)
- qglsa_usage(EXIT_FAILURE);
- if (action != GLSA_LIST && optind == argc)
- err("specified action requires a list, either 'all', 'new', or GLSA numbers");
-
- glsa_fixed_list = NULL;
- for (i = optind; i < argc; ++i) {
- if (!strcmp(argv[i], "all")) {
- all_glsas = 1;
- if (optind+1 != argc)
- err("You may only use class names by themselves");
- } else if (!strcmp(argv[i], "new")) {
- all_glsas = 0;
- if (optind+1 != argc)
- err("You may only use class names by themselves");
- }
- }
- glsa_fixed_list = qglsa_load_list();
-
- int portdir_fd, glsa_fd;
- portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
- glsa_fd = openat(portdir_fd, "metadata/glsa", O_RDONLY|O_CLOEXEC);
+ overlay_fd = open(overlay, O_RDONLY|O_CLOEXEC|O_PATH);
+ glsa_fd = openat(overlay_fd, "metadata/glsa", O_RDONLY|O_CLOEXEC);
switch (action) {
/*case GLSA_FIX:*/
case GLSA_INJECT:
buf = NULL;
- for (i = optind; i < argc; ++i) {
+ for (i = ind; i < argc; ++i) {
free(buf);
xasprintf(&buf, "glsa-%s.xml", argv[i]);
if (faccessat(glsa_fd, buf, R_OK, 0)) {
warnp("Skipping invalid GLSA '%s'", argv[i]);
continue;
}
- if (glsa_fixed_list) {
- if (strstr(glsa_fixed_list, argv[i])) {
+ if (fixed_list) {
+ if (strstr(fixed_list, argv[i])) {
warn("Skipping already installed GLSA %s", argv[i]);
continue;
}
@@ -243,8 +213,8 @@ int qglsa_main(int argc, char **argv)
glsa_id[len - 5] = '\0';
/* see if we want to skip glsa's already fixed */
- if (!all_glsas && glsa_fixed_list) {
- if (strstr(glsa_fixed_list, glsa_id))
+ if (!all_glsas && fixed_list) {
+ if (strstr(fixed_list, glsa_id))
continue;
}
@@ -302,13 +272,60 @@ int qglsa_main(int argc, char **argv)
closedir(dir);
}
- free(glsa_fixed_list);
close(glsa_fd);
- close(portdir_fd);
+ close(overlay_fd);
return EXIT_SUCCESS;
}
+int qglsa_main(int argc, char **argv)
+{
+ int i;
+ char *fixed_list;
+ qglsa_action action = GLSA_FUNKYTOWN;
+ bool all_glsas = false;
+
+ DBG("argc=%d argv[0]=%s argv[1]=%s",
+ argc, argv[0], argc > 1 ? argv[1] : "NULL?");
+
+ while ((i = GETOPT_LONG(QGLSA, qglsa, "")) != -1) {
+#define set_action(a) { if (action == 0) action = a; else err("cannot specify more than one action at a time"); }
+ switch (i) {
+ case 'l': set_action(GLSA_LIST); break;
+ case 'd': set_action(GLSA_DUMP); break;
+ case 't': set_action(GLSA_TEST); break;
+ case 'p': pretend = 1; break;
+ case 'f': set_action(GLSA_FIX); break;
+ case 'i': set_action(GLSA_INJECT); break;
+ COMMON_GETOPTS_CASES(qglsa)
+ }
+ }
+ if (action == GLSA_FUNKYTOWN)
+ qglsa_usage(EXIT_FAILURE);
+ if (action != GLSA_LIST && optind == argc)
+ err("specified action requires a list, either 'all', 'new', or GLSA numbers");
+
+ for (i = optind; i < argc; ++i) {
+ if (!strcmp(argv[i], "all")) {
+ all_glsas = true;
+ if (optind+1 != argc)
+ err("You may only use class names by themselves");
+ } else if (!strcmp(argv[i], "new")) {
+ all_glsas = false;
+ if (optind+1 != argc)
+ err("You may only use class names by themselves");
+ }
+ }
+ fixed_list = qglsa_load_list();
+
+ int ret = 0;
+ size_t n;
+ const char *overlay;
+ array_for_each(overlays, n, overlay)
+ ret |= qglsa_run_action(overlay, action, fixed_list, all_glsas, optind, argc, argv);
+ return ret;
+}
+
#else
DEFINE_APPLET_STUB(qglsa)
#endif
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
To: gentoo-commits
commit: e5bc6a0ac189c60e2329a6b8eb00ffbddb8d015d
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 10:30:18 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 10:30:18 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e5bc6a0a
qsearch: drop dead testing code
qsearch.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/qsearch.c b/qsearch.c
index 05a54e6..baaed37 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -68,24 +68,6 @@ int qsearch_main(int argc, char **argv)
qsearch_usage(EXIT_FAILURE);
search_me = argv[optind];
}
-#ifdef TESTING
- /* FIXME: hardcoded */
- if ((search_cache == CACHE_EBUILD) && (access("/usr/portage/.qsearch.x", R_OK) == 0)) {
- if ((fp = fopen("/usr/portage/.qsearch.x", "r")) != NULL) {
- search_len = strlen(search_me);
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- if (strlen(buf) <= search_len)
- continue;
- /* add regexp, color highlighting and basename checks */
- if (strncmp(buf, search_me, search_len) == 0) {
- fputs(buf, stdout);
- }
- }
- fclose(fp);
- return 0;
- }
- }
-#endif
last[0] = 0;
fp = fopen(initialize_flat(search_cache, false), "r");
if (!fp)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
To: gentoo-commits
commit: 7c3b484d601e6c06cfc692bbf011fca338697725
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 09:43:52 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 09:43:52 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7c3b484d
quse: move file warnings behind verbose
Usually missing desc files are not errors but normal behavior:
people have trimmed the files or are using repos w/out them.
Move the warnings related to them behind --verbose so we don't
clutter up normal output.
quse.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/quse.c b/quse.c
index 049b6e9..c7c1863 100644
--- a/quse.c
+++ b/quse.c
@@ -97,8 +97,9 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
for (i = 0; i < NUM_SEARCH_FILES; ++i) {
snprintf(buf, buflen, "%s/profiles/%s", portdir, search_files[i]);
- if ((fp[i] = fopen(buf, "r")) == NULL)
- warnp("skipping %s", search_files[i]);
+ fp[i] = fopen(buf, "r");
+ if (verbose && fp[i] == NULL)
+ warnp("skipping %s", buf);
}
for (i = ind; i < argc; i++) {
@@ -157,7 +158,8 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
/* now scan the desc dir */
snprintf(buf, buflen, "%s/profiles/desc/", portdir);
if ((d = opendir(buf)) == NULL) {
- warnp("skipping profiles/desc/");
+ if (verbose)
+ warnp("skipping %s", buf);
goto done;
}
@@ -171,7 +173,8 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
snprintf(buf, buflen, "%s/profiles/desc/%s", portdir, de->d_name);
if ((fp[0] = fopen(buf, "r")) == NULL) {
- warn("Could not open '%s' for reading; skipping", de->d_name);
+ if (verbose)
+ warnp("skipping %s", buf);
continue;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
To: gentoo-commits
commit: 089d4340bdc41d35eab5ba961e8d9d2266e14cbd
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 09:19:36 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 09:19:36 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=089d4340
quse: use freeargv helper
quse.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/quse.c b/quse.c
index dddbf5b..049b6e9 100644
--- a/quse.c
+++ b/quse.c
@@ -400,15 +400,11 @@ int quse_main(int argc, char **argv)
print_highlighted_use_flags(&buf0[search_len + 1], optind, argc, argv);
puts(NORM);
if (verbose > 1) {
- char **ARGV = NULL;
- int ARGC = 0;
+ char **ARGV;
+ int ARGC;
makeargv(&buf0[search_len + 1], &ARGC, &ARGV);
- if (ARGC > 0) {
- quse_describe_flag(1, ARGC, ARGV);
- for (i = 0; i < ARGC; i++)
- free(ARGV[i]);
- free(ARGV);
- }
+ quse_describe_flag(1, ARGC, ARGV);
+ freeargv(ARGC, ARGV);
}
}
break;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
To: gentoo-commits
commit: 58513b6cba580354031623c11049ab8e0a8e6970
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 09:48:28 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 09:48:28 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=58513b6c
quse: fix invalid close
This happens to work normally as we only have fds {0,1,2} open
and {3} is the active file we're working on. Since the f loop
contains 3 (for an unrelated reason), we close the right fd.
But if there are more/fewer fd's open at start, it might fail,
and we leak the FILE* structure. Switch to closing the right
file pointer to avoid all this mess.
quse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/quse.c b/quse.c
index c7c1863..5ef88da 100644
--- a/quse.c
+++ b/quse.c
@@ -205,7 +205,7 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv)
if (!strcmp(argv[i], buf))
printf(" %s%s%s:%s%s%s: %s\n", BOLD, de->d_name, NORM, BLUE, argv[i], NORM, p);
}
- close(f);
+ fclose(fp[0]);
}
closedir(d);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
To: gentoo-commits
commit: 6c23cea972914761a0b1d4c79326da9f0352e758
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 09:39:13 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 09:39:13 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6c23cea9
main: load all overlays from repos.conf
No code currently uses this, but we'll start to cut over utils.
URL: https://bugs.gentoo.org/553260
main.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/main.c b/main.c
index c4b9bcc..8c7403b 100644
--- a/main.c
+++ b/main.c
@@ -72,6 +72,8 @@ void init_coredumps(void)
/* include common library code */
#include "libq/libq.c"
+static DECLARE_ARRAY(overlays);
+
_q_static
void no_colors(void)
{
@@ -424,19 +426,30 @@ contents_entry *contents_parse_line(char *line)
/* Handle a single file in the repos.conf format. */
static void read_one_repos_conf(const char *repos_conf)
{
+ int nsec;
char *conf;
- const char *repo, *path;
+ const char *main_repo, *repo, *path;
dictionary *dict;
dict = iniparser_load(repos_conf);
- repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
- if (repo) {
+ main_repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
+
+ nsec = iniparser_getnsec(dict);
+ while (nsec-- > 0) {
+ repo = iniparser_getsecname(dict, nsec);
+ if (!strcmp(repo, "DEFAULT"))
+ continue;
+
xasprintf(&conf, "%s:location", repo);
path = iniparser_getstring(dict, conf, NULL);
if (path) {
- free(portdir);
- portdir = xstrdup(path);
+ if (main_repo && !strcmp(repo, main_repo)) {
+ free(portdir);
+ portdir = xstrdup(path);
+ }
+
+ xarraypush_str(overlays, path);
}
free(conf);
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
To: gentoo-commits
commit: cb952155e5a9b5d3af533a9d46c561fee47c22f9
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 10:36:49 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 10:36:49 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=cb952155
cache: support multiple overlays
This isn't terribly useful as-is since all callers still assume only
a single cache exists (portdir). But we can cut utils over now.
URL: https://bugs.gentoo.org/553260
main.c | 36 +++++++++++++++++++++---------------
qsearch.c | 2 +-
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/main.c b/main.c
index 8c7403b..10af2db 100644
--- a/main.c
+++ b/main.c
@@ -934,7 +934,7 @@ int filter_hidden(const struct dirent *dentry)
}
static const char *
-initialize_flat(int cache_type, bool force)
+initialize_flat(const char *overlay, int cache_type, bool force)
{
struct dirent **category, **pn, **eb;
struct stat st;
@@ -945,7 +945,7 @@ initialize_flat(int cache_type, bool force)
int frac, secs, count;
FILE *fp;
- xasprintf(&cache_file, "%s/dep/%s/%s", portedb, portdir,
+ xasprintf(&cache_file, "%s/dep/%s/%s", portedb, overlay,
(cache_type == CACHE_EBUILD ? ".ebuild.x" : ".metadata.x"));
/* If we aren't forcing a regen, make sure the file is somewhat sane. */
@@ -960,22 +960,22 @@ initialize_flat(int cache_type, bool force)
count = frac = secs = 0;
- int portdir_fd, subdir_fd;
- portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
+ int overlay_fd, subdir_fd;
+ overlay_fd = open(overlay, O_RDONLY|O_CLOEXEC|O_PATH);
if (cache_type == CACHE_METADATA) {
- subdir_fd = openat(portdir_fd, portcachedir_md5, O_RDONLY|O_CLOEXEC);
+ subdir_fd = openat(overlay_fd, portcachedir_md5, O_RDONLY|O_CLOEXEC);
if (subdir_fd == -1) {
- subdir_fd = openat(portdir_fd, portcachedir_pms, O_RDONLY|O_CLOEXEC);
+ subdir_fd = openat(overlay_fd, portcachedir_pms, O_RDONLY|O_CLOEXEC);
if (subdir_fd == -1) {
- warnp("could not read md5 or pms cache dirs in %s", portdir);
+ warnp("could not read md5 or pms cache dirs in %s", overlay);
goto ret;
}
portcachedir_type = CACHE_METADATA_PMS;
} else
portcachedir_type = CACHE_METADATA_MD5;
} else
- subdir_fd = portdir_fd;
+ subdir_fd = overlay_fd;
if ((fp = fopen(cache_file, "we")) == NULL) {
warnfp("opening cache failed: %s", cache_file);
@@ -1056,22 +1056,28 @@ initialize_flat(int cache_type, bool force)
warn("Finished %u entries in %d.%06d seconds", count, secs, frac);
if (secs > 120)
- warn("You should consider using the noatime mount option for PORTDIR='%s' if it's not already enabled", portdir);
+ warn("You should consider using the noatime mount option for '%s' if it's not already enabled", overlay);
ret:
close(subdir_fd);
- if (subdir_fd != portdir_fd)
- close(portdir_fd);
+ if (subdir_fd != overlay_fd)
+ close(overlay_fd);
return cache_file;
}
-#define initialize_ebuild_flat() initialize_flat(CACHE_EBUILD, false)
-#define initialize_metadata_flat() initialize_flat(CACHE_METADATA, false)
+#define initialize_ebuild_flat() initialize_flat(portdir, CACHE_EBUILD, false)
+#define initialize_metadata_flat() initialize_flat(portdir, CACHE_METADATA, false)
void reinitialize_as_needed(void)
{
+ size_t n;
+ const char *overlay;
+
if (reinitialize)
- initialize_flat(CACHE_EBUILD, true);
+ array_for_each(overlays, n, overlay)
+ initialize_flat(overlay, CACHE_EBUILD, true);
+
if (reinitialize_metacache)
- initialize_flat(CACHE_METADATA, true);
+ array_for_each(overlays, n, overlay)
+ initialize_flat(overlay, CACHE_METADATA, true);
}
typedef struct {
diff --git a/qsearch.c b/qsearch.c
index baaed37..427580d 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -69,7 +69,7 @@ int qsearch_main(int argc, char **argv)
search_me = argv[optind];
}
last[0] = 0;
- fp = fopen(initialize_flat(search_cache, false), "r");
+ fp = fopen(initialize_flat(portdir, search_cache, false), "r");
if (!fp)
return 1;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:52 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:52 UTC (permalink / raw
To: gentoo-commits
commit: dab9ae7d90f2b51f2d1abb4700b025c14ab77ef5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 10:51:40 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 10:51:40 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dab9ae7d
qpkg: add multiple overlay support
This one is easy as it doesn't actually scan portdir and the cache
logic is simple & self contained.
URL: https://bugs.gentoo.org/553260
qpkg.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/qpkg.c b/qpkg.c
index 50d79f6..2c9e774 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -122,7 +122,14 @@ int qpkg_clean(char *dirp)
}
if (eclean) {
- if ((fp = fopen(initialize_ebuild_flat(), "r")) != NULL) {
+ size_t n;
+ const char *overlay;
+
+ array_for_each(overlays, n, overlay) {
+ fp = fopen(initialize_flat(overlay, CACHE_EBUILD, false), "re");
+ if (fp == NULL)
+ continue;
+
size_t buflen;
char *buf;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:52 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-26 10:52 UTC (permalink / raw
To: gentoo-commits
commit: 0c159907e39135f1b213e38e3a3a8d87fcaef8f6
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 10:52:15 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 10:52:15 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0c159907
TODO: qpkg: add some thoughts
TODO | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/TODO b/TODO
index 86445a4..ed72034 100644
--- a/TODO
+++ b/TODO
@@ -48,3 +48,9 @@
ACCEPT_LICENSE="${ACCEPT_LICENSE} bar"
we end up getting just:
ACCEPT_LICENSE=" bar"
+
+- qpkg:
+ - fix "would be freed" message when --pretend is *not* active
+ - add a verbose output that describes why a package is cleaned
+ - newer binpkgs available
+ - newer installed version available
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: be66cbd9a8e495972f1e85398ce6bde98c210c7b
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 20:14:07 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 20:14:07 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=be66cbd9
qcache: rewrite arch.list loading to use getline()
This applet carries its own file reading utils that are inefficient
(they read 1 byte off the disk at a time) and are used by only one
piece of code -- the arch.list reader. Punt the funcs so we can use
getline directly.
qcache.c | 146 +++++++++++++++------------------------------------------------
1 file changed, 33 insertions(+), 113 deletions(-)
diff --git a/qcache.c b/qcache.c
index fed3534..af64bc5 100644
--- a/qcache.c
+++ b/qcache.c
@@ -204,105 +204,6 @@ int read_keywords(char *s, int *keywords)
return 0;
}
-/********************************************************************/
-/* File reading helper functions */
-/********************************************************************/
-
-/*
- * inline unsigned int qcache_count_lines(char *filename);
- *
- * Count the number of new line characters '\n' in a file.
- *
- * IN:
- * char *filename - name of the file to read.
- * OUT:
- * unsigned int count - number of new lines counted.
- * ERR:
- * -1 is returned if the file cannot be read.
- */
-_q_static
-unsigned int qcache_count_lines(char *filename)
-{
- int count, fd;
- char c;
-
- if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) != -1) {
- count = 0;
-
- while (read(fd, &c, 1) == 1)
- if (c == '\n')
- count++;
-
- close(fd);
- return count;
- }
-
- return -1;
-}
-
-/*
- * char **qcache_read_lines(char *filename);
- *
- * Reads in every line contained in a file
- *
- * IN:
- * char *filename - name of the file to read.
- * OUT:
- * char **lines - number of new lines counted.
- * ERR:
- * NULL is returned if an error occurs.
- */
-_q_static
-char **qcache_read_lines(char *filename)
-{
- int len, fd, count, i, num_lines;
- char **lines, c;
-
- if (-1 == (num_lines = qcache_count_lines(filename)))
- return NULL;
-
- len = sizeof(char*) * (num_lines + 1);
- lines = xzalloc(len);
-
- if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) != -1) {
- for (i = 0; i < num_lines; i++) {
- count = 0;
-
- /* determine the space needed for storing the line */
- while (read(fd, &c, 1) == 1 && c != '\n')
- count++;
- lseek(fd, (lseek(fd, 0, SEEK_CUR) - count - 1), SEEK_SET);
-
- lines[i] = xzalloc(sizeof(char) * (count+1));
-
- /* copy the line into lines[i] */
- assert(read(fd, lines[i], count) == count);
- assert(read(fd, &c, 1) == 1); /* skip '\n' */
- }
-
- close(fd);
- return lines;
- }
-
- return NULL;
-}
-
-/*
- * void qcache_free_lines(char **lines);
- *
- * free()'s memory allocated by qcache_read_lines
- */
-_q_static
-void qcache_free_lines(char **lines)
-{
- int i;
-
- for (i = 0; lines[i]; i++)
- free(lines[i]);
-
- free(lines);
-}
-
/*
* portage_cache *qcache_read_cache_file(const char *file);
*
@@ -884,25 +785,40 @@ void qcache_testing_only(qcache_data *data)
* -1 is returned on error.
*/
_q_static
-int qcache_init(void)
+bool qcache_init(void)
{
- char *filename;
- int len;
+ bool ret = false;
+ FILE *fp;
+ char *filename, *s;
+ size_t buflen, linelen;
+ char *buf;
xasprintf(&filename, "%s/profiles/arch.list", portdir);
+ fp = fopen(filename, "re");
+ if (!fp)
+ goto done;
- if (NULL == (archlist = qcache_read_lines(filename))) {
- free(filename);
- return -1;
- }
+ archlist_count = 0;
+ buf = NULL;
+ while ((linelen = getline(&buf, &buflen, fp)) != -1) {
+ rmspace_len(buf, linelen);
- len = 0;
- while (archlist[len])
- ++len;
- archlist_count = len;
+ if ((s = strchr(buf, '#')) != NULL)
+ *s = '\0';
+ if (buf[0] == '\0')
+ continue;
+
+ ++archlist_count;
+ archlist = xrealloc_array(archlist, sizeof(*archlist), archlist_count);
+ archlist[archlist_count - 1] = xstrdup(buf);
+ }
+ free(buf);
+ ret = true;
+ fclose(fp);
+ done:
free(filename);
- return 0;
+ return ret;
}
/*
@@ -913,7 +829,11 @@ int qcache_init(void)
_q_static
void qcache_free(void)
{
- qcache_free_lines(archlist);
+ size_t a;
+
+ for (a = 0; a < archlist_count; ++a)
+ free(archlist[a]);
+ free(archlist);
}
/********************************************************************/
@@ -946,7 +866,7 @@ int qcache_main(int argc, char **argv)
}
}
- if (-1 == qcache_init())
+ if (!qcache_init())
err("Could not initialize arch list");
if (optind < argc)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: 29afc5efc0ae2cd9977b0b44469d741c1c2066d3
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 20:49:47 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 20:49:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=29afc5ef
qcache: fix ebuild traversal error path
We were freeing the wrong vars for this loop.
Also do not dump a warning when we try to scan a path that isn't a
directory. Random files in there shouldn't cause us to complain.
qcache.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/qcache.c b/qcache.c
index af64bc5..8dbeaa3 100644
--- a/qcache.c
+++ b/qcache.c
@@ -441,9 +441,11 @@ int qcache_traverse(void (*func)(qcache_data*))
xasprintf(&ebuildpath, "%s/%s/%s", portdir, categories[i]->d_name, packages[j]->d_name);
if (-1 == (num_ebuild = scandir(ebuildpath, &ebuilds, qcache_ebuild_select, qcache_vercmp))) {
- warnp("%s", ebuildpath);
- free(packages[i]);
- free(pkgpath);
+ /* Do not complain about spurious files */
+ if (errno != ENOTDIR)
+ warnp("%s", ebuildpath);
+ free(packages[j]);
+ free(ebuildpath);
continue;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: 6c142af26118bd69597860582c27934238334749
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 19:12:13 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 19:12:13 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6c142af2
qcache: use scandir_free
qcache.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/qcache.c b/qcache.c
index 5f65fe0..5d915bd 100644
--- a/qcache.c
+++ b/qcache.c
@@ -528,10 +528,8 @@ int qcache_traverse(void (*func)(qcache_data*))
if (qcache_matchcat) {
if (strcmp(categories[i]->d_name, qcache_matchcat) != 0) {
- for (j = 0; j < num_pkg; j++)
- free(packages[j]);
+ scandir_free(packages, num_pkg);
free(categories[i]);
- free(packages);
free(pkgpath);
continue;
}
@@ -552,10 +550,8 @@ int qcache_traverse(void (*func)(qcache_data*))
if (qcache_matchpkg) {
if (strcmp(packages[j]->d_name, qcache_matchpkg) != 0) {
- for (k = 0; k < num_ebuild; k++)
- free(ebuilds[k]);
+ scandir_free(ebuilds, num_ebuild);
free(packages[j]);
- free(ebuilds);
free(ebuildpath);
continue;
}
@@ -741,7 +737,7 @@ void qcache_stats(qcache_data *data)
static int *packages_testing;
static int *current_package_keywords;
static int *keywords;
- int a, i;
+ int a;
if (!numpkg) {
struct dirent **categories;
@@ -753,10 +749,7 @@ void qcache_stats(qcache_data *data)
errp("%s", catpath);
free(catpath);
}
-
- for (i = 0; i < numcat; i++)
- free(categories[i]);
- free(categories);
+ scandir_free(categories, numcat);
runtime = time(NULL);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: c1a168f95699da8d2ac659cb6ea0c7fb3f4c0df9
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 20:02:38 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 20:02:38 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c1a168f9
qcache: use xasprintf instead of alloc+snprintf
qcache.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/qcache.c b/qcache.c
index 5d915bd..9e41c3c 100644
--- a/qcache.c
+++ b/qcache.c
@@ -537,9 +537,7 @@ int qcache_traverse(void (*func)(qcache_data*))
/* traverse packages */
for (j = 0; j < num_pkg; j++) {
- len = sizeof(char) * (strlen(portdir) + strlen("/") + strlen(categories[i]->d_name) + strlen("/") + strlen(packages[j]->d_name) + 1);
- ebuildpath = xzalloc(len);
- snprintf(ebuildpath, len, "%s/%s/%s", portdir, categories[i]->d_name, packages[j]->d_name);
+ xasprintf(&ebuildpath, "%s/%s/%s", portdir, categories[i]->d_name, packages[j]->d_name);
if (-1 == (num_ebuild = scandir(ebuildpath, &ebuilds, qcache_ebuild_select, qcache_vercmp))) {
warnp("%s", ebuildpath);
@@ -561,10 +559,8 @@ int qcache_traverse(void (*func)(qcache_data*))
/* traverse ebuilds */
for (k = 0; k < num_ebuild; k++) {
- len = sizeof(char) * (strlen(catpath) + strlen("/") + strlen(categories[i]->d_name) + strlen("/") + strlen(ebuilds[k]->d_name) + 1);
- cachepath = xzalloc(len);
- snprintf(cachepath, len, "%s/%s/%s", catpath, categories[i]->d_name, ebuilds[k]->d_name);
- cachepath[len-8] = '\0'; /* remove ".ebuild" */
+ len = xasprintf(&cachepath, "%s/%s/%s", catpath, categories[i]->d_name, ebuilds[k]->d_name);
+ cachepath[len - 7] = '\0'; /* remove ".ebuild" */
data.category = categories[i]->d_name;
data.package = packages[j]->d_name;
@@ -886,12 +882,9 @@ _q_static
int qcache_init(void)
{
char *filename;
- unsigned int len;
+ int len;
- len = sizeof(char) * (strlen(portdir) + strlen("/profiles/arch.list") + 1);
- filename = xzalloc(len);
-
- snprintf(filename, len, "%s/profiles/arch.list", portdir);
+ xasprintf(&filename, "%s/profiles/arch.list", portdir);
if (NULL == (archlist = qcache_read_lines(filename))) {
free(filename);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: f031a1315e1363857959cdae24414a7845cc1660
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 20:10:10 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 20:10:10 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f031a131
qcache: only warn once per missing cache file
When the cache is out of date, we can spam hundreds of lines.
Only do it once.
qcache.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/qcache.c b/qcache.c
index 9e41c3c..fed3534 100644
--- a/qcache.c
+++ b/qcache.c
@@ -578,9 +578,14 @@ int qcache_traverse(void (*func)(qcache_data*))
func(&data);
qcache_free_data(data.cache_data);
- } else
- warnp("unable to read cache '%s'\n"
- "\tperhaps you need to `egencache -j 4` ?", cachepath);
+ } else {
+ static bool warned = false;
+ if (!warned) {
+ warned = true;
+ warnp("unable to read cache '%s'\n"
+ "\tperhaps you need to `egencache -j 4` ?", cachepath);
+ }
+ }
free(ebuilds[k]);
free(cachepath);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: f162c6a9219deacfe23c8e21b732f8594a938130
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 19:04:10 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 19:04:10 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f162c6a9
qsearch: add multiple overlay support
We ractor some of the main code into helper funcs to make iterating
over the overlays easier to manage.
URL: https://bugs.gentoo.org/553260
qsearch.c | 268 +++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 152 insertions(+), 116 deletions(-)
diff --git a/qsearch.c b/qsearch.c
index 02d43ca..b7c992e 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -31,18 +31,114 @@ static const char * const qsearch_opts_help[] = {
};
#define qsearch_usage(ret) usage(ret, QSEARCH_FLAGS, qsearch_long_opts, qsearch_opts_help, lookup_applet_idx("qsearch"))
-int qsearch_main(int argc, char **argv)
+#define LAST_BUF_SIZE 256
+
+/* Search an ebuild's details via the metadata cache. */
+static void
+qsearch_ebuild_metadata(_q_unused_ int overlay_fd, const char *ebuild, const char *search_me, char *last,
+ bool search_desc, bool search_all, _q_unused_ bool search_name, bool show_name_only, bool show_homepage)
+{
+ portage_cache *pcache = cache_read_file(ebuild);
+
+ if (pcache == NULL) {
+ if (!reinitialize)
+ warnf("(cache update pending) %s", ebuild);
+ reinitialize = 1;
+ return;
+ }
+
+ if (strcmp(pcache->atom->PN, last) != 0) {
+ strncpy(last, pcache->atom->PN, LAST_BUF_SIZE);
+ if (search_all || rematch(search_me, (search_desc ? pcache->DESCRIPTION : ebuild), REG_EXTENDED | REG_ICASE) == 0)
+ printf("%s%s/%s%s%s %s\n", BOLD, pcache->atom->CATEGORY, BLUE,
+ pcache->atom->PN, NORM,
+ (show_name_only ? "" :
+ (show_homepage ? pcache->HOMEPAGE : pcache->DESCRIPTION)));
+ }
+ cache_free(pcache);
+}
+
+/* Search an ebuild's details via the ebuild cache. */
+static void
+qsearch_ebuild_ebuild(int overlay_fd, const char *ebuild, const char *search_me, char *last,
+ _q_unused_ bool search_desc, bool search_all, bool search_name, bool show_name_only, _q_unused_ bool show_homepage)
{
- FILE *fp;
- char *ebuild = NULL;
- char last[126] = "";
+ const char * const search_vars[] = { "DESCRIPTION=", "HOMEPAGE=" };
+ const char *search_var = search_vars[show_homepage ? 1 : 0];
+ size_t search_len = strlen(search_var);
char *p, *q, *str;
+
+ FILE *ebuildfp;
+ str = xstrdup(ebuild);
+ p = dirname(str);
+
+ if (strcmp(p, last) == 0)
+ goto no_cache_ebuild_match;
+
+ bool show_it = false;
+ strncpy(last, p, LAST_BUF_SIZE);
+ if (search_name) {
+ if (rematch(search_me, basename(last), REG_EXTENDED | REG_ICASE) != 0) {
+ goto no_cache_ebuild_match;
+ } else {
+ q = NULL;
+ show_it = true;
+ }
+ }
+
+ int fd = openat(overlay_fd, ebuild, O_RDONLY|O_CLOEXEC);
+ if (fd != -1) {
+ ebuildfp = fdopen(fd, "r");
+ if (ebuildfp == NULL) {
+ close(fd);
+ goto no_cache_ebuild_match;
+ }
+ } else {
+ if (!reinitialize)
+ warnfp("(cache update pending) %s", ebuild);
+ reinitialize = 1;
+ goto no_cache_ebuild_match;
+ }
+
+ char *buf = NULL;
+ size_t buflen, linelen;
+ while ((linelen = getline(&buf, &buflen, ebuildfp)) != -1) {
+ if (linelen <= search_len)
+ continue;
+ if (strncmp(buf, search_var, search_len) != 0)
+ continue;
+ if ((q = strrchr(buf, '"')) != NULL)
+ *q = 0;
+ if (strlen(buf) <= search_len)
+ break;
+ q = buf + search_len + 1;
+ if (!search_all && !search_name && rematch(search_me, q, REG_EXTENDED | REG_ICASE) != 0)
+ break;
+ show_it = true;
+ break;
+ }
+
+ if (show_it) {
+ printf("%s%s/%s%s%s %s\n",
+ BOLD, dirname(p), BLUE, basename(p), NORM,
+ (show_name_only ? "" : q ? : "<no DESCRIPTION found>"));
+ }
+
+ free(buf);
+ fclose(ebuildfp);
+ no_cache_ebuild_match:
+ free(str);
+}
+
+int qsearch_main(int argc, char **argv)
+{
+ char last[LAST_BUF_SIZE];
char *search_me = NULL;
- char show_homepage = 0, show_name_only = 0;
- char search_desc = 0, search_all = 0, search_name = 1, search_cache = CACHE_EBUILD;
- const char *search_vars[] = { "DESCRIPTION=", "HOMEPAGE=" };
- size_t search_len, ebuild_len, linelen;
- int i, idx=0;
+ bool show_homepage = false, show_name_only = false;
+ bool search_desc = false, search_all = false, search_name = true;
+ int search_cache = CACHE_EBUILD;
+ int i;
+ void (*search_func)(int, const char *, const char *, char *last, bool, bool, bool, bool, bool);
DBG("argc=%d argv[0]=%s argv[1]=%s",
argc, argv[0], argc > 1 ? argv[1] : "NULL?");
@@ -50,132 +146,72 @@ int qsearch_main(int argc, char **argv)
while ((i = GETOPT_LONG(QSEARCH, qsearch, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsearch)
- case 'a': search_all = 1; break;
+ case 'a': search_all = true; break;
case 'c': search_cache = CACHE_METADATA; break;
case 'e': search_cache = CACHE_EBUILD; break;
- case 's': search_desc = 0; search_name = 1; break;
- case 'S': search_desc = 1; search_name = 0; break;
- case 'N': show_name_only = 1; break;
- case 'H': show_homepage = 1, idx = 1; break;
+ case 's': search_desc = false; search_name = true; break;
+ case 'S': search_desc = true; search_name = false; break;
+ case 'N': show_name_only = true; break;
+ case 'H': show_homepage = true; break;
}
}
+ switch (search_cache) {
+ case CACHE_METADATA:
+ search_func = qsearch_ebuild_metadata;
+ break;
+ case CACHE_EBUILD:
+ search_func = qsearch_ebuild_ebuild;
+ break;
+ default:
+ err("unknown cache %i", search_cache);
+ }
+
if (search_all) {
- search_desc = 1;
- search_name = 0;
+ search_desc = true;
+ search_name = false;
} else {
if (argc == optind)
qsearch_usage(EXIT_FAILURE);
search_me = argv[optind];
}
last[0] = 0;
- fp = fopen(initialize_flat(portdir, search_cache, false), "r");
- if (!fp)
- return 1;
-
- int portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
- if (portdir_fd < 0)
- errp("open(%s) failed", portdir);
-
- q = NULL; /* Silence a gcc warning. */
- search_len = strlen(search_vars[idx]);
- while ((linelen = getline(&ebuild, &ebuild_len, fp)) != -1) {
- rmspace_len(ebuild, linelen);
- if (!ebuild[0])
+ int ret = 0;
+ size_t n;
+ const char *overlay;
+ array_for_each(overlays, n, overlay) {
+ FILE *fp = fopen(initialize_flat(overlay, search_cache, false), "r");
+ if (!fp) {
+ warnp("opening cache for %s failed", overlay);
+ ret = 1;
continue;
+ }
- switch (search_cache) {
-
- case CACHE_METADATA: {
- portage_cache *pcache;
- if ((pcache = cache_read_file(ebuild)) != NULL) {
- if (strcmp(pcache->atom->PN, last) != 0) {
- strncpy(last, pcache->atom->PN, sizeof(last));
- if ((rematch(search_me, (search_desc ? pcache->DESCRIPTION : ebuild), REG_EXTENDED | REG_ICASE) == 0) || search_all)
- printf("%s%s/%s%s%s %s\n", BOLD, pcache->atom->CATEGORY, BLUE,
- pcache->atom->PN, NORM,
- (show_name_only ? "" :
- (show_homepage ? pcache->HOMEPAGE : pcache->DESCRIPTION)));
- }
- cache_free(pcache);
- } else {
- if (!reinitialize)
- warnf("(cache update pending) %s", ebuild);
- reinitialize = 1;
- }
- break;
+ int overlay_fd = open(overlay, O_RDONLY|O_CLOEXEC|O_PATH);
+ if (overlay_fd < 0) {
+ fclose(fp);
+ warnp("open failed: %s", overlay);
+ ret = 1;
+ continue;
}
- case CACHE_EBUILD: {
- FILE *ebuildfp;
- str = xstrdup(ebuild);
- p = dirname(str);
-
- if (strcmp(p, last) != 0) {
- bool show_it = false;
- strncpy(last, p, sizeof(last));
- if (search_name) {
- if (rematch(search_me, basename(last), REG_EXTENDED | REG_ICASE) != 0) {
- goto no_cache_ebuild_match;
- } else {
- q = NULL;
- show_it = true;
- }
- }
-
- int fd = openat(portdir_fd, ebuild, O_RDONLY|O_CLOEXEC);
- if (fd != -1) {
- ebuildfp = fdopen(fd, "r");
- if (ebuildfp == NULL) {
- close(fd);
- continue;
- }
- } else {
- if (!reinitialize)
- warnfp("(cache update pending) %s", ebuild);
- reinitialize = 1;
- goto no_cache_ebuild_match;
- }
-
- char *buf = NULL;
- size_t buflen;
- while ((linelen = getline(&buf, &buflen, ebuildfp)) != -1) {
- if (linelen <= search_len)
- continue;
- if (strncmp(buf, search_vars[idx], search_len) != 0)
- continue;
- if ((q = strrchr(buf, '"')) != NULL)
- *q = 0;
- if (strlen(buf) <= search_len)
- break;
- q = buf + search_len + 1;
- if (!search_all && !search_name && rematch(search_me, q, REG_EXTENDED | REG_ICASE) != 0)
- break;
- show_it = true;
- break;
- }
-
- if (show_it) {
- printf("%s%s/%s%s%s %s\n",
- BOLD, dirname(p), BLUE, basename(p), NORM,
- (show_name_only ? "" : q ? : "<no DESCRIPTION found>"));
- }
-
- free(buf);
- fclose(ebuildfp);
- }
-no_cache_ebuild_match:
- free(str);
+ size_t buflen, linelen;
+ char *buf = NULL;
+ while ((linelen = getline(&buf, &buflen, fp)) != -1) {
+ rmspace_len(buf, linelen);
+ if (!buf[0])
+ continue;
- break;
- } /* case CACHE_EBUILD */
- } /* switch (search_cache) */
+ search_func(overlay_fd, buf, search_me, last, search_desc,
+ search_all, search_name, show_name_only, show_homepage);
+ }
+ free(buf);
+ close(overlay_fd);
+ fclose(fp);
}
- free(ebuild);
- close(portdir_fd);
- fclose(fp);
- return EXIT_SUCCESS;
+
+ return ret;
}
#else
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: cc1410da0856fea37f421d57ec2e3633918d5f7f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 22:43:53 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 22:43:53 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=cc1410da
qcache: make missing KEYWORDS a verbose message
These only warn about ebuilds that shouldn't have them set (such as
9999 ebuilds), so making the warning a verbose one for now.
qcache.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/qcache.c b/qcache.c
index 091a510..5cac394 100644
--- a/qcache.c
+++ b/qcache.c
@@ -525,7 +525,9 @@ void qcache_imlate(qcache_data *data)
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
- warn("Failed to read keywords for %s%s/%s%s%s", BOLD, data->category, BLUE, data->ebuild, NORM);
+ if (verbose)
+ warn("Failed to read keywords for %s%s/%s%s%s",
+ BOLD, data->category, BLUE, data->ebuild, NORM);
free(keywords);
return;
}
@@ -559,7 +561,9 @@ void qcache_not(qcache_data *data)
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
- warn("Failed to read keywords for %s%s/%s%s%s", BOLD, data->category, BLUE, data->ebuild, NORM);
+ if (verbose)
+ warn("Failed to read keywords for %s%s/%s%s%s",
+ BOLD, data->category, BLUE, data->ebuild, NORM);
free(keywords);
return;
}
@@ -584,7 +588,9 @@ void qcache_all(qcache_data *data)
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
- warn("Failed to read keywords for %s%s/%s%s%s", BOLD, data->category, BLUE, data->ebuild, NORM);
+ if (verbose)
+ warn("Failed to read keywords for %s%s/%s%s%s",
+ BOLD, data->category, BLUE, data->ebuild, NORM);
free(keywords);
return;
}
@@ -612,7 +618,9 @@ void qcache_dropped(qcache_data *data)
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
- warn("Failed to read keywords for %s%s/%s%s%s", BOLD, data->category, BLUE, data->ebuild, NORM);
+ if (verbose)
+ warn("Failed to read keywords for %s%s/%s%s%s",
+ BOLD, data->category, BLUE, data->ebuild, NORM);
free(keywords);
return;
}
@@ -727,7 +735,9 @@ void qcache_stats(qcache_data *data)
memset(keywords, 0, archlist_count * sizeof(*keywords));
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
- warn("Failed to read keywords for %s%s/%s%s%s", BOLD, data->category, BLUE, data->ebuild, NORM);
+ if (verbose)
+ warn("Failed to read keywords for %s%s/%s%s%s",
+ BOLD, data->category, BLUE, data->ebuild, NORM);
return;
}
@@ -774,7 +784,9 @@ void qcache_testing_only(qcache_data *data)
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
- warn("Failed to read keywords for %s%s/%s%s%s", BOLD, data->category, BLUE, data->ebuild, NORM);
+ if (verbose)
+ warn("Failed to read keywords for %s%s/%s%s%s",
+ BOLD, data->category, BLUE, data->ebuild, NORM);
free(keywords);
return;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: 186af28f41cadc29027ef900c3b8622af7d3b4a0
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 21:10:04 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 21:10:04 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=186af28f
qcache: fix cache table display w/longer arches
The table code has a hardcoded width of 12 bytes which breaks with the
newer arch values in the tree. Rework the code to calculate the width
dynamically based on the longest value in the list.
qcache.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/qcache.c b/qcache.c
index 8dbeaa3..25f8651 100644
--- a/qcache.c
+++ b/qcache.c
@@ -65,6 +65,7 @@ typedef struct {
static char **archlist; /* Read from PORTDIR/profiles/arch.list in qcache_init() */
static int archlist_count;
+static size_t arch_longest_len;
const char status[3] = {'-', '~', '+'};
int qcache_skip, qcache_test_arch, qcache_last = 0;
char *qcache_matchpkg = NULL, *qcache_matchcat = NULL;
@@ -703,31 +704,36 @@ void qcache_stats(qcache_data *data)
}
if (qcache_last) {
- printf("+-------------------------+\n");
+ const char border[] = "------------------------------------------------------------------";
+ printf("+%.*s+\n", 25, border);
printf("| general statistics |\n");
- printf("+-------------------------+\n");
+ printf("+%.*s+\n", 25, border);
printf("| %s%13s%s | %s%7d%s |\n", GREEN, "architectures", NORM, BLUE, archlist_count, NORM);
printf("| %s%13s%s | %s%7d%s |\n", GREEN, "categories", NORM, BLUE, numcat, NORM);
printf("| %s%13s%s | %s%7d%s |\n", GREEN, "packages", NORM, BLUE, numpkg, NORM);
printf("| %s%13s%s | %s%7d%s |\n", GREEN, "ebuilds", NORM, BLUE, numebld, NORM);
- printf("+-------------------------+\n\n");
-
- printf("+----------------------------------------------------------+\n");
- printf("| keyword distribution |\n");
- printf("+----------------------------------------------------------+\n");
- printf("| %s%12s%s |%s%8s%s |%s%8s%s |%s%8s%s | %s%8s%s |\n", RED, "architecture", NORM, RED, "stable", NORM, RED, "~arch", NORM, RED, "total", NORM, RED, "total/#pkgs", NORM);
- printf("| | |%s%8s%s | | |\n", RED, "only", NORM);
- printf("+----------------------------------------------------------+\n");
+ printf("+%.*s+\n\n", 25, border);
+
+ printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
+ printf("|%*skeyword distribution |\n",
+ (int)arch_longest_len, "");
+ printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
+ printf("| %s%*s%s |%s%8s%s |%s%8s%s |%s%8s%s | %s%8s%s |\n",
+ RED, (int)arch_longest_len, "architecture", NORM, RED, "stable", NORM,
+ RED, "~arch", NORM, RED, "total", NORM, RED, "total/#pkgs", NORM);
+ printf("| %*s | |%s%8s%s | | |\n",
+ (int)arch_longest_len, "", RED, "only", NORM);
+ printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
for (a = 0; a < archlist_count; ++a) {
- printf("| %s%12s%s |", GREEN, archlist[a], NORM);
+ printf("| %s%*s%s |", GREEN, (int)arch_longest_len, archlist[a], NORM);
printf("%s%8d%s |", BLUE, packages_stable[a], NORM);
printf("%s%8d%s |", BLUE, packages_testing[a], NORM);
printf("%s%8d%s |", BLUE, packages_testing[a]+packages_stable[a], NORM);
printf("%s%11.2f%s%% |\n", BLUE, (100.0*(packages_testing[a]+packages_stable[a]))/numpkg, NORM);
}
- printf("+----------------------------------------------------------+\n\n");
+ printf("+%.*s+\n\n", (int)(arch_longest_len + 46), border);
printf("Completed in %s%d%s seconds.\n", BLUE, (int)(time(NULL)-runtime), NORM);
@@ -801,6 +807,7 @@ bool qcache_init(void)
goto done;
archlist_count = 0;
+ arch_longest_len = 0;
buf = NULL;
while ((linelen = getline(&buf, &buflen, fp)) != -1) {
rmspace_len(buf, linelen);
@@ -813,6 +820,7 @@ bool qcache_init(void)
++archlist_count;
archlist = xrealloc_array(archlist, sizeof(*archlist), archlist_count);
archlist[archlist_count - 1] = xstrdup(buf);
+ arch_longest_len = MAX(arch_longest_len, strlen(buf));
}
free(buf);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: b4db839907e96b8346ecb27dbc231dab1c335704
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 22:37:02 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 22:37:02 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b4db8399
qcache: rework last traversal callback
Rather than packing the last entry in at the same time as a valid
call, make a dedicated call with a NULL argument. This way the
callback funcs are forced to deal with this up front cleanly.
qcache.c | 112 ++++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 64 insertions(+), 48 deletions(-)
diff --git a/qcache.c b/qcache.c
index 0891918..091a510 100644
--- a/qcache.c
+++ b/qcache.c
@@ -67,7 +67,7 @@ static char **archlist; /* Read from PORTDIR/profiles/arch.list in qcache_init()
static int archlist_count;
static size_t arch_longest_len;
const char status[3] = {'-', '~', '+'};
-int qcache_skip, qcache_test_arch, qcache_last = 0;
+int qcache_skip, qcache_test_arch;
char *qcache_matchpkg = NULL, *qcache_matchcat = NULL;
/********************************************************************/
@@ -462,6 +462,7 @@ int qcache_traverse(void (*func)(qcache_data*))
qcache_skip = 0;
/* traverse ebuilds */
+ data.num = num_ebuild;
for (k = 0; k < num_ebuild; k++) {
len = xasprintf(&cachepath, "%s/%s/%s", catpath, categories[i]->d_name, ebuilds[k]->d_name);
cachepath[len - 7] = '\0'; /* remove ".ebuild" */
@@ -470,14 +471,9 @@ int qcache_traverse(void (*func)(qcache_data*))
data.package = packages[j]->d_name;
data.ebuild = ebuilds[k]->d_name;
data.cur = k + 1;
- data.num = num_ebuild;
data.cache_data = qcache_read_cache_file(cachepath);
if (data.cache_data != NULL) {
- /* is this the last ebuild? */
- if (i+1 == num_cat && j+1 == num_pkg && k+1 == num_ebuild)
- qcache_last = 1;
-
if (!qcache_skip)
func(&data);
@@ -508,6 +504,8 @@ int qcache_traverse(void (*func)(qcache_data*))
free(categories);
free(catpath);
+ func(NULL);
+
return 0;
}
@@ -521,6 +519,9 @@ void qcache_imlate(qcache_data *data)
int *keywords;
int a;
+ if (!data)
+ return;
+
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
@@ -552,6 +553,9 @@ void qcache_not(qcache_data *data)
{
int *keywords;
+ if (!data)
+ return;
+
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
@@ -574,6 +578,9 @@ void qcache_all(qcache_data *data)
{
int *keywords;
+ if (!data)
+ return;
+
keywords = xmalloc(sizeof(*keywords) * archlist_count);
if (read_keywords(data->cache_data->KEYWORDS, keywords) < 0) {
@@ -596,6 +603,9 @@ void qcache_dropped(qcache_data *data)
static int possible = 0;
int *keywords, i;
+ if (!data)
+ return;
+
if (data->cur == 1)
possible = 0;
@@ -644,6 +654,51 @@ void qcache_stats(qcache_data *data)
static int *keywords;
int a;
+ /* Is this the last time we'll be called? */
+ if (!data) {
+ const char border[] = "------------------------------------------------------------------";
+
+ printf("+%.*s+\n", 25, border);
+ printf("| general statistics |\n");
+ printf("+%.*s+\n", 25, border);
+ printf("| %s%13s%s | %s%7d%s |\n", GREEN, "architectures", NORM, BLUE, archlist_count, NORM);
+ printf("| %s%13s%s | %s%7d%s |\n", GREEN, "categories", NORM, BLUE, numcat, NORM);
+ printf("| %s%13s%s | %s%7d%s |\n", GREEN, "packages", NORM, BLUE, numpkg, NORM);
+ printf("| %s%13s%s | %s%7d%s |\n", GREEN, "ebuilds", NORM, BLUE, numebld, NORM);
+ printf("+%.*s+\n\n", 25, border);
+
+ printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
+ printf("|%*skeyword distribution |\n",
+ (int)arch_longest_len, "");
+ printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
+ printf("| %s%*s%s |%s%8s%s |%s%8s%s |%s%8s%s | %s%8s%s |\n",
+ RED, (int)arch_longest_len, "architecture", NORM, RED, "stable", NORM,
+ RED, "~arch", NORM, RED, "total", NORM, RED, "total/#pkgs", NORM);
+ printf("| %*s | |%s%8s%s | | |\n",
+ (int)arch_longest_len, "", RED, "only", NORM);
+ printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
+
+ for (a = 0; a < archlist_count; ++a) {
+ printf("| %s%*s%s |", GREEN, (int)arch_longest_len, archlist[a], NORM);
+ printf("%s%8d%s |", BLUE, packages_stable[a], NORM);
+ printf("%s%8d%s |", BLUE, packages_testing[a], NORM);
+ printf("%s%8d%s |", BLUE, packages_testing[a]+packages_stable[a], NORM);
+ printf("%s%11.2f%s%% |\n", BLUE, (100.0*(packages_testing[a]+packages_stable[a]))/numpkg, NORM);
+ }
+
+ printf("+%.*s+\n\n", (int)(arch_longest_len + 46), border);
+
+ printf("Completed in ");
+ print_seconds_for_earthlings(time(NULL) - runtime);
+ printf("\n");
+
+ free(packages_stable);
+ free(packages_testing);
+ free(keywords);
+ free(current_package_keywords);
+ return;
+ }
+
if (!numpkg) {
struct dirent **categories;
char *catpath;
@@ -702,48 +757,6 @@ void qcache_stats(qcache_data *data)
}
}
}
-
- if (qcache_last) {
- const char border[] = "------------------------------------------------------------------";
- printf("+%.*s+\n", 25, border);
- printf("| general statistics |\n");
- printf("+%.*s+\n", 25, border);
- printf("| %s%13s%s | %s%7d%s |\n", GREEN, "architectures", NORM, BLUE, archlist_count, NORM);
- printf("| %s%13s%s | %s%7d%s |\n", GREEN, "categories", NORM, BLUE, numcat, NORM);
- printf("| %s%13s%s | %s%7d%s |\n", GREEN, "packages", NORM, BLUE, numpkg, NORM);
- printf("| %s%13s%s | %s%7d%s |\n", GREEN, "ebuilds", NORM, BLUE, numebld, NORM);
- printf("+%.*s+\n\n", 25, border);
-
- printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
- printf("|%*skeyword distribution |\n",
- (int)arch_longest_len, "");
- printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
- printf("| %s%*s%s |%s%8s%s |%s%8s%s |%s%8s%s | %s%8s%s |\n",
- RED, (int)arch_longest_len, "architecture", NORM, RED, "stable", NORM,
- RED, "~arch", NORM, RED, "total", NORM, RED, "total/#pkgs", NORM);
- printf("| %*s | |%s%8s%s | | |\n",
- (int)arch_longest_len, "", RED, "only", NORM);
- printf("+%.*s+\n", (int)(arch_longest_len + 46), border);
-
- for (a = 0; a < archlist_count; ++a) {
- printf("| %s%*s%s |", GREEN, (int)arch_longest_len, archlist[a], NORM);
- printf("%s%8d%s |", BLUE, packages_stable[a], NORM);
- printf("%s%8d%s |", BLUE, packages_testing[a], NORM);
- printf("%s%8d%s |", BLUE, packages_testing[a]+packages_stable[a], NORM);
- printf("%s%11.2f%s%% |\n", BLUE, (100.0*(packages_testing[a]+packages_stable[a]))/numpkg, NORM);
- }
-
- printf("+%.*s+\n\n", (int)(arch_longest_len + 46), border);
-
- printf("Completed in ");
- print_seconds_for_earthlings(time(NULL) - runtime);
- printf("\n");
-
- free(packages_stable);
- free(packages_testing);
- free(keywords);
- free(current_package_keywords);
- }
}
_q_static
@@ -752,6 +765,9 @@ void qcache_testing_only(qcache_data *data)
static int possible = 0;
int *keywords;
+ if (!data)
+ return;
+
if (data->cur == 1)
possible = 0;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: a0c3ddab026e271b3eb2e66e64b9e9a24eb6f708
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 23:26:17 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 23:26:17 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a0c3ddab
qgrep/quse: add multiple overlay support
This is a pretty straight forward extension. The code hasn't seen
any clean ups in the process (although it probably should).
URL: https://bugs.gentoo.org/553260
qgrep.c | 366 +++++++++++++++++++++++++++++++++-------------------------------
quse.c | 268 ++++++++++++++++++++++++-----------------------
2 files changed, 329 insertions(+), 305 deletions(-)
diff --git a/qgrep.c b/qgrep.c
index de018ea..e7c2c10 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -259,7 +259,7 @@ int qgrep_main(int argc, char **argv)
int need_separator = 0;
char status = 1;
- QGREP_STR_FUNC strfunc = (QGREP_STR_FUNC) strstr;
+ QGREP_STR_FUNC strfunc = strstr;
DBG("argc=%d argv[0]=%s argv[1]=%s",
argc, argv[0], argc > 1 ? argv[1] : "NULL?");
@@ -271,7 +271,7 @@ int qgrep_main(int argc, char **argv)
switch (i) {
case 'I': invert_match = 1; break;
case 'i':
- strfunc = (QGREP_STR_FUNC) strcasestr;
+ strfunc = strcasestr;
reflags |= REG_ICASE;
break;
case 'c': do_count = 1; break;
@@ -369,203 +369,216 @@ int qgrep_main(int argc, char **argv)
xregcomp(&skip_preg, skip_pattern, reflags);
}
- /* go look either in ebuilds or eclasses or VDB */
- if (!do_eclass && !do_installed) {
- if ((fp = fopen(initialize_ebuild_flat(), "r")) == NULL)
- return 1;
- xchdir(portdir);
- } else if (do_eclass) {
- xchdir(portdir);
- if ((eclass_dir = opendir("eclass")) == NULL)
- errp("opendir(\"%s/eclass\") failed", portdir);
- } else { /* if (do_install) */
- char buf[_Q_PATH_MAX];
- snprintf(buf, sizeof(buf), "%s/%s", portroot, portvdb);
- xchdir(buf);
- if ((vdb_dir = opendir(".")) == NULL)
- errp("could not opendir(%s/%s) for ROOT/VDB", portroot, portvdb);
- }
-
/* allocate a circular buffers list for --before */
buf_list = qgrep_buf_list_alloc(num_lines_before + 1);
- /* iteration is either over ebuilds or eclasses */
- while (do_eclass
- ? ((dentry = readdir(eclass_dir))
- && snprintf(ebuild, sizeof(ebuild), "eclass/%s", dentry->d_name))
- : (do_installed
- ? (get_next_installed_ebuild(ebuild, vdb_dir, &dentry, &cat_dir) != NULL)
- : (fgets(ebuild, sizeof(ebuild), fp) != NULL))) {
- FILE *newfp;
-
- /* filter badly named files, prepare eclass or package name, etc. */
- if (do_eclass) {
- if ((p = strrchr(ebuild, '.')) == NULL)
+ size_t n;
+ char *overlay;
+ array_for_each(overlays, n, overlay) {
+
+ /* go look either in ebuilds or eclasses or VDB */
+ if (!do_eclass && !do_installed) {
+ fp = fopen(initialize_flat(overlay, CACHE_EBUILD, false), "re");
+ if (fp == NULL)
continue;
- if (strcmp(p, ".eclass"))
+ xchdir(overlay);
+ } else if (do_eclass) {
+ xchdir(overlay);
+ if ((eclass_dir = opendir("eclass")) == NULL) {
+ if (errno != ENOENT)
+ warnp("opendir(\"%s/eclass\") failed", overlay);
continue;
- if (show_name || (include_atoms != NULL)) {
- /* cut ".eclass" */
- *p = '\0';
- /* and skip "eclass/" */
- snprintf(name, sizeof(name), "%s", ebuild + 7);
- /* restore the filepath */
- *p = '.';
}
- } else {
- if ((p = strchr(ebuild, '\n')) != NULL)
- *p = '\0';
- if (show_name || (include_atoms != NULL)) {
- /* cut ".ebuild" */
- if (p == NULL)
- p = ebuild + strlen(ebuild);
- *(p-7) = '\0';
- /* cut "/foo/" from "cat/foo/foo-x.y" */
- if ((p = strchr(ebuild, '/')) == NULL)
+ } else { /* if (do_install) */
+ char buf[_Q_PATH_MAX];
+ snprintf(buf, sizeof(buf), "%s/%s", portroot, portvdb);
+ xchdir(buf);
+ if ((vdb_dir = opendir(".")) == NULL)
+ errp("could not opendir(%s/%s) for ROOT/VDB", portroot, portvdb);
+ }
+
+ /* iteration is either over ebuilds or eclasses */
+ while (do_eclass
+ ? ((dentry = readdir(eclass_dir))
+ && snprintf(ebuild, sizeof(ebuild), "eclass/%s", dentry->d_name))
+ : (do_installed
+ ? (get_next_installed_ebuild(ebuild, vdb_dir, &dentry, &cat_dir) != NULL)
+ : (fgets(ebuild, sizeof(ebuild), fp) != NULL))) {
+ FILE *newfp;
+
+ /* filter badly named files, prepare eclass or package name, etc. */
+ if (do_eclass) {
+ if ((p = strrchr(ebuild, '.')) == NULL)
continue;
- *(p++) = '\0';
- /* find head of the ebuild basename */
- if ((p = strchr(p, '/')) == NULL)
+ if (strcmp(p, ".eclass"))
continue;
- /* find start of the pkg name */
- snprintf(name, sizeof(name), "%s/%s", ebuild, (p+1));
- /* restore the filepath */
- *p = '/';
- *(p + strlen(p)) = '.';
- ebuild[strlen(ebuild)] = '/';
+ if (show_name || (include_atoms != NULL)) {
+ /* cut ".eclass" */
+ *p = '\0';
+ /* and skip "eclass/" */
+ snprintf(name, sizeof(name), "%s", ebuild + 7);
+ /* restore the filepath */
+ *p = '.';
+ }
+ } else {
+ if ((p = strchr(ebuild, '\n')) != NULL)
+ *p = '\0';
+ if (show_name || (include_atoms != NULL)) {
+ /* cut ".ebuild" */
+ if (p == NULL)
+ p = ebuild + strlen(ebuild);
+ *(p-7) = '\0';
+ /* cut "/foo/" from "cat/foo/foo-x.y" */
+ if ((p = strchr(ebuild, '/')) == NULL)
+ continue;
+ *(p++) = '\0';
+ /* find head of the ebuild basename */
+ if ((p = strchr(p, '/')) == NULL)
+ continue;
+ /* find start of the pkg name */
+ snprintf(name, sizeof(name), "%s/%s", ebuild, (p+1));
+ /* restore the filepath */
+ *p = '/';
+ *(p + strlen(p)) = '.';
+ ebuild[strlen(ebuild)] = '/';
+ }
}
- }
- /* filter the files we grep when there are extra args */
- if (include_atoms != NULL)
- if (!qgrep_name_match(name, (argc - optind - 1), include_atoms))
- continue;
-
- if ((newfp = fopen(ebuild, "r")) != NULL) {
- int lineno = 0;
- char remaining_after_context = 0;
- count = 0;
- /* if there have been some matches already, then a separator will be needed */
- need_separator = (!status) && (num_lines_before || num_lines_after);
- /* whatever is in the circular buffers list is no more a valid context */
- qgrep_buf_list_invalidate(buf_list);
-
- /* reading a new line always happen in the next buffer of the list */
- while ((buf_list = buf_list->next)
- && (fgets(buf_list->buf, sizeof(buf_list->buf), newfp)) != NULL) {
- lineno++;
- buf_list->valid = 1;
-
- /* cleanup EOL */
- if ((p = strrchr(buf_list->buf, '\n')) != NULL)
- *p = 0;
- if ((p = strrchr(buf_list->buf, '\r')) != NULL)
- *p = 0;
-
- if (skip_comments) {
- /* reject comments line ("^[ \t]*#") */
- p = buf_list->buf;
- while (*p == ' ' || *p == '\t') p++;
- if (*p == '#')
- goto print_after_context;
- }
+ /* filter the files we grep when there are extra args */
+ if (include_atoms != NULL)
+ if (!qgrep_name_match(name, (argc - optind - 1), include_atoms))
+ continue;
- if (skip_pattern) {
- /* reject some other lines which match an optional pattern */
- if (!do_regex) {
- if (strfunc(buf_list->buf, skip_pattern) != NULL)
- goto print_after_context;
- } else {
- if (regexec(&skip_preg, buf_list->buf, 0, NULL, 0) == 0)
+ if ((newfp = fopen(ebuild, "r")) != NULL) {
+ int lineno = 0;
+ char remaining_after_context = 0;
+ count = 0;
+ /* if there have been some matches already, then a separator will be needed */
+ need_separator = (!status) && (num_lines_before || num_lines_after);
+ /* whatever is in the circular buffers list is no more a valid context */
+ qgrep_buf_list_invalidate(buf_list);
+
+ /* reading a new line always happen in the next buffer of the list */
+ while ((buf_list = buf_list->next)
+ && (fgets(buf_list->buf, sizeof(buf_list->buf), newfp)) != NULL) {
+ lineno++;
+ buf_list->valid = 1;
+
+ /* cleanup EOL */
+ if ((p = strrchr(buf_list->buf, '\n')) != NULL)
+ *p = 0;
+ if ((p = strrchr(buf_list->buf, '\r')) != NULL)
+ *p = 0;
+
+ if (skip_comments) {
+ /* reject comments line ("^[ \t]*#") */
+ p = buf_list->buf;
+ while (*p == ' ' || *p == '\t') p++;
+ if (*p == '#')
goto print_after_context;
}
- }
- /* four ways to match a line (with/without inversion and regexp) */
- if (!invert_match) {
- if (do_regex == 0) {
- if (strfunc(buf_list->buf, argv[optind]) == NULL)
- goto print_after_context;
- } else {
- if (regexec(&preg, buf_list->buf, 0, NULL, 0) != 0)
- goto print_after_context;
+ if (skip_pattern) {
+ /* reject some other lines which match an optional pattern */
+ if (!do_regex) {
+ if (strfunc(buf_list->buf, skip_pattern) != NULL)
+ goto print_after_context;
+ } else {
+ if (regexec(&skip_preg, buf_list->buf, 0, NULL, 0) == 0)
+ goto print_after_context;
+ }
}
- } else {
- if (do_regex == 0) {
- if (strfunc(buf_list->buf, argv[optind]) != NULL)
- goto print_after_context;
+
+ /* four ways to match a line (with/without inversion and regexp) */
+ if (!invert_match) {
+ if (do_regex == 0) {
+ if (strfunc(buf_list->buf, argv[optind]) == NULL)
+ goto print_after_context;
+ } else {
+ if (regexec(&preg, buf_list->buf, 0, NULL, 0) != 0)
+ goto print_after_context;
+ }
} else {
- if (regexec(&preg, buf_list->buf, 0, NULL, 0) == 0)
- goto print_after_context;
+ if (do_regex == 0) {
+ if (strfunc(buf_list->buf, argv[optind]) != NULL)
+ goto print_after_context;
+ } else {
+ if (regexec(&preg, buf_list->buf, 0, NULL, 0) == 0)
+ goto print_after_context;
+ }
}
- }
- count++;
- status = 0; /* got a match, exit status should be 0 */
- if (per_file_output)
- continue; /* matching files are listed out of this loop */
-
- if ((need_separator > 0)
- && (num_lines_before || num_lines_after))
- printf("--\n");
- /* "need_separator" is not a flag, but a counter, so that
- * adjacent contextes are not separated */
- need_separator = 0 - num_lines_before;
- if (!do_list) {
- /* print the leading context */
- qgrep_print_before_context(buf_list, num_lines_before, label,
- ((verbose > 1) ? lineno : -1));
- /* print matching line */
- if (invert_match || *RED == '\0')
- qgrep_print_matching_line_nocolor(buf_list, label,
- ((verbose > 1) ? lineno : -1));
- else if (do_regex)
- qgrep_print_matching_line_regcolor(buf_list, label,
- ((verbose > 1) ? lineno : -1), &preg);
- else
- qgrep_print_matching_line_strcolor(buf_list, label,
- ((verbose > 1) ? lineno : -1), strfunc, argv[optind]);
- } else {
- /* in verbose do_list mode, list the file once per match */
- printf("%s", label);
- if (verbose > 1)
- printf(":%d", lineno);
- putchar('\n');
- }
- /* init count down of trailing context lines */
- remaining_after_context = num_lines_after;
- continue;
+ count++;
+ status = 0; /* got a match, exit status should be 0 */
+ if (per_file_output)
+ continue; /* matching files are listed out of this loop */
+
+ if ((need_separator > 0)
+ && (num_lines_before || num_lines_after))
+ printf("--\n");
+ /* "need_separator" is not a flag, but a counter, so that
+ * adjacent contextes are not separated */
+ need_separator = 0 - num_lines_before;
+ if (!do_list) {
+ /* print the leading context */
+ qgrep_print_before_context(buf_list, num_lines_before, label,
+ ((verbose > 1) ? lineno : -1));
+ /* print matching line */
+ if (invert_match || *RED == '\0')
+ qgrep_print_matching_line_nocolor(buf_list, label,
+ ((verbose > 1) ? lineno : -1));
+ else if (do_regex)
+ qgrep_print_matching_line_regcolor(buf_list, label,
+ ((verbose > 1) ? lineno : -1), &preg);
+ else
+ qgrep_print_matching_line_strcolor(buf_list, label,
+ ((verbose > 1) ? lineno : -1), strfunc, argv[optind]);
+ } else {
+ /* in verbose do_list mode, list the file once per match */
+ printf("%s", label);
+ if (verbose > 1)
+ printf(":%d", lineno);
+ putchar('\n');
+ }
+ /* init count down of trailing context lines */
+ remaining_after_context = num_lines_after;
+ continue;
-print_after_context:
- /* print some trailing context lines when needed */
- if (!remaining_after_context) {
- if (!status)
- /* we're getting closer to the need of a separator between
- * current match block and the next one */
- ++need_separator;
- } else {
- qgrep_print_context_line(buf_list, label,
- ((verbose > 1) ? lineno : -1));
- --remaining_after_context;
+ print_after_context:
+ /* print some trailing context lines when needed */
+ if (!remaining_after_context) {
+ if (!status)
+ /* we're getting closer to the need of a separator between
+ * current match block and the next one */
+ ++need_separator;
+ } else {
+ qgrep_print_context_line(buf_list, label,
+ ((verbose > 1) ? lineno : -1));
+ --remaining_after_context;
+ }
}
+ fclose(newfp);
+ if (!per_file_output)
+ continue; /* matches were already displayed, line per line */
+ if (do_count && count) {
+ if (label != NULL)
+ /* -c without -v/-N/-H only outputs
+ * the matches count of the file */
+ printf("%s:", label);
+ printf("%d\n", count);
+ } else if ((count && !invert_list) || (!count && invert_list))
+ printf("%s\n", label); /* do_list == 1, or we wouldn't be here */
}
- fclose(newfp);
- if (!per_file_output)
- continue; /* matches were already displayed, line per line */
- if (do_count && count) {
- if (label != NULL)
- /* -c without -v/-N/-H only outputs
- * the matches count of the file */
- printf("%s:", label);
- printf("%d\n", count);
- } else if ((count && !invert_list) || (!count && invert_list))
- printf("%s\n", label); /* do_list == 1, or we wouldn't be here */
}
+ if (do_eclass)
+ closedir(eclass_dir);
+ else if (!do_installed)
+ fclose(fp);
+
+ if (do_installed)
+ break;
}
- if (do_eclass)
- closedir(eclass_dir);
- else if (!do_installed)
- fclose(fp);
+
if (do_regex)
regfree(&preg);
if (do_regex && skip_pattern)
@@ -577,6 +590,7 @@ print_after_context:
free(include_atoms);
}
qgrep_buf_list_free(buf_list);
+
return status;
}
diff --git a/quse.c b/quse.c
index 8ba0be1..2ac6cad 100644
--- a/quse.c
+++ b/quse.c
@@ -239,6 +239,8 @@ int quse_main(int argc, char **argv)
short quse_all = 0;
int regexp_matching = 1, i, idx = 0;
size_t search_len;
+ size_t n;
+ const char *overlay;
DBG("argc=%d argv[0]=%s argv[1]=%s",
argc, argv[0], argc > 1 ? argv[1] : "NULL?");
@@ -259,179 +261,187 @@ int quse_main(int argc, char **argv)
quse_usage(EXIT_FAILURE);
if (idx == -1) {
- size_t n;
- const char *overlay;
array_for_each(overlays, n, overlay)
quse_describe_flag(overlay, optind, argc, argv);
return 0;
}
if (quse_all) optind = argc;
- cache_file = initialize_ebuild_flat();
search_len = strlen(search_vars[idx]);
assert(search_len < sizeof(buf0));
- if ((fp = fopen(cache_file, "r")) == NULL) {
- warnp("could not read cache: %s", cache_file);
- return 1;
- }
+ array_for_each(overlays, n, overlay) {
+ cache_file = initialize_flat(overlay, CACHE_EBUILD, false);
- int portdir_fd = open(portdir, O_RDONLY|O_CLOEXEC|O_PATH);
+ if ((fp = fopen(cache_file, "re")) == NULL) {
+ warnp("could not read cache: %s", cache_file);
+ continue;
+ }
- ebuild = NULL;
- while ((linelen = getline(&ebuild, &ebuildlen, fp)) != -1) {
- FILE *newfp;
- int fd;
+ int overlay_fd = open(overlay, O_RDONLY|O_CLOEXEC|O_PATH);
- rmspace_len(ebuild, linelen);
+ ebuild = NULL;
+ while ((linelen = getline(&ebuild, &ebuildlen, fp)) != -1) {
+ FILE *newfp;
+ int fd;
- fd = openat(portdir_fd, ebuild, O_RDONLY|O_CLOEXEC);
- if (fd < 0)
- continue;
- newfp = fdopen(fd, "r");
- if (newfp != NULL) {
- unsigned int lineno = 0;
- char revision[sizeof(buf0)];
- char date[sizeof(buf0)];
- char user[sizeof(buf0)];
-
- revision[0] = 0;
- user[0] = 0;
- date[0] = 0;
- while (fgets(buf0, sizeof(buf0), newfp) != NULL) {
- int ok = 0;
- char warned = 0;
- lineno++;
-
- if (*buf0 == '#') {
- if (strncmp(buf0, "# $Header: /", 12) == 0)
- sscanf(buf0, "%*s %*s %*s %s %s %*s %s %*s %*s", (char *) &revision, (char *) &date, (char *) &user);
- continue;
- }
- if (strncmp(buf0, search_vars[idx], search_len) != 0)
- continue;
+ rmspace_len(ebuild, linelen);
+
+ fd = openat(overlay_fd, ebuild, O_RDONLY|O_CLOEXEC);
+ if (fd < 0)
+ continue;
+ newfp = fdopen(fd, "r");
+ if (newfp != NULL) {
+ unsigned int lineno = 0;
+ char revision[sizeof(buf0)];
+ char date[sizeof(buf0)];
+ char user[sizeof(buf0)];
+
+ revision[0] = 0;
+ user[0] = 0;
+ date[0] = 0;
+ while (fgets(buf0, sizeof(buf0), newfp) != NULL) {
+ int ok = 0;
+ char warned = 0;
+ lineno++;
+
+ if (*buf0 == '#') {
+ if (strncmp(buf0, "# $Header: /", 12) == 0)
+ sscanf(buf0, "%*s %*s %*s %s %s %*s %s %*s %*s",
+ revision, date, user);
+ continue;
+ }
+ if (strncmp(buf0, search_vars[idx], search_len) != 0)
+ continue;
- if ((p = strchr(buf0, '\n')) != NULL)
- *p = 0;
- if ((p = strchr(buf0, '#')) != NULL) {
- if (buf0 != p && p[-1] == ' ')
- p[-1] = 0;
- else
+ if ((p = strchr(buf0, '\n')) != NULL)
*p = 0;
- }
- if (verbose > 1) {
- if ((strchr(buf0, '\t') != NULL)
- || (strchr(buf0, '$') != NULL)
- || (strchr(buf0, '\\') != NULL)
- || (strchr(buf0, '\'') != NULL)
- || (strstr(buf0, " ") != NULL)) {
- warned = 1;
- warn("# Line %d of %s has an annoying %s", lineno, ebuild, buf0);
+ if ((p = strchr(buf0, '#')) != NULL) {
+ if (buf0 != p && p[-1] == ' ')
+ p[-1] = 0;
+ else
+ *p = 0;
+ }
+ if (verbose > 1) {
+ if ((strchr(buf0, '\t') != NULL)
+ || (strchr(buf0, '$') != NULL)
+ || (strchr(buf0, '\\') != NULL)
+ || (strchr(buf0, '\'') != NULL)
+ || (strstr(buf0, " ") != NULL)) {
+ warned = 1;
+ warn("# Line %d of %s has an annoying %s",
+ lineno, ebuild, buf0);
+ }
}
- }
#ifdef THIS_SUCKS
- if ((p = strrchr(&buf0[search_len + 1], '\\')) != NULL) {
+ if ((p = strrchr(&buf0[search_len + 1], '\\')) != NULL) {
- multiline:
- *p = ' ';
+ multiline:
+ *p = ' ';
- if (fgets(buf1, sizeof(buf1), newfp) == NULL)
- continue;
- lineno++;
+ if (fgets(buf1, sizeof(buf1), newfp) == NULL)
+ continue;
+ lineno++;
- if ((p = strchr(buf1, '\n')) != NULL)
- *p = 0;
- snprintf(buf2, sizeof(buf2), "%s %s", buf0, buf1);
- remove_extra_space(buf2);
- strcpy(buf0, buf2);
- if ((p = strrchr(buf1, '\\')) != NULL)
- goto multiline;
- }
+ if ((p = strchr(buf1, '\n')) != NULL)
+ *p = 0;
+ snprintf(buf2, sizeof(buf2), "%s %s", buf0, buf1);
+ remove_extra_space(buf2);
+ strcpy(buf0, buf2);
+ if ((p = strrchr(buf1, '\\')) != NULL)
+ goto multiline;
+ }
#else
- remove_extra_space(buf0);
+ remove_extra_space(buf0);
#endif
- while ((p = strrchr(&buf0[search_len + 1], '"')) != NULL) *p = 0;
- while ((p = strrchr(&buf0[search_len + 1], '\'')) != NULL) *p = 0;
- while ((p = strrchr(&buf0[search_len + 1], '\\')) != NULL) *p = ' ';
-
- if (verbose && warned == 0) {
- if ((strchr(buf0, '$') != NULL) || (strchr(buf0, '\\') != NULL)) {
- warned = 1;
- warn("# Line %d of %s has an annoying %s", lineno, ebuild, buf0);
+ while ((p = strrchr(&buf0[search_len + 1], '"')) != NULL) *p = 0;
+ while ((p = strrchr(&buf0[search_len + 1], '\'')) != NULL) *p = 0;
+ while ((p = strrchr(&buf0[search_len + 1], '\\')) != NULL) *p = ' ';
+
+ if (verbose && warned == 0) {
+ if ((strchr(buf0, '$') != NULL) || (strchr(buf0, '\\') != NULL)) {
+ warned = 1;
+ warn("# Line %d of %s has an annoying %s",
+ lineno, ebuild, buf0);
+ }
}
- }
- if (strlen(buf0) < search_len + 1) {
- /* warnf("err '%s'/%zu <= %zu; line %u\n", buf0, strlen(buf0), search_len + 1, lineno); */
- continue;
- }
+ if (strlen(buf0) < search_len + 1) {
+ /* warnf("err '%s'/%zu <= %zu; line %u\n", buf0, strlen(buf0), search_len + 1, lineno); */
+ continue;
+ }
- if ((argc == optind) || (quse_all)) {
- ok = 1;
- } else {
- ok = 0;
- if (regexp_matching) {
- for (i = optind; i < argc; ++i) {
- if (rematch(argv[i], &buf0[search_len + 1], REG_NOSUB) == 0) {
- ok = 1;
- break;
- }
- }
+ if ((argc == optind) || (quse_all)) {
+ ok = 1;
} else {
- remove_extra_space(buf0);
- strcpy(buf1, &buf0[search_len + 1]);
-
- for (i = (size_t) optind; i < argc && argv[i] != NULL; i++) {
- if (strcmp(buf1, argv[i]) == 0) {
- ok = 1;
- break;
+ ok = 0;
+ if (regexp_matching) {
+ for (i = optind; i < argc; ++i) {
+ if (rematch(argv[i], &buf0[search_len + 1], REG_NOSUB) == 0) {
+ ok = 1;
+ break;
+ }
}
- }
- if (ok == 0) while ((p = strchr(buf1, ' ')) != NULL) {
- *p = 0;
+ } else {
+ remove_extra_space(buf0);
+ strcpy(buf1, &buf0[search_len + 1]);
+
for (i = (size_t) optind; i < argc && argv[i] != NULL; i++) {
if (strcmp(buf1, argv[i]) == 0) {
ok = 1;
break;
}
}
- strcpy(buf2, p + 1);
- strcpy(buf1, buf2);
- if (strchr(buf1, ' ') == NULL)
+ if (ok == 0) while ((p = strchr(buf1, ' ')) != NULL) {
+ *p = 0;
for (i = (size_t) optind; i < argc && argv[i] != NULL; i++) {
- if (strcmp(buf1, argv[i]) == 0)
+ if (strcmp(buf1, argv[i]) == 0) {
ok = 1;
+ break;
+ }
}
+ strcpy(buf2, p + 1);
+ strcpy(buf1, buf2);
+ if (strchr(buf1, ' ') == NULL)
+ for (i = (size_t) optind; i < argc && argv[i] != NULL; i++) {
+ if (strcmp(buf1, argv[i]) == 0)
+ ok = 1;
+ }
+ }
}
}
- }
- if (ok) {
- if (verbose > 3)
- printf("%s %s %s ", *user ? user : "MISSING", *revision ? revision : "MISSING", *date ? date : "MISSING");
-
- printf("%s%s%s ", CYAN, ebuild, NORM);
- print_highlighted_use_flags(&buf0[search_len + 1], optind, argc, argv);
- puts(NORM);
- if (verbose > 1) {
- char **ARGV;
- int ARGC;
- makeargv(&buf0[search_len + 1], &ARGC, &ARGV);
- quse_describe_flag(portdir, 1, ARGC, ARGV);
- freeargv(ARGC, ARGV);
+ if (ok) {
+ if (verbose > 3)
+ printf("%s %s %s ",
+ *user ? user : "MISSING",
+ *revision ? revision : "MISSING",
+ *date ? date : "MISSING");
+
+ printf("%s%s%s ", CYAN, ebuild, NORM);
+ print_highlighted_use_flags(&buf0[search_len + 1], optind, argc, argv);
+ puts(NORM);
+ if (verbose > 1) {
+ char **ARGV;
+ int ARGC;
+ makeargv(&buf0[search_len + 1], &ARGC, &ARGV);
+ quse_describe_flag(overlay, 1, ARGC, ARGV);
+ freeargv(ARGC, ARGV);
+ }
}
+ break;
}
- break;
+ fclose(newfp);
+ } else {
+ if (!reinitialize)
+ warnfp("(cache update pending) %s", ebuild);
+ reinitialize = 1;
}
- fclose(newfp);
- } else {
- if (!reinitialize)
- warnfp("(cache update pending) %s", ebuild);
- reinitialize = 1;
}
+ fclose(fp);
+ close(overlay_fd);
}
- fclose(fp);
- close(portdir_fd);
+
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: 48aac66f8c73c63926868317f9a47d5582d5bbd5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 23:27:34 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 23:27:34 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=48aac66f
main: change "portdir" to "main_overlay"
Since we no longer use portdir anywhere, rename it to main_overlay.
Add some fallback logic though so we use PORTDIR when repos.conf does
not exist at all.
URL: https://bugs.gentoo.org/553260
main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/main.c b/main.c
index 9361b98..208f899 100644
--- a/main.c
+++ b/main.c
@@ -34,7 +34,7 @@ char pretend = 0;
char reinitialize = 0;
char reinitialize_metacache = 0;
static char *portlogdir;
-static char *portdir;
+static char *main_overlay;
static char *portarch;
static char *portvdb;
static char *portedb;
@@ -447,7 +447,7 @@ static void read_one_repos_conf(const char *repos_conf)
if (path) {
void *ele = xarraypush_str(overlays, path);
if (main_repo && !strcmp(repo, main_repo))
- portdir = ele;
+ main_overlay = ele;
}
free(conf);
}
@@ -775,7 +775,7 @@ void initialize_portage_env(void)
_Q_EVS(ISTR, FEATURES, features, "noman noinfo nodoc")
_Q_EVS(STR, EPREFIX, eprefix, CONFIG_EPREFIX)
_Q_EVS(STR, EMERGE_LOG_DIR, portlogdir, CONFIG_EPREFIX "var/log")
- _Q_EVS(STR, PORTDIR, portdir, CONFIG_EPREFIX "usr/portage")
+ _Q_EVS(STR, PORTDIR, main_overlay, CONFIG_EPREFIX "usr/portage")
_Q_EVS(STR, PORTAGE_BINHOST, binhost, DEFAULT_PORTAGE_BINHOST)
_Q_EVS(STR, PORTAGE_TMPDIR, port_tmpdir, CONFIG_EPREFIX "var/tmp/portage/")
_Q_EVS(STR, PKGDIR, pkgdir, CONFIG_EPREFIX "usr/portage/packages/")
@@ -906,6 +906,8 @@ void initialize_portage_env(void)
}
read_repos_conf(configroot, CONFIG_EPREFIX "etc/portage/repos.conf");
+ if (array_cnt(overlays) == 0)
+ xarraypush_str(overlays, main_overlay);
if (getenv("PORTAGE_QUIET") != NULL)
quiet = 1;
@@ -1061,8 +1063,6 @@ ret:
close(overlay_fd);
return cache_file;
}
-#define initialize_ebuild_flat() initialize_flat(portdir, CACHE_EBUILD, false)
-#define initialize_metadata_flat() initialize_flat(portdir, CACHE_METADATA, false)
void reinitialize_as_needed(void)
{
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-28 2:44 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-11-28 2:44 UTC (permalink / raw
To: gentoo-commits
commit: 13e441fc15740844749c1c9930f348d4aab53a8d
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 21:15:40 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 21:15:40 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=13e441fc
qcache: print elapse time nicer
qcache.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qcache.c b/qcache.c
index 25f8651..0891918 100644
--- a/qcache.c
+++ b/qcache.c
@@ -735,7 +735,9 @@ void qcache_stats(qcache_data *data)
printf("+%.*s+\n\n", (int)(arch_longest_len + 46), border);
- printf("Completed in %s%d%s seconds.\n", BLUE, (int)(time(NULL)-runtime), NORM);
+ printf("Completed in ");
+ print_seconds_for_earthlings(time(NULL) - runtime);
+ printf("\n");
free(packages_stable);
free(packages_testing);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-12-17 5:06 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-12-17 5:06 UTC (permalink / raw
To: gentoo-commits
commit: cc013611ef364a970f829df3c4ea7c919f2333dc
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 17 04:31:01 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 17 04:31:01 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=cc013611
fix minor overlay memory leak w/repos.conf parsing
When repos.conf is active, we end up leaking the default main overlay
memory. Make sure we free it if repos.conf was loaded.
Also drop the old closing of stderr so asan can write its output. The
addition of this call was due to a bug in the old stderr reopen logic
that was rewritten in commit ba5f0328.
main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 208f899..be25d08 100644
--- a/main.c
+++ b/main.c
@@ -905,7 +905,10 @@ void initialize_portage_env(void)
portroot[var->value_len + 1] = '\0';
}
+ char *orig_main_overlay = main_overlay;
read_repos_conf(configroot, CONFIG_EPREFIX "etc/portage/repos.conf");
+ if (orig_main_overlay != main_overlay)
+ free(orig_main_overlay);
if (array_cnt(overlays) == 0)
xarraypush_str(overlays, main_overlay);
@@ -1380,7 +1383,6 @@ _q_static queue *get_vdb_atoms(int fullcpv)
void cleanup(void)
{
reinitialize_as_needed();
- fclose(stderr);
}
int main(int argc, char **argv)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-12-17 5:06 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-12-17 5:06 UTC (permalink / raw
To: gentoo-commits
commit: 1d4228adcfe4489bd330076e2b1004905d97d6cc
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 17 04:40:23 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 17 04:40:23 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1d4228ad
clean up old debug statements
Much of this debug output has outlived its usefulness now that the code
has stabilized. Clean it all up to make the debug builds way less noisy
and keep from breaking the tests.
main.c | 5 +++--
q.c | 3 ---
qatom.c | 3 ---
qcache.c | 3 ---
qcheck.c | 3 ---
qdepends.c | 13 -------------
qfile.c | 3 ---
qglsa.c | 3 ---
qgrep.c | 3 ---
qlist.c | 3 ---
qlop.c | 5 -----
qpkg.c | 2 --
qsearch.c | 3 ---
qsize.c | 3 ---
qtbz2.c | 3 ---
quse.c | 3 ---
qxpak.c | 3 ---
template.c | 3 ---
18 files changed, 3 insertions(+), 64 deletions(-)
diff --git a/main.c b/main.c
index be25d08..c571ef7 100644
--- a/main.c
+++ b/main.c
@@ -592,7 +592,8 @@ _q_static void read_portage_env_file(const char *configroot, const char *file, e
FILE *fp;
char *buf, *s, *p;
- IF_DEBUG(fprintf(stderr, "profile %s\n", file));
+ if (getenv("DEBUG"))
+ fprintf(stderr, "profile %s\n", file);
configroot_len = strlen(configroot);
file_len = strlen(file);
@@ -885,7 +886,7 @@ void initialize_portage_env(void)
}
}
- if (getenv("DEBUG") IF_DEBUG(|| 1)) {
+ if (getenv("DEBUG")) {
for (i = 0; vars_to_read[i].name; ++i) {
var = &vars_to_read[i];
fprintf(stderr, "%s = ", var->name);
diff --git a/q.c b/q.c
index 443ce4b..53b359f 100644
--- a/q.c
+++ b/q.c
@@ -32,7 +32,6 @@ static APPLET lookup_applet(const char *applet)
for (i = 0; applets[i].name; ++i) {
if (strcmp(applets[i].name, applet) == 0) {
- DBG("found applet %s at %p", applets[i].name, applets[i].func);
argv0 = applets[i].name;
if (i && applets[i].desc != NULL) ++argv0; /* chop the leading 'q' */
return applets[i].func;
@@ -40,10 +39,8 @@ static APPLET lookup_applet(const char *applet)
}
/* No applet found? Search by shortname then... */
- DBG("Looking up applet (%s) by short name", applet);
for (i = 1; applets[i].desc != NULL; ++i) {
if (strcmp(applets[i].name + 1, applet) == 0) {
- DBG("found applet by short name %s", applets[i].name);
argv0 = applets[i].name + 1;
return applets[i].func;
}
diff --git a/qatom.c b/qatom.c
index 16445dd..acf9fd6 100644
--- a/qatom.c
+++ b/qatom.c
@@ -109,9 +109,6 @@ int qatom_main(int argc, char **argv)
depend_atom *atom;
int i;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QATOM, qatom, "")) != -1) {
switch (i) {
case 'F': format = optarg; break;
diff --git a/qcache.c b/qcache.c
index d4b7884..759e50a 100644
--- a/qcache.c
+++ b/qcache.c
@@ -912,9 +912,6 @@ int qcache_main(int argc, char **argv)
{
int i, action = 0;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QCACHE, qcache, "")) != -1) {
switch (i) {
case 'p': qcache_matchpkg = optarg; break;
diff --git a/qcheck.c b/qcheck.c
index 6ad5f85..cdbc507 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -373,9 +373,6 @@ int qcheck_main(int argc, char **argv)
.exact = false,
};
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QCHECK, qcheck, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qcheck)
diff --git a/qdepends.c b/qdepends.c
index 5ded84b..197c376 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -411,17 +411,12 @@ _q_static int qdepends_main_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
if (i == state->argc)
return 0;
- IF_DEBUG(warn("matched %s/%s", catname, pkgname));
-
if (!q_vdb_pkg_eat(pkg_ctx, state->depend_file, &depend, &depend_len))
return 0;
- IF_DEBUG(warn("growing tree..."));
dep_tree = dep_grow_tree(depend);
if (dep_tree == NULL)
return 0;
- IF_DEBUG(puts(depend));
- IF_DEBUG(dep_dump_tree(dep_tree));
if (qdep_name_only) {
depend_atom *atom = NULL;
@@ -474,17 +469,12 @@ _q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
static size_t depend_len, use_len;
dep_node *dep_tree;
- IF_DEBUG(warn("matched %s/%s for %s", catname, pkgname, state->depend_file));
-
if (!q_vdb_pkg_eat(pkg_ctx, state->depend_file, &depend, &depend_len))
return 0;
- IF_DEBUG(warn("growing tree..."));
dep_tree = dep_grow_tree(depend);
if (dep_tree == NULL)
return 0;
- IF_DEBUG(puts(depend));
- IF_DEBUG(dep_dump_tree(dep_tree));
if (q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len))
use[0] = '\0';
@@ -539,9 +529,6 @@ int qdepends_main(int argc, char **argv)
depend_file = depend_files[0];
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QDEPENDS, qdepends, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qdepends)
diff --git a/qfile.c b/qfile.c
index 6d36e96..5082093 100644
--- a/qfile.c
+++ b/qfile.c
@@ -407,9 +407,6 @@ int qfile_main(int argc, char **argv)
FILE *args_file = NULL;
int max_args = QFILE_DEFAULT_MAX_ARGS;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QFILE, qfile, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qfile)
diff --git a/qglsa.c b/qglsa.c
index 7bc350f..885ce1e 100644
--- a/qglsa.c
+++ b/qglsa.c
@@ -285,9 +285,6 @@ int qglsa_main(int argc, char **argv)
qglsa_action action = GLSA_FUNKYTOWN;
bool all_glsas = false;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QGLSA, qglsa, "")) != -1) {
#define set_action(a) { if (action == 0) action = a; else err("cannot specify more than one action at a time"); }
switch (i) {
diff --git a/qgrep.c b/qgrep.c
index e7c2c10..7551ebb 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -261,9 +261,6 @@ int qgrep_main(int argc, char **argv)
QGREP_STR_FUNC strfunc = strstr;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
do_count = do_regex = do_eclass = do_installed = do_list = 0;
show_filename = skip_comments = invert_list = show_name = 0;
diff --git a/qlist.c b/qlist.c
index d17ba5e..cd52bf0 100644
--- a/qlist.c
+++ b/qlist.c
@@ -379,9 +379,6 @@ int qlist_main(int argc, char **argv)
};
int i, ret;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QLIST, qlist, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qlist)
diff --git a/qlop.c b/qlop.c
index f2f97c6..546c353 100644
--- a/qlop.c
+++ b/qlop.c
@@ -107,8 +107,6 @@ show_merge_times(char *package, const char *logfile, int average, char human_rea
pkg = package;
}
- DBG("Searching for %s in %s\n", pkg, logfile);
-
if ((fp = fopen(logfile, "r")) == NULL) {
warnp("Could not open logfile '%s'", logfile);
return 1;
@@ -645,9 +643,6 @@ int qlop_main(int argc, char **argv)
char do_time, do_list, do_unlist, do_sync, do_current, do_human_readable = 0;
char *logfile = NULL;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
do_time = do_list = do_unlist = do_sync = do_current = 0;
while ((i = GETOPT_LONG(QLOP, qlop, "")) != -1) {
diff --git a/qpkg.c b/qpkg.c
index 2c9e774..996efcd 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -320,8 +320,6 @@ int qpkg_main(int argc, char **argv)
depend_atom *atom;
int restrict_chmod = 0;
int qclean = 0;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
while ((i = GETOPT_LONG(QPKG, qpkg, "")) != -1) {
switch (i) {
diff --git a/qsearch.c b/qsearch.c
index b7c992e..2ba2d39 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -140,9 +140,6 @@ int qsearch_main(int argc, char **argv)
int i;
void (*search_func)(int, const char *, const char *, char *last, bool, bool, bool, bool, bool);
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QSEARCH, qsearch, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsearch)
diff --git a/qsize.c b/qsize.c
index 486edcf..7a2503a 100644
--- a/qsize.c
+++ b/qsize.c
@@ -52,9 +52,6 @@ int qsize_main(int argc, char **argv)
char filename[_Q_PATH_MAX], *filename_root;
queue *ignore_regexp = NULL;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsize)
diff --git a/qtbz2.c b/qtbz2.c
index 9208097..da2e9ab 100644
--- a/qtbz2.c
+++ b/qtbz2.c
@@ -244,9 +244,6 @@ int qtbz2_main(int argc, char **argv)
char *heap_tbz2, *heap_xpak, *heap_tarbz2;
char *tbz2, *xpak, *tarbz2;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
action = TBZ2_ACT_NONE;
dir_fd = AT_FDCWD;
diff --git a/quse.c b/quse.c
index 2ac6cad..59db37a 100644
--- a/quse.c
+++ b/quse.c
@@ -242,9 +242,6 @@ int quse_main(int argc, char **argv)
size_t n;
const char *overlay;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QUSE, quse, "")) != -1) {
switch (i) {
case 'e': regexp_matching = 0; break;
diff --git a/qxpak.c b/qxpak.c
index d7cec6f..fb19ef9 100644
--- a/qxpak.c
+++ b/qxpak.c
@@ -379,9 +379,6 @@ int qxpak_main(int argc, char **argv)
char *xpak;
char action = XPAK_ACT_NONE;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
dir_fd = AT_FDCWD;
xpak_stdout = 0;
diff --git a/template.c b/template.c
index eff93e8..d4b9e98 100644
--- a/template.c
+++ b/template.c
@@ -21,9 +21,6 @@ int qtemp_main(int argc, char **argv)
{
int i;
- DBG("argc=%d argv[0]=%s argv[1]=%s",
- argc, argv[0], argc > 1 ? argv[1] : "NULL?");
-
while ((i = GETOPT_LONG(QTEMP, qtemp, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qtemp)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-12-17 5:06 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-12-17 5:06 UTC (permalink / raw
To: gentoo-commits
commit: 41afee726fb3f4e06eaf0d4f3ea47d2f15bd5d51
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 17 04:39:33 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 17 04:39:33 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=41afee72
TODO: add more ideas
TODO | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/TODO b/TODO
index ed72034..b6c3ae0 100644
--- a/TODO
+++ b/TODO
@@ -27,6 +27,7 @@
- check order of pkg_{pre,post}{inst,rm} during install, unmerge, and upgrade
- env is not saved/restored between pkg_{pre,post}inst (see portage and REPO_LAYOUT_CONF_WARN)
- support installing via path to tbz2 package
+ - support TTL field in binpkgs file
- atoms:
- only 32bit values are supported for revision (-r#)
@@ -54,3 +55,6 @@
- add a verbose output that describes why a package is cleaned
- newer binpkgs available
- newer installed version available
+
+- qlop:
+ - support atoms and version qualifiers `qlop '>gnuconfig-2015'`
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-12-17 5:06 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2015-12-17 5:06 UTC (permalink / raw
To: gentoo-commits
commit: dc82e50a316006d339eb0a4aa0d65a9502c41677
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 17 04:45:18 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 17 04:45:18 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dc82e50a
cache: avoid memleak warnings
We leak a bit of memory when reinitializing the caches, but we don't care
because we'll be exiting soon after. Free the memory in debug builds.
main.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/main.c b/main.c
index c571ef7..d366bef 100644
--- a/main.c
+++ b/main.c
@@ -1071,15 +1071,19 @@ ret:
void reinitialize_as_needed(void)
{
size_t n;
- const char *overlay;
+ const char *overlay, *ret = ret;
if (reinitialize)
- array_for_each(overlays, n, overlay)
- initialize_flat(overlay, CACHE_EBUILD, true);
+ array_for_each(overlays, n, overlay) {
+ ret = initialize_flat(overlay, CACHE_EBUILD, true);
+ IF_DEBUG(free((void *)ret));
+ }
if (reinitialize_metacache)
- array_for_each(overlays, n, overlay)
- initialize_flat(overlay, CACHE_METADATA, true);
+ array_for_each(overlays, n, overlay) {
+ ret = initialize_flat(overlay, CACHE_METADATA, true);
+ IF_DEBUG(free((void *)ret));
+ }
}
typedef struct {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-01-05 0:25 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-01-05 0:25 UTC (permalink / raw
To: gentoo-commits
commit: 391b8cf8bb3f06b40d108c157630657132a96131
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 5 00:24:50 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jan 5 00:24:50 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=391b8cf8
qcheck: improve error reporting for unreadable files
We shouldn't flag files that are unreadable as AFK as that implies the
files are missing.
qcheck.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/qcheck.c b/qcheck.c
index cdbc507..3718f94 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -37,7 +37,7 @@ static const char * const qcheck_opts_help[] = {
};
#define qcheck_usage(ret) usage(ret, QCHECK_FLAGS, qcheck_long_opts, qcheck_opts_help, lookup_applet_idx("qcheck"))
-#define qcprintf(fmt, args...) if (!state->bad_only) printf(_(fmt), ## args)
+#define qcprintf(fmt, args...) do { if (!state->bad_only) printf(_(fmt), ## args); } while (0)
struct qcheck_opt_state {
int argc;
@@ -125,7 +125,10 @@ static int qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_sta
if (fstatat(pkg_ctx->cat_ctx->ctx->portroot_fd, e->name + 1, &st, AT_SYMLINK_NOFOLLOW)) {
/* make sure file exists */
if (state->chk_afk) {
- qcprintf(" %sAFK%s: %s\n", RED, NORM, e->name);
+ if (errno == ENOENT)
+ qcprintf(" %sAFK%s: %s\n", RED, NORM, e->name);
+ else
+ qcprintf(" %sERROR (%s)%s: %s\n", RED, strerror(errno), NORM, e->name);
} else {
--num_files;
++num_files_ignored;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-01-29 5:53 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-01-29 5:53 UTC (permalink / raw
To: gentoo-commits
commit: 7aff0263204d80304108dbe4f0061f44ed8f189f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 29 05:52:10 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 05:52:10 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7aff0263
qlop: fix crash w/corrupted log files
If a file is truncated/corrupted, make sure we don't read past the end
of the valid buffer.
URL: https://bugs.gentoo.org/573106
Reported-by: Agostino Sarubbo <ago <AT> gentoo.org>
qlop.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qlop.c b/qlop.c
index 546c353..bb32474 100644
--- a/qlop.c
+++ b/qlop.c
@@ -265,6 +265,9 @@ show_emerge_history(char listflag, int argc, char **argv, const char *logfile)
continue;
*p = 0;
q = p + 3;
+ /* Make sure there's leading white space and not a truncated string. #573106 */
+ if (p[1] != ' ' || p[2] != ' ')
+ continue;
t = (time_t) atol(buf);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-14 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-14 1:26 UTC (permalink / raw
To: gentoo-commits
commit: c5a20990bcae3acddcff18bb850cf28dbc2a4feb
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 13 23:04:24 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Feb 13 23:04:24 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c5a20990
autogen: pull in stpcpy as we use it
URL: https://bugs.gentoo.org/573902
Reported-by: Tupone Alfredo <tupone <AT> gentoo.org>
autogen.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/autogen.sh b/autogen.sh
index 622ab16..9777b19 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -25,6 +25,7 @@ mods="
readlinkat
renameat
stat-time
+ stpcpy
strcasestr-simple
strncat
symlinkat
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-14 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-14 1:26 UTC (permalink / raw
To: gentoo-commits
commit: c4ef2269807b1168460393bad04fb632a4a378d5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 13 23:10:52 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Feb 13 23:10:52 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c4ef2269
autogen: pull in dirent as we use it
autogen.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/autogen.sh b/autogen.sh
index 9777b19..dbb2aac 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -13,6 +13,7 @@ fi
PATH=/usr/local/src/gnu/gnulib:${PATH}
mods="
alloca
+ dirent
faccessat
fdopendir
fstatat
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-14 1:26 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-14 1:26 UTC (permalink / raw
To: gentoo-commits
commit: db488105e8637cf64664aef44bce2e629ecce338
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 14 00:21:47 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 14 00:21:47 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=db488105
qdepends: parse args as atoms
Update the arg parsing logic to treat them as atoms rather than as
ad-hoc substring parsing. This makes the listing logic much more
natural and brings it inline with other applets.
URL: https://bugs.gentoo.org/390749
Reported-by: aditsu <AT> yahoo.com
qdepends.c | 80 +++++++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 27 deletions(-)
diff --git a/qdepends.c b/qdepends.c
index 197c376..f5867f8 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -381,8 +381,7 @@ char *dep_flatten_tree(const dep_node *root)
}
struct qdepends_opt_state {
- int argc;
- char **argv;
+ array_t *atoms;
const char *depend_file;
const char *query;
};
@@ -392,42 +391,44 @@ _q_static int qdepends_main_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
struct qdepends_opt_state *state = priv;
const char *catname = pkg_ctx->cat_ctx->name;
const char *pkgname = pkg_ctx->name;
- size_t len;
- int i;
+ size_t i, len;
+ int ret;
char *ptr;
char buf[_Q_PATH_MAX];
static char *depend, *use;
static size_t depend_len, use_len;
+ depend_atom *atom, *datom;
dep_node *dep_tree;
+ datom = NULL;
+ ret = 0;
+
/* see if this cat/pkg is requested */
- for (i = optind; i < state->argc; ++i) {
+ array_for_each(state->atoms, i, atom) {
+ bool matched = false;
snprintf(buf, sizeof(buf), "%s/%s", catname, pkgname);
- if (rematch(state->argv[i], buf, REG_EXTENDED) == 0)
- break;
- if (rematch(state->argv[i], pkgname, REG_EXTENDED) == 0)
- break;
+ datom = atom_explode(buf);
+ if (datom) {
+ matched = (atom_compare(atom, datom) == EQUAL);
+ if (matched)
+ goto matched;
+ }
+ atom_implode(datom);
}
- if (i == state->argc)
- return 0;
+ return ret;
+ matched:
if (!q_vdb_pkg_eat(pkg_ctx, state->depend_file, &depend, &depend_len))
- return 0;
+ goto done;
dep_tree = dep_grow_tree(depend);
if (dep_tree == NULL)
- return 0;
+ goto done;
- if (qdep_name_only) {
- depend_atom *atom = NULL;
- snprintf(buf, sizeof(buf), "%s/%s", catname, pkgname);
- if ((atom = atom_explode(buf)) != NULL) {
- printf("%s%s/%s%s%s: ", BOLD, catname, BLUE, atom->PN, NORM);
- atom_implode(atom);
- }
- } else {
+ if (qdep_name_only)
+ printf("%s%s/%s%s%s: ", BOLD, catname, BLUE, atom->PN, NORM);
+ else
printf("%s%s/%s%s%s: ", BOLD, catname, BLUE, pkgname, NORM);
- }
if (!q_vdb_pkg_eat(pkg_ctx, "USE", &use, &use_len)) {
warn("Could not eat_file(%s), you'll prob have incorrect output", buf);
@@ -454,7 +455,11 @@ _q_static int qdepends_main_vdb_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
dep_burn_tree(dep_tree);
- return 1;
+ ret = 1;
+
+ done:
+ atom_implode(datom);
+ return ret;
}
_q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
@@ -516,12 +521,14 @@ _q_static int qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
int qdepends_main(int argc, char **argv)
{
+ depend_atom *atom;
+ DECLARE_ARRAY(atoms);
struct qdepends_opt_state state = {
- .argc = argc,
- .argv = argv,
+ .atoms = atoms,
};
q_vdb_pkg_cb *cb;
- int i, ret;
+ size_t i;
+ int ret;
bool do_format = false;
const char *query = NULL;
const char *depend_file;
@@ -556,9 +563,24 @@ int qdepends_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+ argc -= optind;
+ argv += optind;
+
state.depend_file = depend_file;
state.query = query;
- cb = query ? qdepends_vdb_deep_cb : qdepends_main_vdb_cb;
+ if (query)
+ cb = qdepends_vdb_deep_cb;
+ else {
+ cb = qdepends_main_vdb_cb;
+
+ for (i = 0; i < argc; ++i) {
+ atom = atom_explode(argv[i]);
+ if (!atom)
+ warn("invalid atom: %s", argv[i]);
+ else
+ xarraypush_ptr(atoms, atom);
+ }
+ }
if (!depend_file) {
ret = 0;
@@ -570,6 +592,10 @@ int qdepends_main(int argc, char **argv)
} else
ret = q_vdb_foreach_pkg(cb, &state, NULL);
+ array_for_each(atoms, i, atom)
+ atom_implode(atom);
+ xarrayfree_int(atoms);
+
if (!ret && !quiet)
warn("no matches found for your query");
return ret ? EXIT_SUCCESS : EXIT_FAILURE;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-17 7:15 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-17 7:15 UTC (permalink / raw
To: gentoo-commits
commit: 82f1ea7634d6ac645a06545a2855966ee81a0867
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 17 07:15:22 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Feb 17 07:15:22 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=82f1ea76
TODO: drop a few completed entries
TODO | 4 ----
1 file changed, 4 deletions(-)
diff --git a/TODO b/TODO
index b6c3ae0..74bffac 100644
--- a/TODO
+++ b/TODO
@@ -42,7 +42,6 @@
- qdepends:
- support querying uninstalled packages (via metadata/md5 cache)
- - verify version matching works: qdepend =nano-2*
- env vars only get expanded once, so this fails:
ACCEPT_LICENSE="foo"
@@ -55,6 +54,3 @@
- add a verbose output that describes why a package is cleaned
- newer binpkgs available
- newer installed version available
-
-- qlop:
- - support atoms and version qualifiers `qlop '>gnuconfig-2015'`
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-22 20:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-22 20:37 UTC (permalink / raw
To: gentoo-commits
commit: 466b34112637d2f777a8d9873ec05f49cc3cb415
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 22 18:06:04 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 22 18:06:04 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=466b3411
qsize: clean up printf formats
Use proper size flags like %zu for size_t instead of casting everything
to an unsigned long.
qsize.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/qsize.c b/qsize.c
index 7a40141..b9f3afb 100644
--- a/qsize.c
+++ b/qsize.c
@@ -152,21 +152,20 @@ int qsize_main(int argc, char **argv)
num_all_ignored += num_ignored;
if (!summary_only) {
- printf("%s%s/%s%s%s: %'lu files, %'lu non-files, ", BOLD,
+ printf("%s%s/%s%s%s: %'zu files, %'zu non-files, ", BOLD,
catname, BLUE, pkgname, NORM,
- (unsigned long)num_files,
- (unsigned long)num_nonfiles);
+ num_files, num_nonfiles);
if (num_ignored)
- printf("%'lu names-ignored, ", (unsigned long)num_ignored);
+ printf("%'zu names-ignored, ", num_ignored);
if (disp_units)
printf("%s %s\n",
make_human_readable_str(num_bytes, 1, disp_units),
str_disp_units);
else
- printf("%'lu%s%lu KiB\n",
- (unsigned long)(num_bytes / KILOBYTE),
+ printf("%'"PRIu64"%s%"PRIu64" KiB\n",
+ num_bytes / KILOBYTE,
decimal_point,
- (unsigned long)(((num_bytes%KILOBYTE)*1000)/KILOBYTE));
+ ((num_bytes % KILOBYTE) * 1000) / KILOBYTE);
}
next_pkg:
@@ -175,20 +174,19 @@ int qsize_main(int argc, char **argv)
}
if (summary) {
- printf(" %sTotals%s: %'lu files, %'lu non-files, ", BOLD, NORM,
- (unsigned long)num_all_files,
- (unsigned long)num_all_nonfiles);
+ printf(" %sTotals%s: %'zu files, %'zu non-files, ", BOLD, NORM,
+ num_all_files, num_all_nonfiles);
if (num_all_ignored)
- printf("%'lu names-ignored, ", (unsigned long)num_all_ignored);
+ printf("%'zu names-ignored, ", num_all_ignored);
if (disp_units)
printf("%s %s\n",
make_human_readable_str(num_all_bytes, 1, disp_units),
str_disp_units);
else
- printf("%'lu%s%lu MiB\n",
- (unsigned long)(num_all_bytes / MEGABYTE),
+ printf("%'"PRIu64"%s%"PRIu64" MiB\n",
+ num_all_bytes / MEGABYTE,
decimal_point,
- (unsigned long)(((num_all_bytes%MEGABYTE)*1000)/MEGABYTE));
+ ((num_all_bytes % MEGABYTE) * 1000) / MEGABYTE);
}
array_for_each(atoms, i, atom)
atom_implode(atom);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-22 20:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-22 20:37 UTC (permalink / raw
To: gentoo-commits
commit: 54a6bc76557216d67a21673b8f0e479efae21a79
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 22 17:41:41 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 22 17:41:41 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=54a6bc76
qcheck: precompile ignore regexes
This should speed things up a bit.
qsize.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/qsize.c b/qsize.c
index 7a2503a..3a11842 100644
--- a/qsize.c
+++ b/qsize.c
@@ -38,7 +38,7 @@ int qsize_main(int argc, char **argv)
q_vdb_ctx *ctx;
q_vdb_cat_ctx *cat_ctx;
q_vdb_pkg_ctx *pkg_ctx;
- int i;
+ size_t i;
char search_all = 0;
struct stat st;
char fs_size = 0, summary = 0, summary_only = 0;
@@ -50,7 +50,7 @@ int qsize_main(int argc, char **argv)
size_t buflen;
char *buf;
char filename[_Q_PATH_MAX], *filename_root;
- queue *ignore_regexp = NULL;
+ DECLARE_ARRAY(ignore_regexp);
while ((i = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
switch (i) {
@@ -62,7 +62,12 @@ int qsize_main(int argc, char **argv)
case 'm': disp_units = MEGABYTE; str_disp_units = "MiB"; break;
case 'k': disp_units = KILOBYTE; str_disp_units = "KiB"; break;
case 'b': disp_units = 1; str_disp_units = "bytes"; break;
- case 'i': ignore_regexp = add_set(optarg, ignore_regexp); break;
+ case 'i': {
+ regex_t regex;
+ xregcomp(®ex, optarg, REG_EXTENDED|REG_NOSUB);
+ xarraypush(ignore_regexp, ®ex, sizeof(regex));
+ break;
+ }
}
}
if ((argc == optind) && !search_all)
@@ -105,19 +110,18 @@ int qsize_main(int argc, char **argv)
num_ignored = num_files = num_nonfiles = num_bytes = 0;
while (getline(&buf, &buflen, fp) != -1) {
contents_entry *e;
- queue *ll;
+ regex_t *regex;
int ok = 0;
e = contents_parse_line(buf);
if (!e)
continue;
- for (ll = ignore_regexp; ll != NULL; ll = ll->next) {
- if (rematch(ll->name, e->name, REG_EXTENDED) == 0) {
+ array_for_each(ignore_regexp, i, regex)
+ if (!regexec(regex, buf, 0, NULL, 0)) {
num_ignored += 1;
ok = 1;
}
- }
if (ok)
continue;
@@ -174,7 +178,7 @@ int qsize_main(int argc, char **argv)
decimal_point,
(unsigned long)(((num_all_bytes%MEGABYTE)*1000)/MEGABYTE));
}
- free_sets(ignore_regexp);
+ xarrayfree(ignore_regexp);
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-22 20:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-22 20:37 UTC (permalink / raw
To: gentoo-commits
commit: 704d05c0829aaf03abb95273308116786046b891
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 22 18:28:25 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 22 18:28:25 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=704d05c0
qsize: rework code to use vdb callbacks
This helps reduce some of the boiler plate code for vdb walking.
There should be no real functional changes.
qsize.c | 268 +++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 145 insertions(+), 123 deletions(-)
diff --git a/qsize.c b/qsize.c
index 2df2fce..db00247 100644
--- a/qsize.c
+++ b/qsize.c
@@ -31,37 +31,143 @@ static const char * const qsize_opts_help[] = {
};
#define qsize_usage(ret) usage(ret, QSIZE_FLAGS, qsize_long_opts, qsize_opts_help, lookup_applet_idx("qsize"))
-int qsize_main(int argc, char **argv)
+struct qsize_opt_state {
+ array_t *atoms;
+ char **argv;
+ char search_all;
+ char fs_size;
+ char summary;
+ char summary_only;
+ size_t disp_units;
+ const char *str_disp_units;
+ array_t *ignore_regexp;
+
+ size_t buflen;
+ char *buf;
+
+ size_t num_all_files, num_all_nonfiles, num_all_ignored;
+ uint64_t num_all_bytes;
+};
+
+_q_static int qsize_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
{
- q_vdb_ctx *ctx;
- q_vdb_cat_ctx *cat_ctx;
- q_vdb_pkg_ctx *pkg_ctx;
+ struct qsize_opt_state *state = priv;
+ const char *catname = pkg_ctx->cat_ctx->name;
+ const char *pkgname = pkg_ctx->name;
size_t i;
- char fs_size = 0, summary = 0, summary_only = 0;
- size_t num_all_files, num_all_nonfiles, num_all_ignored;
+ depend_atom *atom;
+ FILE *fp;
size_t num_files, num_nonfiles, num_ignored;
- uint64_t num_all_bytes, num_bytes;
- size_t disp_units = 0;
- const char *str_disp_units = NULL;
- size_t buflen;
- char *buf;
+ uint64_t num_bytes;
+ bool showit = false;
+
+ /* see if this cat/pkg is requested */
+ if (array_cnt(state->atoms)) {
+ depend_atom *qatom;
+
+ snprintf(state->buf, state->buflen, "%s/%s", catname, pkgname);
+ qatom = atom_explode(state->buf);
+ array_for_each(state->atoms, i, atom)
+ if (atom_compare(atom, qatom) == EQUAL) {
+ showit = true;
+ break;
+ }
+ atom_implode(qatom);
+ } else
+ showit = true;
+ if (!showit)
+ return EXIT_SUCCESS;
+
+ if ((fp = q_vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS")) == NULL)
+ return EXIT_SUCCESS;
+
+ num_ignored = num_files = num_nonfiles = num_bytes = 0;
+ while (getline(&state->buf, &state->buflen, fp) != -1) {
+ contents_entry *e;
+ regex_t *regex;
+ int ok = 0;
+
+ e = contents_parse_line(state->buf);
+ if (!e)
+ continue;
+
+ array_for_each(state->ignore_regexp, i, regex)
+ if (!regexec(regex, state->buf, 0, NULL, 0)) {
+ num_ignored += 1;
+ ok = 1;
+ }
+ if (ok)
+ continue;
+
+ if (e->type == CONTENTS_OBJ || e->type == CONTENTS_SYM) {
+ struct stat st;
+ ++num_files;
+ if (!fstatat(pkg_ctx->cat_ctx->ctx->portroot_fd, e->name + 1, &st, AT_SYMLINK_NOFOLLOW))
+ num_bytes += (state->fs_size ? st.st_blocks * S_BLKSIZE : st.st_size);
+ } else
+ ++num_nonfiles;
+ }
+ fclose(fp);
+ state->num_all_bytes += num_bytes;
+ state->num_all_files += num_files;
+ state->num_all_nonfiles += num_nonfiles;
+ state->num_all_ignored += num_ignored;
+
+ if (!state->summary_only) {
+ printf("%s%s/%s%s%s: %'zu files, %'zu non-files, ", BOLD,
+ catname, BLUE, pkgname, NORM,
+ num_files, num_nonfiles);
+ if (num_ignored)
+ printf("%'zu names-ignored, ", num_ignored);
+ if (state->disp_units)
+ printf("%s %s\n",
+ make_human_readable_str(num_bytes, 1, state->disp_units),
+ state->str_disp_units);
+ else
+ printf("%'"PRIu64"%s%"PRIu64" KiB\n",
+ num_bytes / KILOBYTE,
+ decimal_point,
+ ((num_bytes % KILOBYTE) * 1000) / KILOBYTE);
+ }
+
+ return EXIT_SUCCESS;
+}
+
+int qsize_main(int argc, char **argv)
+{
+ size_t i;
+ int ret;
+ DECLARE_ARRAY(ignore_regexp);
depend_atom *atom;
DECLARE_ARRAY(atoms);
- DECLARE_ARRAY(ignore_regexp);
+ struct qsize_opt_state state = {
+ .atoms = atoms,
+ .search_all = 0,
+ .fs_size = 0,
+ .summary = 0,
+ .summary_only = 0,
+ .disp_units = 0,
+ .str_disp_units = NULL,
+ .ignore_regexp = ignore_regexp,
+ .num_all_bytes = 0,
+ .num_all_files = 0,
+ .num_all_nonfiles = 0,
+ .num_all_ignored = 0,
+ };
while ((i = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
switch (i) {
COMMON_GETOPTS_CASES(qsize)
- case 'f': fs_size = 1; break;
- case 's': summary = 1; break;
- case 'S': summary = summary_only = 1; break;
- case 'm': disp_units = MEGABYTE; str_disp_units = "MiB"; break;
- case 'k': disp_units = KILOBYTE; str_disp_units = "KiB"; break;
- case 'b': disp_units = 1; str_disp_units = "bytes"; break;
+ case 'f': state.fs_size = 1; break;
+ case 's': state.summary = 1; break;
+ case 'S': state.summary = state.summary_only = 1; break;
+ case 'm': state.disp_units = MEGABYTE; state.str_disp_units = "MiB"; break;
+ case 'k': state.disp_units = KILOBYTE; state.str_disp_units = "KiB"; break;
+ case 'b': state.disp_units = 1; state.str_disp_units = "bytes"; break;
case 'i': {
regex_t regex;
xregcomp(®ex, optarg, REG_EXTENDED|REG_NOSUB);
- xarraypush(ignore_regexp, ®ex, sizeof(regex));
+ xarraypush(state.ignore_regexp, ®ex, sizeof(regex));
break;
}
}
@@ -74,121 +180,37 @@ int qsize_main(int argc, char **argv)
if (!atom)
warn("invalid atom: %s", argv[i]);
else
- xarraypush_ptr(atoms, atom);
+ xarraypush_ptr(state.atoms, atom);
}
- num_all_bytes = num_all_files = num_all_nonfiles = num_all_ignored = 0;
-
- buflen = _Q_PATH_MAX;
- buf = xmalloc(buflen);
-
- ctx = q_vdb_open();
- if (!ctx)
- return EXIT_FAILURE;
-
- /* open /var/db/pkg */
- while ((cat_ctx = q_vdb_next_cat(ctx))) {
- /* open the cateogry */
- const char *catname = cat_ctx->name;
- while ((pkg_ctx = q_vdb_next_pkg(cat_ctx))) {
- const char *pkgname = pkg_ctx->name;
- FILE *fp;
- bool showit = false;
-
- /* see if this cat/pkg is requested */
- if (array_cnt(atoms)) {
- depend_atom *qatom;
-
- snprintf(buf, buflen, "%s/%s", catname, pkgname);
- qatom = atom_explode(buf);
- array_for_each(atoms, i, atom)
- if (atom_compare(atom, qatom) == EQUAL) {
- showit = true;
- break;
- }
- atom_implode(qatom);
- } else
- showit = true;
- if (!showit)
- goto next_pkg;
-
- if ((fp = q_vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS")) == NULL)
- goto next_pkg;
-
- num_ignored = num_files = num_nonfiles = num_bytes = 0;
- while (getline(&buf, &buflen, fp) != -1) {
- contents_entry *e;
- regex_t *regex;
- int ok = 0;
-
- e = contents_parse_line(buf);
- if (!e)
- continue;
-
- array_for_each(ignore_regexp, i, regex)
- if (!regexec(regex, buf, 0, NULL, 0)) {
- num_ignored += 1;
- ok = 1;
- }
- if (ok)
- continue;
-
- if (e->type == CONTENTS_OBJ || e->type == CONTENTS_SYM) {
- struct stat st;
- ++num_files;
- if (!fstatat(ctx->portroot_fd, e->name + 1, &st, AT_SYMLINK_NOFOLLOW))
- num_bytes += (fs_size ? st.st_blocks * S_BLKSIZE : st.st_size);
- } else
- ++num_nonfiles;
- }
- fclose(fp);
- num_all_bytes += num_bytes;
- num_all_files += num_files;
- num_all_nonfiles += num_nonfiles;
- num_all_ignored += num_ignored;
-
- if (!summary_only) {
- printf("%s%s/%s%s%s: %'zu files, %'zu non-files, ", BOLD,
- catname, BLUE, pkgname, NORM,
- num_files, num_nonfiles);
- if (num_ignored)
- printf("%'zu names-ignored, ", num_ignored);
- if (disp_units)
- printf("%s %s\n",
- make_human_readable_str(num_bytes, 1, disp_units),
- str_disp_units);
- else
- printf("%'"PRIu64"%s%"PRIu64" KiB\n",
- num_bytes / KILOBYTE,
- decimal_point,
- ((num_bytes % KILOBYTE) * 1000) / KILOBYTE);
- }
+ state.buflen = _Q_PATH_MAX;
+ state.buf = xmalloc(state.buflen);
- next_pkg:
- q_vdb_close_pkg(pkg_ctx);
- }
- }
+ ret = q_vdb_foreach_pkg(qsize_cb, &state, NULL);
- if (summary) {
+ if (state.summary) {
printf(" %sTotals%s: %'zu files, %'zu non-files, ", BOLD, NORM,
- num_all_files, num_all_nonfiles);
- if (num_all_ignored)
- printf("%'zu names-ignored, ", num_all_ignored);
- if (disp_units)
+ state.num_all_files, state.num_all_nonfiles);
+ if (state.num_all_ignored)
+ printf("%'zu names-ignored, ", state.num_all_ignored);
+ if (state.disp_units)
printf("%s %s\n",
- make_human_readable_str(num_all_bytes, 1, disp_units),
- str_disp_units);
+ make_human_readable_str(state.num_all_bytes, 1, state.disp_units),
+ state.str_disp_units);
else
printf("%'"PRIu64"%s%"PRIu64" MiB\n",
- num_all_bytes / MEGABYTE,
+ state.num_all_bytes / MEGABYTE,
decimal_point,
- ((num_all_bytes % MEGABYTE) * 1000) / MEGABYTE);
+ ((state.num_all_bytes % MEGABYTE) * 1000) / MEGABYTE);
}
- array_for_each(atoms, i, atom)
+
+ array_for_each(state.atoms, i, atom)
atom_implode(atom);
- xarrayfree_int(atoms);
- xarrayfree(ignore_regexp);
- return EXIT_SUCCESS;
+ xarrayfree_int(state.atoms);
+ xarrayfree(state.ignore_regexp);
+ free(state.buf);
+
+ return ret;
}
#else
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-02-22 20:37 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-02-22 20:37 UTC (permalink / raw
To: gentoo-commits
commit: 3d4a141fd4bf94190f9e453304d68b965df85633
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 22 18:17:20 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 22 18:17:20 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3d4a141f
qsize: clean up stat logic a bit
By using the *at style func, we can avoid the fixed static buffer
and doing a string copy all the time.
qsize.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/qsize.c b/qsize.c
index b9f3afb..2df2fce 100644
--- a/qsize.c
+++ b/qsize.c
@@ -37,7 +37,6 @@ int qsize_main(int argc, char **argv)
q_vdb_cat_ctx *cat_ctx;
q_vdb_pkg_ctx *pkg_ctx;
size_t i;
- struct stat st;
char fs_size = 0, summary = 0, summary_only = 0;
size_t num_all_files, num_all_nonfiles, num_all_ignored;
size_t num_files, num_nonfiles, num_ignored;
@@ -46,7 +45,6 @@ int qsize_main(int argc, char **argv)
const char *str_disp_units = NULL;
size_t buflen;
char *buf;
- char filename[_Q_PATH_MAX], *filename_root;
depend_atom *atom;
DECLARE_ARRAY(atoms);
DECLARE_ARRAY(ignore_regexp);
@@ -81,8 +79,6 @@ int qsize_main(int argc, char **argv)
num_all_bytes = num_all_files = num_all_nonfiles = num_all_ignored = 0;
- strcpy(filename, portroot);
- filename_root = filename + strlen(filename);
buflen = _Q_PATH_MAX;
buf = xmalloc(buflen);
@@ -138,9 +134,9 @@ int qsize_main(int argc, char **argv)
continue;
if (e->type == CONTENTS_OBJ || e->type == CONTENTS_SYM) {
- strcpy(filename_root, e->name);
+ struct stat st;
++num_files;
- if (!lstat(filename, &st))
+ if (!fstatat(ctx->portroot_fd, e->name + 1, &st, AT_SYMLINK_NOFOLLOW))
num_bytes += (fs_size ? st.st_blocks * S_BLKSIZE : st.st_size);
} else
++num_nonfiles;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-03-28 4:53 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-03-28 4:53 UTC (permalink / raw
To: gentoo-commits
commit: faaf0b2f02f3403cc727cd360e4dbf5509812735
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 18:22:58 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 18:22:58 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=faaf0b2f
qlop: slight ctime speedup
qlop.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/qlop.c b/qlop.c
index dbbae06..ad62474 100644
--- a/qlop.c
+++ b/qlop.c
@@ -75,10 +75,9 @@ _q_static const char *
chop_ctime(time_t t)
{
static char ctime_out[50];
- char *p;
- snprintf(ctime_out, sizeof(ctime_out), "%s", ctime(&t));
- if ((p = strchr(ctime_out, '\n')) != NULL)
- *p = '\0';
+ int ret = snprintf(ctime_out, sizeof(ctime_out), "%s", ctime(&t));
+ /* Assume no error! */
+ ctime_out[ret - 1] = '\0';
return ctime_out;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-03-28 4:53 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-03-28 4:53 UTC (permalink / raw
To: gentoo-commits
commit: 87859bc7eb6e05744bcf4c325d7ee322cf9c8546
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 17:52:44 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 17:52:44 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=87859bc7
TODO: add qsync idea
TODO | 3 +++
1 file changed, 3 insertions(+)
diff --git a/TODO b/TODO
index 74bffac..08e8bc3 100644
--- a/TODO
+++ b/TODO
@@ -54,3 +54,6 @@
- add a verbose output that describes why a package is cleaned
- newer binpkgs available
- newer installed version available
+
+- qsync:
+ - rewrite to use new repos.conf standard
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-03-28 4:53 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-03-28 4:53 UTC (permalink / raw
To: gentoo-commits
commit: d2341937bd97afa24f09742f0ccf5e5e3bf053d3
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 28 02:58:12 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 28 02:58:12 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d2341937
qlop: drop redundant headers
These are already pulled in via porting.h.
qlop.c | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/qlop.c b/qlop.c
index ad62474..319d767 100644
--- a/qlop.c
+++ b/qlop.c
@@ -8,24 +8,6 @@
#ifdef APPLET_qlop
-#ifdef __linux__
-# include <asm/param.h>
-#endif
-
-#ifdef __FreeBSD__
-# include <kvm.h>
-# include <sys/param.h>
-# include <sys/sysctl.h>
-# include <sys/user.h>
-# include <sys/time.h>
-#endif
-
-#ifdef __MACH__
-# include <stdlib.h>
-# include <sys/types.h>
-# include <sys/sysctl.h>
-#endif
-
#define QLOP_DEFAULT_LOGFILE "emerge.log"
#define QLOP_FLAGS "gtHluscf:" COMMON_FLAGS
@@ -379,7 +361,8 @@ show_sync_history(const char *logfile)
_q_static void show_current_emerge(void);
#ifdef __linux__
-#include <elf.h>
+# include <asm/param.h>
+# include <elf.h>
static unsigned long hz = 0;
static void init_hz(void)
{
@@ -495,6 +478,10 @@ void show_current_emerge(void)
puts("No emerge processes located");
}
#elif defined(__FreeBSD__)
+# include <kvm.h>
+# include <sys/param.h>
+# include <sys/sysctl.h>
+# include <sys/user.h>
void show_current_emerge(void)
{
kvm_t *kd = NULL;
@@ -545,6 +532,7 @@ void show_current_emerge(void)
puts("No emerge processes located");
}
#elif defined(__MACH__)
+# include <sys/sysctl.h>
void show_current_emerge(void)
{
int mib[3];
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-04-01 21:42 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-04-01 21:42 UTC (permalink / raw
To: gentoo-commits
commit: 46aea99b4b973d29db4f717fa72bcf3e1cb80f22
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 1 21:40:11 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Apr 1 21:40:11 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=46aea99b
qsearch: fix dirname/basename calls
Since dirname might modify its argument, make sure we call basename
first so we don't end up with the dirname twice.
URL: https://bugs.gentoo.org/578758
Reported-by: Kolbjørn Barmen <gentoo <AT> kolla.no>
qsearch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/qsearch.c b/qsearch.c
index e23642b..1ebfccf 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -119,8 +119,9 @@ qsearch_ebuild_ebuild(int overlay_fd, const char *ebuild, const char *search_me,
}
if (show_it) {
+ const char *pkg = basename(p);
printf("%s%s/%s%s%s %s\n",
- BOLD, dirname(p), BLUE, basename(p), NORM,
+ BOLD, dirname(p), BLUE, pkg, NORM,
(show_name_only ? "" : q ? : "<no DESCRIPTION found>"));
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-04-01 21:42 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-04-01 21:42 UTC (permalink / raw
To: gentoo-commits
commit: 40ec23a61a89940dca84f0616703cc4f7225f2fd
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 1 21:38:47 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Apr 1 21:38:47 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=40ec23a6
change reinitialize type
We started using negative values in commit 26d038ae9c2f499cfb52486913c,
but some targets define "char" as "unsigned". Switch to "int" to avoid
that issue.
main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index a50b451..8e6d4fd 100644
--- a/main.c
+++ b/main.c
@@ -31,8 +31,8 @@ int verbose = 0;
int quiet = 0;
int portcachedir_type = 0;
char pretend = 0;
-char reinitialize = 0;
-char reinitialize_metacache = 0;
+static int reinitialize = 0;
+static int reinitialize_metacache = 0;
static char *portlogdir;
static char *main_overlay;
static char *portarch;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-04-04 15:47 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-04-04 15:47 UTC (permalink / raw
To: gentoo-commits
commit: 7c64d59b55c1681a022f7b774590f512d35782c2
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 4 15:45:40 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Apr 4 15:45:40 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7c64d59b
repos.conf: fix fallback logic
Invert the S_ISREG check so we don't ignore regular files, and avoid
leaking the path buffer when we do skip the non-regular files.
Reported-by: consus <AT> gmx.com
main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 8e6d4fd..e9e65b4 100644
--- a/main.c
+++ b/main.c
@@ -507,8 +507,10 @@ static void read_repos_conf(const char *configroot, const char *repos_conf)
#endif
{
struct stat st;
- if (stat(sub_conf, &st) || S_ISREG(st.st_mode))
+ if (stat(sub_conf, &st) || !S_ISREG(st.st_mode)) {
+ free(sub_conf);
continue;
+ }
}
read_one_repos_conf(sub_conf);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-06-20 3:22 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-06-20 3:22 UTC (permalink / raw
To: gentoo-commits
commit: cf604a35700ef2b673e9fe9ce931f3833efab4d5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 20 03:12:57 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Jun 20 03:12:57 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=cf604a35
README: update repo URLs
README | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README b/README
index cf45a7d..1a8dc3d 100644
--- a/README
+++ b/README
@@ -25,7 +25,7 @@ Current developer list:
- Fetching via anon git:
- git clone git://git.overlays.gentoo.org/proj/portage-utils.git
+ git clone git://anongit.gentoo.org/proj/portage-utils.git
You can view it online via gitweb:
- http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git
+ https://gitweb.gentoo.org/proj/portage-utils.git/
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-06-21 20:53 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-06-21 20:53 UTC (permalink / raw
To: gentoo-commits
commit: 9ec380a6048391850c97e0a7359e8c25745899c9
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 20:51:47 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 20:51:47 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9ec380a6
qlist: fix repo length calculation w/slots
qlist.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qlist.c b/qlist.c
index d238259..4ea3810 100644
--- a/qlist.c
+++ b/qlist.c
@@ -145,11 +145,11 @@ qlist_match(q_vdb_pkg_ctx *pkg_ctx, const char *name, depend_atom **name_atom, b
if (urepo) {
if (!pkg_ctx->repo)
q_vdb_pkg_eat(pkg_ctx, "repository", &pkg_ctx->repo, &pkg_ctx->repo_len);
- urepo_len = strlen(urepo);
urepo += 2;
+ urepo_len = strlen(urepo);
if (uslot_len)
- uslot_len -= urepo_len;
+ uslot_len -= (urepo_len + 2);
}
/* maybe they're using a version range */
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-12 17:17 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-12 17:17 UTC (permalink / raw
To: gentoo-commits
commit: 0cd1766c6aac6965666797dd875b1fdc0ea91b47
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 12 17:16:36 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Nov 12 17:16:36 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0cd1766c
qcache: handle DT_UNKNOWN and cases where DT_xxx are not available #580354
URL: https://bugs.gentoo.org/580354
Reported-by: Fabian Groffen <grobian <AT> gentoo.org>
qcache.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/qcache.c b/qcache.c
index 222c8ae..535d7a2 100644
--- a/qcache.c
+++ b/qcache.c
@@ -750,13 +750,31 @@ void qcache_stats(qcache_data *data)
xasprintf(&catpath, "%s/dep/%s", portedb, data->overlay);
dir = opendir(catpath);
- while ((de = readdir(dir)))
- if (de->d_type == DT_DIR && de->d_name[0] != '.') {
+ while ((de = readdir(dir))) {
+ /* Look for all the directories in this path. */
+#ifdef DT_UNKNOWN
+ if (de->d_type == DT_UNKNOWN)
+#endif
+ {
+ struct stat s;
+ if (lstat(de->d_name, &s))
+ continue;
+ if (!S_ISDIR(s.st_mode))
+ continue;
+ }
+
+#ifdef DT_DIR
+ if (de->d_type != DT_DIR)
+ continue;
+#endif
+
+ if (de->d_name[0] != '.') {
bool ok;
allcats = add_set_unique(de->d_name, allcats, &ok);
if (ok)
++numcat;
}
+ }
closedir(dir);
free(catpath);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-15 3:34 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-15 3:34 UTC (permalink / raw
To: gentoo-commits
commit: 2020f99b795192c9aff24fe6b1c3e3d8220d1ae0
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 15 02:24:10 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 02:24:10 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=2020f99b
qcheck: fix leakage with --skip regex array
qcheck.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/qcheck.c b/qcheck.c
index 79f52a9..40968a6 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -382,6 +382,11 @@ int qcheck_main(int argc, char **argv)
}
ret = q_vdb_foreach_pkg_sorted(qcheck_cb, &state);
+ {
+ void *regex;
+ array_for_each(regex_arr, i, regex)
+ regfree(regex);
+ }
xarrayfree(regex_arr);
array_for_each(atoms, i, atom)
atom_implode(atom);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-15 3:34 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-15 3:34 UTC (permalink / raw
To: gentoo-commits
commit: 743d4fe35a8d6029bc0da10b5b3d9f095a07f2c1
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 15 02:12:16 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 02:12:16 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=743d4fe3
qpkg: fix bad pointer passing
Taking an address of a stack buffer doesn't do what we want.
Create a local variable to hold the address to pass down.
URL: https://bugs.gentoo.org/598974
Reported-by: Alexander Wetzel <alexander.wetzel <AT> web.de>
main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
index e9e65b4..f6e5184 100644
--- a/main.c
+++ b/main.c
@@ -1356,6 +1356,7 @@ _q_static queue *get_vdb_atoms(int fullcpv)
char buf[_Q_PATH_MAX];
char slot[_Q_PATH_MAX];
+ char *slotp = slot;
size_t slot_len;
struct dirent **cat;
@@ -1384,7 +1385,7 @@ _q_static queue *get_vdb_atoms(int fullcpv)
* until this is rewritten & merged into libq/vdb.c. */
slot_len = sizeof(slot);
strncat(buf, "/SLOT", sizeof(buf));
- eat_file_at(ctx->vdb_fd, buf, (char **)&slot, &slot_len);
+ eat_file_at(ctx->vdb_fd, buf, &slotp, &slot_len);
rmspace(slot);
if (fullcpv) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-15 3:34 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-15 3:34 UTC (permalink / raw
To: gentoo-commits
commit: d97f4bbcd072d15d1754b27aa55a4999b831fe24
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 15 03:34:10 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 03:34:10 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d97f4bbc
qmerge: fix a few misc leaks
qmerge.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 8a5d329..c7b928e 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -187,7 +187,7 @@ _q_static void qmerge_initialize(void)
}
char *buf;
- xasprintf(&buf, "%s/portage", port_tmpdir);
+ xasprintf(&buf, "%s/portage/", port_tmpdir);
mkdir_p(buf, 0755);
xchdir(buf);
@@ -195,13 +195,10 @@ _q_static void qmerge_initialize(void)
if (force_download)
unlink(Packages);
- if (access(Packages, R_OK) != 0) {
- xasprintf(&buf, "%s/portage/", port_tmpdir);
- if (access(Packages, R_OK) != 0)
- fetch(buf, Packages);
- free(buf);
- }
+ if (access(Packages, R_OK) != 0)
+ fetch(buf, Packages);
}
+ free(buf);
}
struct qmerge_bv_state {
@@ -871,12 +868,16 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
return;
cat_ctx = q_vdb_open_cat(vdb_ctx, pkg->CATEGORY);
if (!cat_ctx) {
- if (errno != ENOENT)
+ if (errno != ENOENT) {
+ q_vdb_close(vdb_ctx);
return;
+ }
mkdirat(vdb_ctx->vdb_fd, pkg->CATEGORY, 0755);
cat_ctx = q_vdb_open_cat(vdb_ctx, pkg->CATEGORY);
- if (!cat_ctx)
+ if (!cat_ctx) {
+ q_vdb_close(vdb_ctx);
return;
+ }
}
/* Set up our temp dir to unpack this stuff */
@@ -983,13 +984,15 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
warn("no idea how we reached here.");
case ERROR:
case NOT_EQUAL:
- continue;
+ goto next_pkg;
}
qprintf("%s+++%s %s/%s %s %s/%s\n", GREEN, NORM, atom->CATEGORY, pkg->PF,
booga[ret], cat_ctx->name, pkg_ctx->name);
pkg_unmerge(pkg_ctx, objs);
+ next_pkg:
+ q_vdb_close_pkg(pkg_ctx);
}
/* Clean up the package state */
@@ -1020,6 +1023,8 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
rmdir("../qmerge");
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);
}
_q_static int
@@ -1051,7 +1056,7 @@ pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, queue *keep)
/* First get a handle on the things to clean up */
fp = q_vdb_pkg_fopenat_ro(pkg_ctx, "CONTENTS");
if (fp == NULL)
- goto done;
+ return ret;
portroot_fd = cat_ctx->ctx->portroot_fd;
@@ -1199,7 +1204,6 @@ pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, queue *keep)
}
ret = 0;
- done:
free(phases);
free(buf);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-15 3:34 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-15 3:34 UTC (permalink / raw
To: gentoo-commits
commit: 6925dd5d04d79ea510a9de620d00fcdd54f30394
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 15 02:36:19 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 02:36:19 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6925dd5d
qlist: fix leakage with matched atoms
qlist.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qlist.c b/qlist.c
index 4ea3810..91ed45c 100644
--- a/qlist.c
+++ b/qlist.c
@@ -411,6 +411,9 @@ int qlist_main(int argc, char **argv)
state.atoms = xcalloc(argc - optind, sizeof(*state.atoms));
ret = q_vdb_foreach_pkg_sorted(qlist_cb, &state);
free(state.buf);
+ for (i = optind; i < state.argc; ++i)
+ if (state.atoms[i - optind])
+ atom_implode(state.atoms[i - optind]);
free(state.atoms);
/* The return value is whether we matched anything. */
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-15 3:34 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-15 3:34 UTC (permalink / raw
To: gentoo-commits
commit: 00bd72f7753299b7b4ba8da6d0471bf09f13b09f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 15 03:02:01 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 03:02:01 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=00bd72f7
qmerge: fix mem leak w/hash_file calls
qmerge.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/qmerge.c b/qmerge.c
index b734a87..8a5d329 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -588,6 +588,7 @@ merge_tree_at(int fd_src, const char *src, int fd_dst, const char *dst,
/* syntax: obj filename hash mtime */
hash = hash_file_at(subfd_src, name, HASH_MD5);
fprintf(contents, "obj %s %s %"PRIu64"\n", cpath, hash, (uint64_t)st.st_mtime);
+ free(hash);
/* Check CONFIG_PROTECT */
if (config_protected(cpath, cp_argc, cp_argv, cpm_argc, cpm_argv)) {
@@ -1102,6 +1103,7 @@ pkg_unmerge(q_vdb_pkg_ctx *pkg_ctx, queue *keep)
/* If the file wasn't modified, unmerge it */
unsigned char *hash = hash_file_at(portroot_fd, e->name + 1, HASH_MD5);
protected = strcmp(e->digest, (const char *)hash);
+ free(hash);
}
break;
@@ -1232,6 +1234,7 @@ pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *at
warn("MD5: [%sER%s] (%s) != (%s) %s/%s", RED, NORM, hash, pkg->MD5, atom->CATEGORY, pkg->PF);
ret++;
}
+ free(hash);
}
if (pkg->SHA1[0]) {
@@ -1244,6 +1247,7 @@ pkg_verify_checksums(char *fname, const struct pkg_t *pkg, const depend_atom *at
warn("SHA1: [%sER%s] (%s) != (%s) %s/%s", RED, NORM, hash, pkg->SHA1, atom->CATEGORY, pkg->PF);
ret++;
}
+ free(hash);
}
if (!pkg->SHA1[0] && !pkg->MD5[0])
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-26 23:17 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-26 23:17 UTC (permalink / raw
To: gentoo-commits
commit: 15ccfc885d054d312b7d6d20ec0b91988f1b139d
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 22:54:06 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 22:54:06 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=15ccfc88
repos.conf: add some debug printing
main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/main.c b/main.c
index f6e5184..76e5bad 100644
--- a/main.c
+++ b/main.c
@@ -451,6 +451,9 @@ static void read_one_repos_conf(const char *repos_conf)
const char *main_repo, *repo, *path;
dictionary *dict;
+ if (getenv("DEBUG"))
+ fprintf(stderr, " parse %s\n", repos_conf);
+
dict = iniparser_load(repos_conf);
main_repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
@@ -482,6 +485,8 @@ static void read_repos_conf(const char *configroot, const char *repos_conf)
struct dirent **confs;
xasprintf(&top_conf, "%s%s", configroot, repos_conf);
+ if (getenv("DEBUG"))
+ fprintf(stderr, "repos.conf.d scanner %s\n", top_conf);
count = scandir(top_conf, &confs, NULL, alphasort);
if (count == -1) {
if (errno == ENOTDIR)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-26 23:24 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-26 23:24 UTC (permalink / raw
To: gentoo-commits
commit: 3aa4c173d3fb52c700109cb625dbefb5d3e45628
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 23:23:59 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 23:23:59 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3aa4c173
--quiet: only open /dev/null once (in case of -qqqqqqq)
main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 8e0e2ad..ff7648d 100644
--- a/main.c
+++ b/main.c
@@ -107,7 +107,7 @@ void no_colors(void)
#define COMMON_GETOPTS_CASES(applet) \
case 0x1: portroot = optarg; break; \
case 'v': ++verbose; break; \
- case 'q': ++quiet; warnout = fopen("/dev/null", "we"); break; \
+ case 'q': if (quiet == 0) { warnout = fopen("/dev/null", "we"); } ++quiet; break; \
case 'V': version_barf(); break; \
case 'h': applet ## _usage(EXIT_SUCCESS); break; \
case 'C': no_colors(); break; \
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-26 23:46 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-26 23:46 UTC (permalink / raw
To: gentoo-commits
commit: ba9b4e7ce385dd12e3cac131d6997d1ef84ee162
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 23:34:33 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 23:34:33 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ba9b4e7c
rewrite docs in markdown for github integration
HACKING | 32 --------------------------
HACKING.md | 20 ++++++++++++++++
README | 31 -------------------------
README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TODO | 59 -----------------------------------------------
TODO.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 169 insertions(+), 122 deletions(-)
diff --git a/HACKING b/HACKING
deleted file mode 100644
index 67dbbaf..0000000
--- a/HACKING
+++ /dev/null
@@ -1,32 +0,0 @@
-- Adding applets is easy using the q framework.
- Note: Please try to keep applet names under 8 chars.
- * cp template.c qmyapplet.c (all applets use the prefix of the letter 'q')
- * applets.h: add your prototype (see DECLARE_APPLET macro)
- * applets.h: add a new line to applets[] following the existing syntax
- * run `make depend` to auto regenerate dependent files
-
-When and where you can please try to use an existing applet and extend
-on its functionality by adding more options vs adding a bunch of new
-little applets.
-
-- Keep behavior consistent
- * matching:
- default is sloppy match
- -e exact match
- -r regex match
-
-## Examples:
- * find elf files linking to old openssl
- qlist -ao | scanelf -BqgN libssl.so.0.9.6 -f -
-
- * print a package.use
- qlist -UCq | grep ' ' > package.use
-
- * find orphan files not owned by any package in /lib and /usr/lib
- qfile -o {,/usr}/lib/*
-
- # get PORTDIR
- DEBUG=: ./q -Ch 2>&1 | grep ^PORTDIR | awk '{print $3}
-
- # Verify all packages
- qcheck -a
diff --git a/HACKING.md b/HACKING.md
new file mode 100644
index 0000000..e0536fa
--- /dev/null
+++ b/HACKING.md
@@ -0,0 +1,20 @@
+# New applets
+
+Adding applets is easy using the q framework.
+
+Note: Please try to keep applet names under 8 chars.
+
+- cp template.c qmyapplet.c (all applets use the prefix of the letter 'q')
+- applets.h: add your prototype (see DECLARE_APPLET macro)
+- applets.h: add a new line to applets[] following the existing syntax
+- run `make depend` to auto regenerate dependent files
+
+When and where you can please try to use an existing applet and extend
+on its functionality by adding more options vs adding a bunch of new
+little applets.
+
+- Keep behavior consistent
+ - matching:
+ - default is sloppy match
+ - -e exact match
+ - -r regex match
diff --git a/README b/README
deleted file mode 100644
index 1a8dc3d..0000000
--- a/README
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2005-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-Contact:
- Please file bugs at:
- https://bugs.gentoo.org/enter_bug.cgi?product=Portage%20Development&format=guided
- Use Component of "Third-Party Tools".
-
-Current developer list:
- solar@gentoo.org
- vapier@gentoo.org
-
-
-- Speed is everything.
- Having your PORTDIR and VDB on the right file system helps dramatically
-
- IDE raid with PORTDIR on reiserfs:
- q -r
- q: Finished 20655 entries in 1.990951 seconds
-
- IDE raid with PORTDIR on ext3:
- q -r
- q: Finished 20655 entries in 203.664252 seconds
-
-
-- Fetching via anon git:
-
- git clone git://anongit.gentoo.org/proj/portage-utils.git
-
-You can view it online via gitweb:
- https://gitweb.gentoo.org/proj/portage-utils.git/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fc9448c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,72 @@
+# Gentoo Portage Utilities
+
+| What | How |
+| -------- | --------------------------------------------------------- |
+| HOMEPAGE | https://wiki.gentoo.org/wiki/Portage-utils |
+| GIT | git clone git://anongit.gentoo.org/proj/portage-utils.git |
+| VIEWVCS | https://gitweb.gentoo.org/proj/portage-utils.git/ |
+| STATUS | [![Build Status](https://travis-ci.org/gentoo/portage-utils.svg?branch=master)](https://travis-ci.org/gentoo/portage-utils) [![Coverity Status](https://scan.coverity.com/projects/9213/badge.svg)](https://scan.coverity.com/projects/gentoo-portage-utils) |
+
+portage-utils is a small set of utilities for working with Portage, Gentoo
+ebuilds, Gentoo ebuild overlays, installed packages (vdb), and similar sources
+of information. The focus is on size and speed, so everything is in C.
+
+## Building
+
+Just run `make`. This should work on any recent POSIX compliant system.
+
+## Helping out
+
+There's a large [TODO.md] list with various ideas for improvements.
+
+There's also a [HACKING.md] doc to help you get started.
+
+## Examples
+
+* find elf files linking to old openssl<br>
+ `qlist -ao | scanelf -BqgN libssl.so.0.9.6 -f -`
+
+* print a package.use<br>
+ `qlist -UCq | grep ' ' > package.use`
+
+* find orphan files not owned by any package in /lib and /usr/lib<br>
+ `qfile -o {,/usr}/lib/*`
+
+* get PORTDIR<br>
+ `DEBUG=: ./q -Ch 2>&1 | grep ^PORTDIR | awk '{print $3}`
+
+* Verify all packages<br>
+ `qcheck -a`
+
+## Contact
+
+### Bugs
+
+Please file bugs at:
+ https://bugs.gentoo.org/enter_bug.cgi?product=Portage%20Development&format=guided
+
+Use Component of "Third-Party Tools".
+
+### Developers
+
+* solar@gentoo.org
+* vapier@gentoo.org
+
+## Notes
+
+### Speed is everything.
+
+Having your PORTDIR and VDB on the right file system helps dramatically
+
+IDE raid with PORTDIR on reiserfs:
+
+```
+$ q -r
+q: Finished 20655 entries in 1.990951 seconds
+
+IDE raid with PORTDIR on ext3:
+
+```
+$ q -r
+q: Finished 20655 entries in 203.664252 seconds
+```
diff --git a/TODO b/TODO
deleted file mode 100644
index 08e8bc3..0000000
--- a/TODO
+++ /dev/null
@@ -1,59 +0,0 @@
-- unify match behavior:
- default *foo*
- -e foo
- -r (-R ?) regexp foo.*
-
-- disable color when tty = NULL; may break less?
-
-- multiline reads don't yet work for quse/qsearch
-
-- standardize/unify/clean up misc handling of colors
-
-- speed up queue structure ... append walks the whole list
-
-- qmerge
- - dep resolver needs spanktastic love.
- - needs safe deleting (merge in place rather than unmerge;merge)
- - multiple binary repos (talk to zmedico)
- - handle compressed Packages file (talk to zmedico)
- - handle binary Packages file (talk to zmedico)
- - gpg sign the packages file (before compression)
- - binary vdb (sqlite) ... talk to zmedico
- - remote vdb
- - don't bother emitting any "DIR" entries to CONTENTS ?
- - auto rmdir any empty dirs
- - avoid Packages fetching all the damned time
- - parallel fetch tbz2s
- - check order of pkg_{pre,post}{inst,rm} during install, unmerge, and upgrade
- - env is not saved/restored between pkg_{pre,post}inst (see portage and REPO_LAYOUT_CONF_WARN)
- - support installing via path to tbz2 package
- - support TTL field in binpkgs file
-
-- atoms:
- - only 32bit values are supported for revision (-r#)
- - only 64bit values are supported in any individual version component
- foo-(1234)_alpha(56789)
- - these limits should not be an issue for all practical purposes
- - need to handle USE deps like: cat/pkg-123[foo(+)]
- - show support slots like: qmerge -U automake:1.12
-
-- qcache:
- - need to convert it to new metadata/md5 style
-
-- qdepends:
- - support querying uninstalled packages (via metadata/md5 cache)
-
-- env vars only get expanded once, so this fails:
- ACCEPT_LICENSE="foo"
- ACCEPT_LICENSE="${ACCEPT_LICENSE} bar"
- we end up getting just:
- ACCEPT_LICENSE=" bar"
-
-- qpkg:
- - fix "would be freed" message when --pretend is *not* active
- - add a verbose output that describes why a package is cleaned
- - newer binpkgs available
- - newer installed version available
-
-- qsync:
- - rewrite to use new repos.conf standard
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..86ebbd7
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,77 @@
+# Common
+
+- unify match behavior:
+ - default *foo*
+ - -e foo
+ - -r (-R ?) regexp foo.*
+
+- disable color when tty = NULL; may break less?
+
+- multiline reads don't yet work for quse/qsearch
+
+- standardize/unify/clean up misc handling of colors
+
+- speed up queue structure ... append walks the whole list
+
+- equiv of `equery m` (metadata)
+
+- env vars only get expanded once, so this fails:<br>
+ `ACCEPT_LICENSE="foo"`<br>
+ `ACCEPT_LICENSE="${ACCEPT_LICENSE} bar"`<br>
+ we end up getting just:<br>
+ `ACCEPT_LICENSE=" bar"`
+
+# Atoms
+
+- only 32bit values are supported for revision (-r#)
+- only 64bit values are supported in any individual version component
+ foo-(1234)_alpha(56789)
+- these limits should not be an issue for all practical purposes
+- need to handle USE deps like: cat/pkg-123[foo(+)]
+- show support slots like: qmerge -U automake:1.12
+
+# qmerge
+
+- dep resolver needs spanktastic love.
+- needs safe deleting (merge in place rather than unmerge;merge)
+- multiple binary repos (talk to zmedico)
+- handle compressed Packages file (talk to zmedico)
+- handle binary Packages file (talk to zmedico)
+- gpg sign the packages file (before compression)
+- binary vdb (sqlite) ... talk to zmedico
+- remote vdb
+- don't bother emitting any "DIR" entries to CONTENTS ?
+ - auto rmdir any empty dirs
+- avoid Packages fetching all the damned time
+- parallel fetch tbz2s
+- check order of pkg_{pre,post}{inst,rm} during install, unmerge, and upgrade
+- env is not saved/restored between pkg_{pre,post}inst (see portage and REPO_LAYOUT_CONF_WARN)
+- support installing via path to tbz2 package
+- support TTL field in binpkgs file
+- merge duplicate atoms on the CLI (`qmerge -Uq nano nano nano`)
+- unmerging should clean out @world set
+
+# qcache
+
+- need to convert it to new metadata/md5 style
+
+# qdepends
+
+- support querying uninstalled packages (via metadata/md5 cache)
+- support atoms like `qdepends -rQ qtsql:4` (should match unslotted deps)
+- add -S/-v/-R behavior like qlist #574934
+
+# qpkg
+
+- fix "would be freed" message when --pretend is *not* active
+- add a verbose output that describes why a package is cleaned
+ - newer binpkgs available
+ - newer installed version available
+
+# qsync
+
+- rewrite to use new repos.conf standard
+
+# qlist
+
+- support atoms instead of exact matches
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-26 23:48 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-26 23:48 UTC (permalink / raw
To: gentoo-commits
commit: e1da9e5bde6c18bd9bd411ce20cdacdcb97e135c
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 23:34:33 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 23:34:33 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e1da9e5b
rewrite docs in markdown for github integration
HACKING | 32 --------------------------
HACKING.md | 20 ++++++++++++++++
README | 31 -------------------------
README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TODO | 59 -----------------------------------------------
TODO.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 169 insertions(+), 122 deletions(-)
diff --git a/HACKING b/HACKING
deleted file mode 100644
index 67dbbaf..0000000
--- a/HACKING
+++ /dev/null
@@ -1,32 +0,0 @@
-- Adding applets is easy using the q framework.
- Note: Please try to keep applet names under 8 chars.
- * cp template.c qmyapplet.c (all applets use the prefix of the letter 'q')
- * applets.h: add your prototype (see DECLARE_APPLET macro)
- * applets.h: add a new line to applets[] following the existing syntax
- * run `make depend` to auto regenerate dependent files
-
-When and where you can please try to use an existing applet and extend
-on its functionality by adding more options vs adding a bunch of new
-little applets.
-
-- Keep behavior consistent
- * matching:
- default is sloppy match
- -e exact match
- -r regex match
-
-## Examples:
- * find elf files linking to old openssl
- qlist -ao | scanelf -BqgN libssl.so.0.9.6 -f -
-
- * print a package.use
- qlist -UCq | grep ' ' > package.use
-
- * find orphan files not owned by any package in /lib and /usr/lib
- qfile -o {,/usr}/lib/*
-
- # get PORTDIR
- DEBUG=: ./q -Ch 2>&1 | grep ^PORTDIR | awk '{print $3}
-
- # Verify all packages
- qcheck -a
diff --git a/HACKING.md b/HACKING.md
new file mode 100644
index 0000000..e0536fa
--- /dev/null
+++ b/HACKING.md
@@ -0,0 +1,20 @@
+# New applets
+
+Adding applets is easy using the q framework.
+
+Note: Please try to keep applet names under 8 chars.
+
+- cp template.c qmyapplet.c (all applets use the prefix of the letter 'q')
+- applets.h: add your prototype (see DECLARE_APPLET macro)
+- applets.h: add a new line to applets[] following the existing syntax
+- run `make depend` to auto regenerate dependent files
+
+When and where you can please try to use an existing applet and extend
+on its functionality by adding more options vs adding a bunch of new
+little applets.
+
+- Keep behavior consistent
+ - matching:
+ - default is sloppy match
+ - -e exact match
+ - -r regex match
diff --git a/README b/README
deleted file mode 100644
index 1a8dc3d..0000000
--- a/README
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2005-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-Contact:
- Please file bugs at:
- https://bugs.gentoo.org/enter_bug.cgi?product=Portage%20Development&format=guided
- Use Component of "Third-Party Tools".
-
-Current developer list:
- solar@gentoo.org
- vapier@gentoo.org
-
-
-- Speed is everything.
- Having your PORTDIR and VDB on the right file system helps dramatically
-
- IDE raid with PORTDIR on reiserfs:
- q -r
- q: Finished 20655 entries in 1.990951 seconds
-
- IDE raid with PORTDIR on ext3:
- q -r
- q: Finished 20655 entries in 203.664252 seconds
-
-
-- Fetching via anon git:
-
- git clone git://anongit.gentoo.org/proj/portage-utils.git
-
-You can view it online via gitweb:
- https://gitweb.gentoo.org/proj/portage-utils.git/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3889ee2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,72 @@
+# Gentoo Portage Utilities
+
+| What | How |
+| -------- | --------------------------------------------------------- |
+| HOMEPAGE | https://wiki.gentoo.org/wiki/Portage-utils |
+| GIT | git clone git://anongit.gentoo.org/proj/portage-utils.git |
+| VIEWVCS | https://gitweb.gentoo.org/proj/portage-utils.git/ |
+| STATUS | [![Build Status](https://travis-ci.org/gentoo/portage-utils.svg?branch=master)](https://travis-ci.org/gentoo/portage-utils) [![Coverity Status](https://scan.coverity.com/projects/9213/badge.svg)](https://scan.coverity.com/projects/gentoo-portage-utils) |
+
+portage-utils is a small set of utilities for working with Portage, Gentoo
+ebuilds, Gentoo ebuild overlays, installed packages (vdb), and similar sources
+of information. The focus is on size and speed, so everything is in C.
+
+## Building
+
+Just run `make`. This should work on any recent POSIX compliant system.
+
+## Helping out
+
+There's a large [TODO](./TODO.md) list with various ideas for improvements.
+
+There's also a [HACKING](./HACKING.md) doc to help you get started.
+
+## Examples
+
+* find elf files linking to old openssl<br>
+ `qlist -ao | scanelf -BqgN libssl.so.0.9.6 -f -`
+
+* print a package.use<br>
+ `qlist -UCq | grep ' ' > package.use`
+
+* find orphan files not owned by any package in /lib and /usr/lib<br>
+ `qfile -o {,/usr}/lib/*`
+
+* get PORTDIR<br>
+ `DEBUG=: ./q -Ch 2>&1 | grep ^PORTDIR | awk '{print $3}`
+
+* Verify all packages<br>
+ `qcheck -a`
+
+## Contact
+
+### Bugs
+
+Please file bugs at:
+ https://bugs.gentoo.org/enter_bug.cgi?product=Portage%20Development&format=guided
+
+Use Component of "Third-Party Tools".
+
+### Developers
+
+* solar@gentoo.org
+* vapier@gentoo.org
+
+## Notes
+
+### Speed is everything.
+
+Having your PORTDIR and VDB on the right file system helps dramatically
+
+IDE raid with PORTDIR on reiserfs:
+
+```
+$ q -r
+q: Finished 20655 entries in 1.990951 seconds
+
+IDE raid with PORTDIR on ext3:
+
+```
+$ q -r
+q: Finished 20655 entries in 203.664252 seconds
+```
diff --git a/TODO b/TODO
deleted file mode 100644
index 08e8bc3..0000000
--- a/TODO
+++ /dev/null
@@ -1,59 +0,0 @@
-- unify match behavior:
- default *foo*
- -e foo
- -r (-R ?) regexp foo.*
-
-- disable color when tty = NULL; may break less?
-
-- multiline reads don't yet work for quse/qsearch
-
-- standardize/unify/clean up misc handling of colors
-
-- speed up queue structure ... append walks the whole list
-
-- qmerge
- - dep resolver needs spanktastic love.
- - needs safe deleting (merge in place rather than unmerge;merge)
- - multiple binary repos (talk to zmedico)
- - handle compressed Packages file (talk to zmedico)
- - handle binary Packages file (talk to zmedico)
- - gpg sign the packages file (before compression)
- - binary vdb (sqlite) ... talk to zmedico
- - remote vdb
- - don't bother emitting any "DIR" entries to CONTENTS ?
- - auto rmdir any empty dirs
- - avoid Packages fetching all the damned time
- - parallel fetch tbz2s
- - check order of pkg_{pre,post}{inst,rm} during install, unmerge, and upgrade
- - env is not saved/restored between pkg_{pre,post}inst (see portage and REPO_LAYOUT_CONF_WARN)
- - support installing via path to tbz2 package
- - support TTL field in binpkgs file
-
-- atoms:
- - only 32bit values are supported for revision (-r#)
- - only 64bit values are supported in any individual version component
- foo-(1234)_alpha(56789)
- - these limits should not be an issue for all practical purposes
- - need to handle USE deps like: cat/pkg-123[foo(+)]
- - show support slots like: qmerge -U automake:1.12
-
-- qcache:
- - need to convert it to new metadata/md5 style
-
-- qdepends:
- - support querying uninstalled packages (via metadata/md5 cache)
-
-- env vars only get expanded once, so this fails:
- ACCEPT_LICENSE="foo"
- ACCEPT_LICENSE="${ACCEPT_LICENSE} bar"
- we end up getting just:
- ACCEPT_LICENSE=" bar"
-
-- qpkg:
- - fix "would be freed" message when --pretend is *not* active
- - add a verbose output that describes why a package is cleaned
- - newer binpkgs available
- - newer installed version available
-
-- qsync:
- - rewrite to use new repos.conf standard
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..86ebbd7
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,77 @@
+# Common
+
+- unify match behavior:
+ - default *foo*
+ - -e foo
+ - -r (-R ?) regexp foo.*
+
+- disable color when tty = NULL; may break less?
+
+- multiline reads don't yet work for quse/qsearch
+
+- standardize/unify/clean up misc handling of colors
+
+- speed up queue structure ... append walks the whole list
+
+- equiv of `equery m` (metadata)
+
+- env vars only get expanded once, so this fails:<br>
+ `ACCEPT_LICENSE="foo"`<br>
+ `ACCEPT_LICENSE="${ACCEPT_LICENSE} bar"`<br>
+ we end up getting just:<br>
+ `ACCEPT_LICENSE=" bar"`
+
+# Atoms
+
+- only 32bit values are supported for revision (-r#)
+- only 64bit values are supported in any individual version component
+ foo-(1234)_alpha(56789)
+- these limits should not be an issue for all practical purposes
+- need to handle USE deps like: cat/pkg-123[foo(+)]
+- show support slots like: qmerge -U automake:1.12
+
+# qmerge
+
+- dep resolver needs spanktastic love.
+- needs safe deleting (merge in place rather than unmerge;merge)
+- multiple binary repos (talk to zmedico)
+- handle compressed Packages file (talk to zmedico)
+- handle binary Packages file (talk to zmedico)
+- gpg sign the packages file (before compression)
+- binary vdb (sqlite) ... talk to zmedico
+- remote vdb
+- don't bother emitting any "DIR" entries to CONTENTS ?
+ - auto rmdir any empty dirs
+- avoid Packages fetching all the damned time
+- parallel fetch tbz2s
+- check order of pkg_{pre,post}{inst,rm} during install, unmerge, and upgrade
+- env is not saved/restored between pkg_{pre,post}inst (see portage and REPO_LAYOUT_CONF_WARN)
+- support installing via path to tbz2 package
+- support TTL field in binpkgs file
+- merge duplicate atoms on the CLI (`qmerge -Uq nano nano nano`)
+- unmerging should clean out @world set
+
+# qcache
+
+- need to convert it to new metadata/md5 style
+
+# qdepends
+
+- support querying uninstalled packages (via metadata/md5 cache)
+- support atoms like `qdepends -rQ qtsql:4` (should match unslotted deps)
+- add -S/-v/-R behavior like qlist #574934
+
+# qpkg
+
+- fix "would be freed" message when --pretend is *not* active
+- add a verbose output that describes why a package is cleaned
+ - newer binpkgs available
+ - newer installed version available
+
+# qsync
+
+- rewrite to use new repos.conf standard
+
+# qlist
+
+- support atoms instead of exact matches
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-27 0:00 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-27 0:00 UTC (permalink / raw
To: gentoo-commits
commit: e98d5c97eef7533ec49ad46bbecba60ac38f430f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 00:00:02 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 00:00:02 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e98d5c97
qxpak: check -d argument
qxpak.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/qxpak.c b/qxpak.c
index baceda9..aa1a281 100644
--- a/qxpak.c
+++ b/qxpak.c
@@ -393,6 +393,8 @@ int qxpak_main(int argc, char **argv)
if (dir_fd != AT_FDCWD)
err("Only use -d once");
dir_fd = open(optarg, O_RDONLY|O_CLOEXEC|O_PATH);
+ if (dir_fd < 0)
+ errp("Could not open directory %s", optarg);
break;
}
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-27 1:50 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-27 1:50 UTC (permalink / raw
To: gentoo-commits
commit: e61179d1b30ac9b95d85788c320b6cfcb567171a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 01:50:36 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 01:50:36 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e61179d1
cache: fix fclose(NULL) error when cache reading fails
main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.c b/main.c
index ff7648d..b99768d 100644
--- a/main.c
+++ b/main.c
@@ -1303,7 +1303,7 @@ portage_cache *cache_read_file_md5(const char *file)
return ret;
err:
- fclose(f);
+ if (f) fclose(f);
if (ret) cache_free(ret);
return NULL;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-27 1:52 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-27 1:52 UTC (permalink / raw
To: gentoo-commits
commit: e2e85efc16e3bc2bc7defccc8f184a704f533988
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 01:52:02 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 01:52:02 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e2e85efc
cache: fix open cache file leakage
main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/main.c b/main.c
index b99768d..af2ccce 100644
--- a/main.c
+++ b/main.c
@@ -1206,6 +1206,7 @@ portage_cache *cache_read_file_pms(const char *file)
return ret;
err:
+ if (f) fclose(f);
if (ret) cache_free(ret);
return NULL;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-27 5:46 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-27 5:46 UTC (permalink / raw
To: gentoo-commits
commit: 1fef622745ef3ce4c8baaf6aef46686e91c7c5ed
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 05:20:44 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 05:20:44 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1fef6227
build: update names of docs after markdown conversion
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 949b375..7c64fe9 100644
--- a/Makefile
+++ b/Makefile
@@ -50,7 +50,7 @@ endif
ifndef PF
PF := portage-utils-$(PV)
endif
-DOCS := TODO README qsync
+DOCS := TODO.md README.md qsync
#ifdef PYTHON
#PYFLAGS ?= $(shell python-config) -DWANT_PYTHON -ldl -pthread -lutil /usr/lib/libpython2.4.so
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-27 5:46 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-27 5:46 UTC (permalink / raw
To: gentoo-commits
commit: 4c9a3b2f82783e7a97c4503778aadb1d2b06e14b
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 05:04:57 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 05:04:57 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4c9a3b2f
build: add lazy support for STATIC=yes builds
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index baa27c2..949b375 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,8 @@ CPPFLAGS ?=
CPPFLAGS += -DENABLE_NLS=$(call istrue,$(NLS))
DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc, -fsanitize=address -fsanitize=leak -fsanitize=undefined)
#CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2 -falign-labels=2 -falign-loops=2
-#LDFLAGS := -pie
+LDFLAGS_static_1 = -static
+LDFLAGS += $(LDFLAGS_static_$(call istrue,$(STATIC)))
LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo '-lkvm')
LIBADD += -liniparser
DESTDIR :=
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-11-27 5:46 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-11-27 5:46 UTC (permalink / raw
To: gentoo-commits
commit: 11e32f92d619d4b3769dce94f7a1bff0b9341444
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 03:56:47 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 03:56:47 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=11e32f92
autotools: update source list
Makefile.am | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 362ee21..7b9c35b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -178,6 +178,8 @@ EXTRA_DIST += \
tests/profile/profile1/etc/portage/make.conf \
tests/profile/profile1/etc/portage/subdir/file.conf \
tests/profile/profile1/etc/portage/this.level.conf \
+ tests/qatom/Makefile \
+ tests/qatom/dotest \
tests/qcheck/Makefile \
tests/qcheck/dotest \
tests/qcheck/list01.good \
@@ -236,6 +238,7 @@ EXTRA_DIST += \
tests/qlist/list13.good \
tests/qlist/list14.good \
tests/qlist/list15.good \
+ tests/qlist/list16.good \
tests/qlist/root/-merge-foo/CONTENTS \
tests/qlist/root/a-b/a-0/CONTENTS \
tests/qlist/root/a-b/a-0/SLOT \
@@ -258,8 +261,15 @@ EXTRA_DIST += \
tests/qlop/Makefile \
tests/qlop/dotest \
tests/qlop/list01.good \
+ tests/qlop/list02.good \
+ tests/qlop/list03.good \
+ tests/qlop/list04.good \
+ tests/qlop/list05.good \
+ tests/qlop/list06.good \
+ tests/qlop/list07.good \
+ tests/qlop/list08.good \
tests/qlop/sync.log \
- tests/qmerge/.gdb_history \
+ tests/qlop/test04.good \
tests/qmerge/Makefile \
tests/qmerge/dotest \
tests/qmerge/packages/Packages \
@@ -281,6 +291,10 @@ EXTRA_DIST += \
tests/qxpak/list02.good \
tests/reinitialize/Makefile \
tests/reinitialize/dotest \
+ tests/rmspace/.gitignore \
+ tests/rmspace/Makefile \
+ tests/rmspace/dotest \
+ tests/rmspace/test.c \
tests/source/Makefile \
tests/source/dotest \
tests/source/space \
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-20 16:55 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-20 16:55 UTC (permalink / raw
To: gentoo-commits
commit: 9909f96b644a812e93916c91bac0fdc1a4c586c3
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 20 16:54:52 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Dec 20 16:54:52 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9909f96b
qmerge: fix clang -Wpointer-bool-conversion warning
qmerge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qmerge.c b/qmerge.c
index c7b928e..68459c9 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -771,7 +771,7 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
if (!install || !pkg || !atom)
return;
- if (!pkg->PF[0] || !pkg->CATEGORY) {
+ if (!pkg->PF[0] || !pkg->CATEGORY[0]) {
if (verbose) warn("CPF is really NULL at level %d", level);
return;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-20 19:15 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-20 19:15 UTC (permalink / raw
To: gentoo-commits
commit: e2897872598b390b79e09d878738cfac3b3380ac
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 20 19:14:58 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Dec 20 19:14:58 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e2897872
main: rework path handling to avoid unsafe strncat
While this strncat shouldn't cause a problem, we can refactor the code
a bit to avoid it entirely, and check the earlier snprintf result to
boot. This also avoids warnings from clang about bad args to strncat.
main.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/main.c b/main.c
index af2ccce..543ac36 100644
--- a/main.c
+++ b/main.c
@@ -1382,14 +1382,20 @@ _q_static queue *get_vdb_atoms(int fullcpv)
if ((dfd = scandirat(ctx->vdb_fd, cat[j]->d_name, &pf, q_vdb_filter_pkg, alphasort)) < 0)
continue;
for (i = 0; i < dfd; i++) {
- snprintf(buf, sizeof(buf), "%s/%s", cat[j]->d_name, pf[i]->d_name);
+ int blen = snprintf(buf, sizeof(buf), "%s/%s/SLOT", cat[j]->d_name, pf[i]->d_name);
+ if (blen >= sizeof(buf)) {
+ warnf("unable to parse long package: %s/%s", cat[j]->d_name, pf[i]->d_name);
+ continue;
+ }
+
+ /* Chop the SLOT for the atom parsing. */
+ buf[blen - 5] = '\0';
if ((atom = atom_explode(buf)) == NULL)
continue;
+ /* Restore the SLOT. */
+ buf[blen - 5] = '/';
- /* XXX: This assumes static slot buf is big enough, but should be fine
- * until this is rewritten & merged into libq/vdb.c. */
slot_len = sizeof(slot);
- strncat(buf, "/SLOT", sizeof(buf));
eat_file_at(ctx->vdb_fd, buf, &slotp, &slot_len);
rmspace(slot);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-29 2:25 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-29 2:25 UTC (permalink / raw
To: gentoo-commits
commit: d6d33b2ef60f3700702e59f8cdf718b7dd3fb886
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 28 22:33:45 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Dec 28 22:33:45 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d6d33b2e
move system headers to porting.h to avoid duplication
porting.h | 3 +++
qcache.c | 10 ----------
qmerge.c | 3 ---
qpkg.c | 2 --
4 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/porting.h b/porting.h
index 28b6317..b166bc1 100644
--- a/porting.h
+++ b/porting.h
@@ -30,7 +30,10 @@
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
+#include <fcntl.h>
+#include <fnmatch.h>
#include <getopt.h>
+#include <glob.h>
#include <inttypes.h>
#include <libgen.h>
#include <limits.h>
diff --git a/qcache.c b/qcache.c
index 535d7a2..c5421c7 100644
--- a/qcache.c
+++ b/qcache.c
@@ -7,16 +7,6 @@
#ifdef APPLET_qcache
-#include <dirent.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <unistd.h>
-
/********************************************************************/
/* Required portage-utils stuff */
/********************************************************************/
diff --git a/qmerge.c b/qmerge.c
index 68459c9..4ef156b 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -8,9 +8,6 @@
#ifdef APPLET_qmerge
-#include <fnmatch.h>
-#include <glob.h>
-#include <sys/stat.h>
/* This is a GNUlib hack, because GNUlib doesn't provide st_mtim members
* of struct stat, but instead provides wrappers to retrieve the time
* fields (stat-time module). We just define a macro in case people are
diff --git a/qpkg.c b/qpkg.c
index 2cc658e..1c18edc 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -8,8 +8,6 @@
#ifdef APPLET_qpkg
-#include <fnmatch.h>
-
#define QPKG_FLAGS "cEpP:" COMMON_FLAGS
static struct option const qpkg_long_opts[] = {
{"clean", no_argument, NULL, 'c'},
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-29 2:25 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-29 2:25 UTC (permalink / raw
To: gentoo-commits
commit: ae34cc566f072a90ef3453978fee8b4adcd75adf
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 02:19:04 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 02:19:04 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ae34cc56
qmerge: tweak case style to suppress coverity warning
qmerge.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qmerge.c b/qmerge.c
index 05e46b4..e84fcbb 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1869,7 +1869,9 @@ int qmerge_main(int argc, char **argv)
case 'K': install = 1; break;
case 'U': uninstall = 1; break;
case 'p': pretend = 1; break;
- case 'u': update_only = 1;
+ case 'u':
+ update_only = 1;
+ /* fall through */
case 'y': interactive = 0; break;
case 'O': follow_rdepends = 0; break;
case 128: debug = true; break;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-29 2:25 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-29 2:25 UTC (permalink / raw
To: gentoo-commits
commit: 45f8462493056b8ca0634ac0c8942c171deee075
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 02:22:06 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 02:22:06 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=45f84624
cache: add sanity check on malformed cache files
main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/main.c b/main.c
index 33db01a..d124695 100644
--- a/main.c
+++ b/main.c
@@ -1215,6 +1215,10 @@ cache_read_file_pms(const char *file)
next_line(EAPI, PROPERTIES)
#undef next_line
ptr = strchr(ptr+1, '\n');
+ if (ptr == NULL) {
+ warn("Invalid cache file '%s' - could not find end of cache data", file);
+ goto err;
+ }
*ptr = '\0';
fclose(f);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-29 2:25 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-29 2:25 UTC (permalink / raw
To: gentoo-commits
commit: 6b5210240228f6bbc67b3e32af1d840a8e66b645
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 02:16:54 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 02:16:54 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6b521024
qmerge: pass struct by ref instead of value
Avoids having to create a copy of a large struct whenever we make a call.
qmerge.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 2c92599..05e46b4 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -287,7 +287,7 @@ config_protected(const char *buf, int cp_argc, char **cp_argv,
}
static void
-crossmount_rm(const char *fname, const struct stat st)
+crossmount_rm(const char *fname, const struct stat * const st)
{
struct stat lst;
@@ -295,7 +295,7 @@ crossmount_rm(const char *fname, const struct stat st)
if (lstat(fname, &lst) == -1)
return;
- if (lst.st_dev != st.st_dev) {
+ if (lst.st_dev != st->st_dev) {
warn("skipping crossmount install masking: %s", fname);
return;
}
@@ -304,7 +304,7 @@ crossmount_rm(const char *fname, const struct stat st)
}
static void
-install_mask_pwd(int iargc, char **iargv, const struct stat st)
+install_mask_pwd(int iargc, char **iargv, const struct stat * const st)
{
char buf[1024];
int i;
@@ -931,7 +931,7 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
makeargv(install_mask, &iargc, &iargv);
/* XXX: Would be better if INSTALL_MASK deleted from image/
* so we didn't have to parse it while doing merge_tree() */
- install_mask_pwd(iargc, iargv, st);
+ install_mask_pwd(iargc, iargv, &st);
if (strstr(features, "noinfo")) rm_rf("./usr/share/info");
if (strstr(features, "noman" )) rm_rf("./usr/share/man");
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-29 2:25 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-29 2:25 UTC (permalink / raw
To: gentoo-commits
commit: 5afabfc0042833b548309a918ad84bbdebfefd05
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 02:13:43 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 02:13:43 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5afabfc0
qtbz2: fix leakage of dir_fd via the -d option
qtbz2.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/qtbz2.c b/qtbz2.c
index 723ad27..3c2e9f0 100644
--- a/qtbz2.c
+++ b/qtbz2.c
@@ -353,9 +353,14 @@ int qtbz2_main(int argc, char **argv)
warn("Could not decompose '%s'", tbz2);
}
+ /* We have to cleanup all resources as we're used indirectly
+ * (e.g. via qmerge).
+ */
free(heap_tbz2);
free(heap_xpak);
free(heap_tarbz2);
+ if (dir_fd != AT_FDCWD)
+ close(dir_fd);
return EXIT_SUCCESS;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-29 2:25 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-29 2:25 UTC (permalink / raw
To: gentoo-commits
commit: b9978cef4d2844c2b7ee3cdaf90477259aa758fe
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 02:15:22 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 02:15:22 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b9978cef
qpkg: fix leakage when using -P multiple times
qpkg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/qpkg.c b/qpkg.c
index c54d735..498299a 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -324,6 +324,7 @@ int qpkg_main(int argc, char **argv)
case 'p': pretend = 1; break;
case 'P':
restrict_chmod = 1;
+ free(qpkg_bindir);
qpkg_bindir = xstrdup(optarg);
if (access(qpkg_bindir, W_OK) != 0)
errp("%s", qpkg_bindir);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2016-12-29 2:33 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2016-12-29 2:33 UTC (permalink / raw
To: gentoo-commits
commit: dd9b8dfe0752fd9422782312ba85b4229ee54722
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 02:32:25 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 02:32:25 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dd9b8dfe
qtbz2: improve cli a bit
Make -t/-x options autoselect the split action.
Allow -d to be specified more than once.
When given a bad -d path, diagnose it immediately.
When we can't autodetect actions, show a specific error message.
qtbz2.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/qtbz2.c b/qtbz2.c
index 3c2e9f0..2161f99 100644
--- a/qtbz2.c
+++ b/qtbz2.c
@@ -252,13 +252,15 @@ int qtbz2_main(int argc, char **argv)
COMMON_GETOPTS_CASES(qtbz2)
case 'j': action = TBZ2_ACT_JOIN; break;
case 's': action = TBZ2_ACT_SPLIT; break;
- case 't': split_xpak = 0; break;
- case 'x': split_tarbz2 = 0; break;
+ case 't': action = TBZ2_ACT_SPLIT; split_xpak = 0; break;
+ case 'x': action = TBZ2_ACT_SPLIT; split_tarbz2 = 0; break;
case 'O': tbz2_stdout = 1; break;
case 'd':
if (dir_fd != AT_FDCWD)
- err("Only use -d once");
+ close(dir_fd);
dir_fd = open(optarg, O_RDONLY|O_CLOEXEC|O_PATH);
+ if (unlikely(dir_fd == -1))
+ errp("could not open dir: %s", optarg);
break;
}
}
@@ -279,7 +281,8 @@ int qtbz2_main(int argc, char **argv)
else if (strstr(argv[optind], ".tbz2") != NULL)
action = TBZ2_ACT_SPLIT;
else
- qtbz2_usage(EXIT_FAILURE);
+ err("%s: need to use -j or -s, or file must end in .tar.bz2 or .tbz2 to autodetect",
+ argv[optind]);
}
/* tbz2tool join .tar.bz2 .xpak .tbz2 */
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2017-02-07 3:03 Mike Frysinger
0 siblings, 0 replies; 592+ messages in thread
From: Mike Frysinger @ 2017-02-07 3:03 UTC (permalink / raw
To: gentoo-commits
commit: b7edba4e6c51901f40aefca78be5095e9dd434a4
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 7 02:58:50 2017 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 7 02:58:50 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b7edba4e
avoid assert() with active code
Since assert can be compiled out via -DNDEBUG, make sure
we don't put function calls in there we need to work.
Reported-by: Ian Coolidge <icoolidge <AT> google.com>
qmerge.c | 6 ++++--
qxpak.c | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index e84fcbb..07da4cc 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -902,11 +902,13 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
/* split the tbz and xpak data */
xasprintf(&tbz2, "%s/%s/%s.tbz2", pkgdir, pkg->CATEGORY, pkg->PF);
- assert(run_applet_l("qtbz2", "-s", tbz2, NULL) == 0);
+ if (run_applet_l("qtbz2", "-s", tbz2, NULL) != 0)
+ err("`qtbz2 -s %s` failed", tbz2);
mkdir("vdb", 0755);
sprintf(tbz2, "%s.xpak", pkg->PF);
- assert(run_applet_l("qxpak", "-d", "vdb", "-x", tbz2, NULL) == 0);
+ if (run_applet_l("qxpak", "-d", "vdb", "-x", tbz2, NULL) != 0)
+ err("`qxpak -d vdb -x %s` failed", tbz2);
free(tbz2);
diff --git a/qxpak.c b/qxpak.c
index 58b29ef..95fb779 100644
--- a/qxpak.c
+++ b/qxpak.c
@@ -154,6 +154,7 @@ xpak_list(int dir_fd, const char *file, int argc, char **argv)
{
_xpak_archive *x;
char buf[BUFSIZE];
+ size_t ret;
x = _xpak_open(file);
if (!x)
@@ -162,7 +163,8 @@ xpak_list(int dir_fd, const char *file, int argc, char **argv)
x->dir_fd = dir_fd;
x->index = buf;
assert((size_t)x->index_len < sizeof(buf));
- assert(fread(x->index, 1, x->index_len, x->fp) == (size_t)x->index_len);
+ ret = fread(x->index, 1, x->index_len, x->fp);
+ assert(ret == (size_t)x->index_len);
_xpak_walk_index(x, argc, argv, &_xpak_list_callback);
_xpak_close(x);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2017-11-27 7:55 Robin H. Johnson
0 siblings, 0 replies; 592+ messages in thread
From: Robin H. Johnson @ 2017-11-27 7:55 UTC (permalink / raw
To: gentoo-commits
commit: 237d1b34166fea2e4cb0eb28098a5b2759548b86
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 27 07:50:58 2017 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 27 07:51:07 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=237d1b34
Fix PORTAGE_QUIET quiet result.
Having PORTAGE_QUIET set caused the quiet variable to be incremented,
but it did not also setup the warnout variable.
Add a common setup function for warnout quiet, and use consistently.
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
main.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index d124695..dea03a8 100644
--- a/main.c
+++ b/main.c
@@ -78,6 +78,15 @@ no_colors(void)
setenv("NOCOLOR", "true", 1);
}
+static void
+setup_quiet(void)
+{
+ /* "e" for FD_CLOEXEC */
+ if (quiet == 0)
+ warnout = fopen("/dev/null", "we");
+ ++quiet;
+}
+
/* include common applet defs */
#include "applets.h"
@@ -102,7 +111,7 @@ no_colors(void)
#define COMMON_GETOPTS_CASES(applet) \
case 0x1: portroot = optarg; break; \
case 'v': ++verbose; break; \
- case 'q': if (quiet == 0) { warnout = fopen("/dev/null", "we"); } ++quiet; break; \
+ case 'q': setup_quiet(); break; \
case 'V': version_barf(); break; \
case 'h': applet ## _usage(EXIT_SUCCESS); break; \
case 'C': no_colors(); break; \
@@ -952,7 +961,7 @@ initialize_portage_env(void)
xarraypush_str(overlays, main_overlay);
if (getenv("PORTAGE_QUIET") != NULL)
- quiet = 1;
+ setup_quiet();
if (nocolor)
no_colors();
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2017-11-27 7:55 Robin H. Johnson
0 siblings, 0 replies; 592+ messages in thread
From: Robin H. Johnson @ 2017-11-27 7:55 UTC (permalink / raw
To: gentoo-commits
commit: 89524269b57888bb86a34c6fd7ef0422699fd30b
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 27 07:53:57 2017 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 27 07:53:57 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=89524269
Fix -Wmaybe-uninitialized.
In file included from include_applets.h:13:0,
from main.c:1485:
qgrep.c: In function ‘qgrep_main’:
qgrep.c:212:5: warning: ‘dentry’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (*cat_dirent_pt == NULL || *cat_dir_pt == NULL)
^
qgrep.c:245:17: note: ‘dentry’ was declared here
struct dirent *dentry;
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
qgrep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qgrep.c b/qgrep.c
index 9d2752e..0680035 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -242,7 +242,7 @@ int qgrep_main(int argc, char **argv)
DIR *eclass_dir = NULL;
DIR *vdb_dir = NULL;
DIR *cat_dir = NULL;
- struct dirent *dentry;
+ struct dirent *dentry = NULL;
char ebuild[_Q_PATH_MAX];
char name[_Q_PATH_MAX];
char *label;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2017-12-29 11:45 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2017-12-29 11:45 UTC (permalink / raw
To: gentoo-commits
commit: e423a9f20007493d134cae3f3bd0b665faedcf83
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 29 09:18:57 2017 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 11:16:31 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e423a9f2
q_main: implement executable path resolution for Darwin and Solaris
q.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/q.c b/q.c
index ea1fb4d..ff79643 100644
--- a/q.c
+++ b/q.c
@@ -6,6 +6,10 @@
* Copyright 2005-2014 Mike Frysinger - <vapier@gentoo.org>
*/
+#if defined(__MACH__)
+#include <libproc.h>
+#endif
+
#define Q_FLAGS "irmM:" COMMON_FLAGS
static struct option const q_long_opts[] = {
{"install", no_argument, NULL, 'i'},
@@ -115,7 +119,21 @@ int q_main(int argc, char **argv)
if (!quiet)
printf("Installing symlinks:\n");
+#if defined(__MACH__)
+ rret = proc_pidpath(getpid(), buf, sizeof(buf));
+ if (rret != -1)
+ rret = strlen(buf);
+#elif defined(__sun) && defined(__SVR4)
+ prog = getexecname();
+ rret = strlen(prog);
+ if (rret > sizeof(buf) - 1) {
+ rret = -1;
+ } else {
+ strncpy(buf, prog, rret);
+ }
+#else
rret = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
+#endif
if (rret == -1) {
warnfp("haha no symlink love for you");
return 1;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2017-12-29 11:45 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2017-12-29 11:45 UTC (permalink / raw
To: gentoo-commits
commit: 71c3f760cd6f19b89500abea08747edfa344699d
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 29 11:25:56 2017 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 11:25:56 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=71c3f760
Makefile.am: update after autogen.sh run
Makefile.am | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 7d4a301..d609b3f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,11 +96,11 @@ APPLETS += \
qxpak
EXTRA_DIST += \
applets.h \
+ config.h \
include_applets.h \
libq/atom_compare.c \
libq/atom_explode.c \
libq/basename.c \
- libq/binpackages.c \
libq/busybox.h \
libq/colors.c \
libq/compat.c \
@@ -162,6 +162,10 @@ EXTRA_DIST += \
tests/atom_explode/basic.tests \
tests/atom_explode/dotest \
tests/atom_explode/test.c \
+ tests/copy_file/.gitignore \
+ tests/copy_file/Makefile \
+ tests/copy_file/dotest \
+ tests/copy_file/test.c \
tests/init.sh \
tests/install/.gitignore \
tests/install/Makefile \
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2017-12-29 11:45 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2017-12-29 11:45 UTC (permalink / raw
To: gentoo-commits
commit: 145d84eaf87d95cb0ab581c573aff941fa4fe404
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 29 11:07:26 2017 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 11:16:41 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=145d84ea
initialize_portage_env: fix PORTAGE_CONFIGROOT usage
All things on top of PORTAGE_CONFIGROOT need to be relative, so don't
add EPREFIX on top of it.
main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/main.c b/main.c
index dea03a8..b118ab8 100644
--- a/main.c
+++ b/main.c
@@ -844,16 +844,16 @@ initialize_portage_env(void)
/* figure out where to find our config files */
const char *configroot = getenv("PORTAGE_CONFIGROOT");
if (!configroot)
- configroot = "/";
+ configroot = CONFIG_EPREFIX "/";
/* walk all the stacked profiles */
- read_portage_profile(configroot, CONFIG_EPREFIX "etc/make.profile", vars_to_read);
- read_portage_profile(configroot, CONFIG_EPREFIX "etc/portage/make.profile", vars_to_read);
+ read_portage_profile(configroot, "/etc/make.profile", vars_to_read);
+ read_portage_profile(configroot, "/etc/portage/make.profile", vars_to_read);
/* now read all the config files */
read_portage_env_file("", CONFIG_EPREFIX "usr/share/portage/config/make.globals", vars_to_read);
- read_portage_env_file(configroot, CONFIG_EPREFIX "etc/make.conf", vars_to_read);
- read_portage_env_file(configroot, CONFIG_EPREFIX "etc/portage/make.conf", vars_to_read);
+ read_portage_env_file(configroot, "/etc/make.conf", vars_to_read);
+ read_portage_env_file(configroot, "/etc/portage/make.conf", vars_to_read);
/* finally, check the env */
for (i = 0; vars_to_read[i].name; ++i) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-01-08 12:33 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-01-08 12:33 UTC (permalink / raw
To: gentoo-commits
commit: 604df91aa544b65a6630b281b8a91d811c24e3f6
Author: Matthew White <mehw.is.me <AT> inventati <DOT> org>
AuthorDate: Sun Jan 7 06:10:01 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Jan 8 12:32:27 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=604df91a
read_repos_conf: reject ~ postfixed files (aka backup files)
* main.c (read_repos_conf): Exclude backup files (aka files with ~ as
postfix) from processing when reading the repos_conf directory.
The old behaviour was to process any file found in repos_conf (i.e.
/etc/portage/repos.conf/*), except those beginning with '.'. This
meant that '.', '..', and '.file' are rejected, but 'file.conf~' is
accepted. Since 'file.conf~' is a backup file, by default it should
rather not be processed.
Bug: https://bugs.gentoo.org/643820
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/main.c b/main.c
index b118ab8..b11fe83 100644
--- a/main.c
+++ b/main.c
@@ -513,6 +513,10 @@ read_repos_conf(const char *configroot, const char *repos_conf)
if (name[0] == '.')
continue;
+ /* Exclude backup files (aka files with ~ as postfix). */
+ if (name[0] != '\0' && name[strlen(name) - 1] == '~')
+ continue;
+
#ifdef DT_UNKNOWN
if (confs[i]->d_type != DT_UNKNOWN &&
confs[i]->d_type != DT_REG &&
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-01-08 12:33 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-01-08 12:33 UTC (permalink / raw
To: gentoo-commits
commit: 73de0b4c50f9b36a01d81fd57211ff33b6df2c57
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 29 11:57:38 2017 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 11:57:38 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=73de0b4c
README: mention the configure alternative
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3889ee2..fb8d800 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,8 @@ of information. The focus is on size and speed, so everything is in C.
## Building
-Just run `make`. This should work on any recent POSIX compliant system.
+Just run `make`. This should work on any recent Linux system.
+Alternatively, run `configure` followed by `make`.
## Helping out
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 9:37 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 9:37 UTC (permalink / raw
To: gentoo-commits
commit: 18966cfe95666636562a1b06b800b711a3e4ab9e
Author: Joakim Tjernlund <joakim.tjernlund <AT> infinera <DOT> com>
AuthorDate: Thu Mar 8 21:53:50 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 09:19:06 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=18966cfe
ED/EROOT needs '/' appended
Some pkgs does needs it, dev-lang/python-exec is one.
Signed-off-by: Joakim Tjernlund <joakim.tjernlund <AT> infinera.com>
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
qmerge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 07da4cc..ff55a0c 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -466,9 +466,9 @@ pkg_run_func_at(int dirfd, const char *vdb_path, const char *phases, const char
"FILESDIR=/.does/not/exist/anywhere\n"
"MERGE_TYPE=binary\n"
"ROOT='%4$s'\n"
- "EROOT=\"${EPREFIX%%/}/${ROOT#/}\"\n"
+ "EROOT=\"${EPREFIX%%/}/${ROOT#/}/\"\n"
"D=\"%5$s\"\n"
- "ED=\"${EPREFIX%%/}/${D#/}\"\n"
+ "ED=\"${EPREFIX%%/}/${D#/}/\"\n"
"T=\"%6$s\"\n"
/* Finally run the func */
"%7$s%2$s\n"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 11:08 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 11:08 UTC (permalink / raw
To: gentoo-commits
commit: eedb0ea266b78efd84bc34bc2c6602fb713ba590
Author: Joakim Tjernlund <joakim.tjernlund <AT> infinera <DOT> com>
AuthorDate: Thu Mar 8 21:53:51 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 11:01:55 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=eedb0ea2
qmerge: Only fetch Packages if -f/-F is specified
Signed-off-by: Joakim Tjernlund <joakim.tjernlund <AT> infinera.com>
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
qmerge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index ff55a0c..ebd4960 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -190,8 +190,8 @@ qmerge_initialize(void)
mkdir_p(buf, 0755);
xchdir(buf);
- if (force_download != 2) {
- if (force_download)
+ if (force_download) {
+ if (force_download == 2)
unlink(Packages);
if (access(Packages, R_OK) != 0)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 11:29 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 11:29 UTC (permalink / raw
To: gentoo-commits
commit: 7fa57849a692a2900417ed13f67b6c6385a2932e
Author: Joakim Tjernlund <joakim.tjernlund <AT> infinera <DOT> com>
AuthorDate: Thu Mar 8 21:53:52 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 11:18:49 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7fa57849
qmerge: Choose SLOTed packages correctly
Ex. packages are readeline, ncurses which can be installed
in several SLOTs
Signed-off-by: Joakim Tjernlund <joakim.tjernlund <AT> infinera.com>
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
qmerge.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index ebd4960..1f75acc 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -203,6 +203,7 @@ qmerge_initialize(void)
struct qmerge_bv_state {
const char *catname;
const char *pkgname;
+ const char *slot;
char buf[4096];
char *retbuf;
};
@@ -219,19 +220,20 @@ qmerge_best_version_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
{
struct qmerge_bv_state *state = priv;
if (qlist_match(pkg_ctx, state->buf, NULL, true))
- snprintf(state->retbuf, sizeof(state->buf), "%s/%s",
- pkg_ctx->cat_ctx->name, pkg_ctx->name);
+ snprintf(state->retbuf, sizeof(state->buf), "%s/%s:%s",
+ pkg_ctx->cat_ctx->name, pkg_ctx->name, state->slot);
return 0;
}
static char *
-best_version(const char *catname, const char *pkgname)
+best_version(const char *catname, const char *pkgname, const char *slot)
{
static int vdb_check = 1;
static char retbuf[4096];
struct qmerge_bv_state state = {
.catname = catname,
.pkgname = pkgname,
+ .slot = slot,
.retbuf = retbuf,
};
@@ -252,8 +254,8 @@ best_version(const char *catname, const char *pkgname)
}
retbuf[0] = '\0';
- snprintf(state.buf, sizeof(state.buf), "%s%s%s",
- catname ? : "", catname ? "/" : "", pkgname);
+ snprintf(state.buf, sizeof(state.buf), "%s%s%s:%s",
+ catname ? : "", catname ? "/" : "", pkgname, slot);
q_vdb_foreach_pkg(qmerge_best_version_cb, &state, qmerge_filter_cat);
done:
@@ -359,7 +361,8 @@ qprint_tree_node(int level, const depend_atom *atom, const struct pkg_t *pkg)
if (!pretend)
return 0;
- p = best_version(pkg->CATEGORY, atom->PN);
+ p = best_version(pkg->CATEGORY, atom->PN, pkg->SLOT);
+
if (strlen(p) < 1) {
c = 'N';
snprintf(buf, sizeof(buf), "%sN%s", GREEN, NORM);
@@ -844,7 +847,8 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
ratom = atom_explode(buf);
- p = best_version(subpkg->CATEGORY, subpkg->PF);
+ p = best_version(subpkg->CATEGORY, subpkg->PF, subpkg->SLOT);
+
/* we dont want to remerge equal versions here */
IF_DEBUG(fprintf(stderr, "+Installed: %s\n", p));
if (strlen(p) < 1)
@@ -1373,7 +1377,7 @@ print_Pkg(int full, const depend_atom *atom, const struct pkg_t *pkg)
if (strcmp(pkg->REPO, "gentoo") != 0)
printf(" %sRepo%s:%s %s\n", DKGREEN, YELLOW, NORM, pkg->REPO);
- if ((p = best_version(pkg->CATEGORY, atom->PN)) != NULL) {
+ if ((p = best_version(pkg->CATEGORY, atom->PN, pkg->SLOT)) != NULL) {
if (*p) {
int ret;
const char *icolor = RED;
@@ -1475,6 +1479,7 @@ grab_binpkg_info(const char *name)
static char best_match[sizeof(Pkg.PF)+2+sizeof(Pkg.CATEGORY)];
best_match[0] = 0;
+ strcpy(pkg->SLOT,"0");
fp = open_binpkg_index();
@@ -1511,6 +1516,7 @@ grab_binpkg_info(const char *name)
atom_implode(atom);
}
memset(pkg, 0, sizeof(struct pkg_t));
+ strcpy(pkg->SLOT,"0");
}
continue;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 13:17 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 13:17 UTC (permalink / raw
To: gentoo-commits
commit: bf111d7d5464f8a6b3a251d3d12fe9e39357bc6e
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 23 13:16:31 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 13:16:31 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=bf111d7d
fix signedness warnings
main.c | 8 +++++---
qcheck.c | 2 +-
qdepends.c | 2 +-
qgrep.c | 5 +++--
qlop.c | 7 ++++---
qsearch.c | 2 +-
qsize.c | 2 +-
qxpak.c | 8 +++++---
8 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/main.c b/main.c
index b11fe83..44226db 100644
--- a/main.c
+++ b/main.c
@@ -1420,9 +1420,11 @@ get_vdb_atoms(int fullcpv)
if ((dfd = scandirat(ctx->vdb_fd, cat[j]->d_name, &pf, q_vdb_filter_pkg, alphasort)) < 0)
continue;
for (i = 0; i < dfd; i++) {
- int blen = snprintf(buf, sizeof(buf), "%s/%s/SLOT", cat[j]->d_name, pf[i]->d_name);
- if (blen >= sizeof(buf)) {
- warnf("unable to parse long package: %s/%s", cat[j]->d_name, pf[i]->d_name);
+ int blen = snprintf(buf, sizeof(buf), "%s/%s/SLOT",
+ cat[j]->d_name, pf[i]->d_name);
+ if (blen < 0 || (size_t)blen >= sizeof(buf)) {
+ warnf("unable to parse long package: %s/%s",
+ cat[j]->d_name, pf[i]->d_name);
continue;
}
diff --git a/qcheck.c b/qcheck.c
index 26b820e..66589a3 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -375,7 +375,7 @@ int qcheck_main(int argc, char **argv)
argc -= optind;
argv += optind;
- for (i = 0; i < argc; ++i) {
+ for (i = 0; i < (size_t)argc; ++i) {
atom = atom_explode(argv[i]);
if (!atom)
warn("invalid atom: %s", argv[i]);
diff --git a/qdepends.c b/qdepends.c
index a614704..e8b2190 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -579,7 +579,7 @@ int qdepends_main(int argc, char **argv)
else {
cb = qdepends_main_vdb_cb;
- for (i = 0; i < argc; ++i) {
+ for (i = 0; i < (size_t)argc; ++i) {
atom = atom_explode(argv[i]);
if (!atom)
warn("invalid atom: %s", argv[i]);
diff --git a/qgrep.c b/qgrep.c
index 0680035..fe53ea2 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -153,9 +153,10 @@ qgrep_print_line(qgrep_buf_t *current, const char *label,
int regexec_flags = 0;
while ((*p != '\0') && !regexec(preg, p, 1, &match, regexec_flags)) {
if (match.rm_so > 0)
- printf("%.*s", match.rm_so, p);
+ printf("%.*s", (int)match.rm_so, p);
if (match.rm_eo > match.rm_so) {
- printf("%s%.*s%s", RED, match.rm_eo - match.rm_so, p + match.rm_so, NORM);
+ printf("%s%.*s%s", RED, (int)(match.rm_eo - match.rm_so),
+ p + match.rm_so, NORM);
p += match.rm_eo;
} else {
p += match.rm_eo;
diff --git a/qlop.c b/qlop.c
index 5be2ddd..410a94b 100644
--- a/qlop.c
+++ b/qlop.c
@@ -580,7 +580,8 @@ void show_current_emerge(void)
raip = realloc(ip, sizeof(struct kinfo_proc) * size);
if (raip == NULL) {
free(ip);
- warnp("Could not extend allocated block to %d bytes for process information",
+ warnp("Could not extend allocated block to "
+ "%zd bytes for process information",
sizeof(struct kinfo_proc) * size);
return;
}
@@ -798,7 +799,7 @@ int qlop_main(int argc, char **argv)
argc -= optind;
argv += optind;
- for (i = 0; i < argc; ++i) {
+ for (i = 0; i < (size_t)argc; ++i) {
atom = atom_explode(argv[i]);
if (!atom)
warn("invalid atom: %s", argv[i]);
@@ -820,7 +821,7 @@ int qlop_main(int argc, char **argv)
show_sync_history(logfile, start_time, end_time);
if (do_time) {
- for (i = 0; i < argc; ++i)
+ for (i = 0; i < (size_t)argc; ++i)
show_merge_times(argv[i], logfile, average, do_human_readable,
start_time, end_time);
}
diff --git a/qsearch.c b/qsearch.c
index c2b2ebe..a620f95 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -104,7 +104,7 @@ qsearch_ebuild_ebuild(int overlay_fd, const char *ebuild, const char *search_me,
int linelen;
size_t buflen;
while ((linelen = getline(&buf, &buflen, ebuildfp)) >= 0) {
- if (linelen <= search_len)
+ if ((size_t)linelen <= search_len)
continue;
if (strncmp(buf, search_var, search_len) != 0)
continue;
diff --git a/qsize.c b/qsize.c
index b92f533..acf74bf 100644
--- a/qsize.c
+++ b/qsize.c
@@ -176,7 +176,7 @@ int qsize_main(int argc, char **argv)
argc -= optind;
argv += optind;
- for (i = 0; i < argc; ++i) {
+ for (i = 0; i < (size_t)argc; ++i) {
atom = atom_explode(argv[i]);
if (!atom)
warn("invalid atom: %s", argv[i]);
diff --git a/qxpak.c b/qxpak.c
index 95fb779..ada9767 100644
--- a/qxpak.c
+++ b/qxpak.c
@@ -341,9 +341,11 @@ xpak_create(int dir_fd, const char *file, int argc, char **argv)
if ((numfiles = scandir(argv[i], &dir, filter_hidden, alphasort)) < 0)
warn("Directory '%s' is empty; skipping", argv[i]);
for (fidx = 0; fidx < numfiles; ++fidx) {
- int ret = snprintf(path, sizeof(path), "%s/%s", argv[i], dir[fidx]->d_name);
- if (ret >= sizeof(path)) {
- warn("skipping path too long: %s/%s", argv[i], dir[fidx]->d_name);
+ int ret = snprintf(path, sizeof(path), "%s/%s",
+ argv[i], dir[fidx]->d_name);
+ if (ret < 0 || (size_t)ret >= sizeof(path)) {
+ warn("skipping path too long: %s/%s",
+ argv[i], dir[fidx]->d_name);
continue;
}
if (stat(path, &st) < 0) {
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 15:27 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 15:27 UTC (permalink / raw
To: gentoo-commits
commit: 967b86446d70038ccdf3d014d5554be41d981edc
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 23 15:07:55 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 15:07:55 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=967b8644
qdepends_vdb_deep_cb: show atom that matched
This extracts the atom that matched the regular expression.
qdepends.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/qdepends.c b/qdepends.c
index e8b2190..117ca71 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -479,6 +479,9 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
static char *depend, *use;
static size_t depend_len, use_len;
dep_node *dep_tree;
+ int ret;
+ regex_t preg;
+ regmatch_t match;
if (!q_vdb_pkg_eat(pkg_ctx, state->depend_file, &depend, &depend_len))
return 0;
@@ -506,7 +509,14 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
dep_prune_use(dep_tree, use);
ptr = dep_flatten_tree(dep_tree);
- if (ptr && rematch(state->query, ptr, REG_EXTENDED) == 0) {
+
+ ret = -2;
+ if (ptr && wregcomp(&preg, state->query, REG_EXTENDED) == 0)
+ ret = regexec(&preg, ptr, 1, &match, 0);
+ if (ret > -2)
+ regfree(&preg);
+
+ if (ptr && ret == 0) {
if (qdep_name_only) {
depend_atom *atom = NULL;
snprintf(buf, sizeof(buf), "%s/%s", catname, pkgname);
@@ -517,8 +527,16 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
} else {
printf("%s%s/%s%s%s%c", BOLD, catname, BLUE, pkgname, NORM, verbose ? ':' : '\n');
}
- if (verbose)
- printf(" %s\n", ptr);
+ if (verbose) {
+ /* find the boundaries for this atom */
+ while (match.rm_so > 0 && !isspace(ptr[match.rm_so - 1]))
+ match.rm_so--;
+ while (ptr[match.rm_eo] != '\0' && !isspace(ptr[match.rm_eo]))
+ match.rm_eo++;
+ printf(" %.*s\n",
+ (int)(match.rm_eo - match.rm_so),
+ ptr + match.rm_so);
+ }
}
dep_burn_tree(dep_tree);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 15:27 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 15:27 UTC (permalink / raw
To: gentoo-commits
commit: be23ddefad2d4843dc5fd9db5cd0d2f840ce0fc0
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 23 15:27:06 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 15:27:06 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=be23ddef
version_barf: show EPREFIX configured with, if present
main.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 44226db..ec903fe 100644
--- a/main.c
+++ b/main.c
@@ -189,15 +189,21 @@ usage(int status, const char *flags, struct option const opts[],
static void
version_barf(void)
{
+ const char *eprefixid = "";
+
#ifndef VERSION
# define VERSION "git"
#endif
#ifndef VCSID
# define VCSID "<unknown>"
#endif
+
+ if (strlen(CONFIG_EPREFIX) > 1)
+ eprefixid = "configured for " CONFIG_EPREFIX "\n";
printf("portage-utils-%s: %s\n"
+ "%s"
"%s written for Gentoo by <solar and vapier @ gentoo.org>\n",
- VERSION, VCSID, argv0);
+ VERSION, VCSID, eprefixid, argv0);
exit(EXIT_SUCCESS);
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 20:17 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 20:17 UTC (permalink / raw
To: gentoo-commits
commit: ca282deea01374d6f01746432ce3f450bcf6ac9f
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 23 20:16:58 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 20:16:58 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ca282dee
getopt: add workaround for Solaris to silence compiler
porting.h | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/porting.h b/porting.h
index 206c6e3..b0225df 100644
--- a/porting.h
+++ b/porting.h
@@ -32,7 +32,6 @@
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
-#include <getopt.h>
#include <glob.h>
#include <inttypes.h>
#include <libgen.h>
@@ -52,6 +51,24 @@
#include <iniparser.h>
+#if defined(__sun) && defined(__SVR4)
+/* workaround non-const defined name in option struct, such that we
+ * don't get a zillion of warnings */
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+struct option {
+ const char *name;
+ int has_arg;
+ int *flag;
+ int val;
+};
+extern int getopt_long(int, char * const *, const char *,
+ const struct option *, int *);
+#else
+#include <getopt.h>
+#endif
+
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr)))
#ifndef BUFSIZE
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-23 20:17 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-23 20:17 UTC (permalink / raw
To: gentoo-commits
commit: bbf9f4b708e1368a86c7978681e4a82604587fbc
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 23 20:11:35 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 23 20:11:35 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=bbf9f4b7
fix some more signedness problems
q.c | 2 +-
qcheck.c | 4 ++--
qdepends.c | 4 ++--
qlop.c | 5 +++--
qsize.c | 4 ++--
5 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/q.c b/q.c
index ff79643..9c06e2a 100644
--- a/q.c
+++ b/q.c
@@ -126,7 +126,7 @@ int q_main(int argc, char **argv)
#elif defined(__sun) && defined(__SVR4)
prog = getexecname();
rret = strlen(prog);
- if (rret > sizeof(buf) - 1) {
+ if ((size_t)rret > sizeof(buf) - 1) {
rret = -1;
} else {
strncpy(buf, prog, rret);
diff --git a/qcheck.c b/qcheck.c
index 66589a3..c6e1ccb 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -354,8 +354,8 @@ int qcheck_main(int argc, char **argv)
.undo_prelink = false,
};
- while ((i = GETOPT_LONG(QCHECK, qcheck, "")) != -1) {
- switch (i) {
+ while ((ret = GETOPT_LONG(QCHECK, qcheck, "")) != -1) {
+ switch (ret) {
COMMON_GETOPTS_CASES(qcheck)
case 's': {
regex_t regex;
diff --git a/qdepends.c b/qdepends.c
index 117ca71..d5a8ef5 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -560,8 +560,8 @@ int qdepends_main(int argc, char **argv)
depend_file = depend_files[0];
- while ((i = GETOPT_LONG(QDEPENDS, qdepends, "")) != -1) {
- switch (i) {
+ while ((ret = GETOPT_LONG(QDEPENDS, qdepends, "")) != -1) {
+ switch (ret) {
COMMON_GETOPTS_CASES(qdepends)
case 'd': depend_file = depend_files[0]; break;
diff --git a/qlop.c b/qlop.c
index 410a94b..33e8d37 100644
--- a/qlop.c
+++ b/qlop.c
@@ -753,6 +753,7 @@ parse_date(const char *sdate, time_t *t)
int qlop_main(int argc, char **argv)
{
size_t i;
+ int ret;
int average = 1;
time_t start_time, end_time;
char do_time, do_list, do_unlist, do_sync, do_current, do_human_readable = 0;
@@ -765,8 +766,8 @@ int qlop_main(int argc, char **argv)
end_time = LONG_MAX;
do_time = do_list = do_unlist = do_sync = do_current = 0;
- while ((i = GETOPT_LONG(QLOP, qlop, "")) != -1) {
- switch (i) {
+ while ((ret = GETOPT_LONG(QLOP, qlop, "")) != -1) {
+ switch (ret) {
COMMON_GETOPTS_CASES(qlop)
case 't': do_time = 1; break;
diff --git a/qsize.c b/qsize.c
index acf74bf..9cd66cf 100644
--- a/qsize.c
+++ b/qsize.c
@@ -156,8 +156,8 @@ int qsize_main(int argc, char **argv)
.num_all_ignored = 0,
};
- while ((i = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
- switch (i) {
+ while ((ret = GETOPT_LONG(QSIZE, qsize, "")) != -1) {
+ switch (ret) {
COMMON_GETOPTS_CASES(qsize)
case 'f': state.fs_size = 1; break;
case 's': state.summary = 1; break;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-25 14:00 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-25 14:00 UTC (permalink / raw
To: gentoo-commits
commit: 3d00cad113975b02ece79892eb5f752d818aaa73
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 25 13:57:56 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Mar 25 13:57:56 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3d00cad1
qdepends_vdb_deep_cb: use atom matching when possible, bug #608960
When the argument is an atom-parsable thing, match whatever we find in
the vdb as atom, such that version and range can be taken into account.
Bug: https://bugs.gentoo.org/608960
qdepends.c | 118 +++++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 95 insertions(+), 23 deletions(-)
diff --git a/qdepends.c b/qdepends.c
index d5a8ef5..cd5e851 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -475,13 +475,17 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
const char *pkgname = pkg_ctx->name;
size_t len;
char *ptr;
- char buf[_Q_PATH_MAX];
+ char qbuf[_Q_PATH_MAX];
static char *depend, *use;
static size_t depend_len, use_len;
dep_node *dep_tree;
int ret;
regex_t preg;
regmatch_t match;
+ depend_atom *aq;
+ depend_atom *as;
+ depend_atom *ac;
+ char firstmatch = 0;
if (!q_vdb_pkg_eat(pkg_ctx, state->depend_file, &depend, &depend_len))
return 0;
@@ -508,36 +512,104 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
dep_prune_use(dep_tree, use);
- ptr = dep_flatten_tree(dep_tree);
+ if ((ptr = dep_flatten_tree(dep_tree)) == NULL) {
+ dep_burn_tree(dep_tree);
+ return 1;
+ }
- ret = -2;
- if (ptr && wregcomp(&preg, state->query, REG_EXTENDED) == 0)
- ret = regexec(&preg, ptr, 1, &match, 0);
- if (ret > -2)
- regfree(&preg);
+ snprintf(qbuf, sizeof(qbuf), "%s/%s", catname, pkgname);
+ as = atom_explode(qbuf);
+ if (!as) {
+ dep_burn_tree(dep_tree);
+ return 1;
+ }
- if (ptr && ret == 0) {
- if (qdep_name_only) {
- depend_atom *atom = NULL;
- snprintf(buf, sizeof(buf), "%s/%s", catname, pkgname);
- if ((atom = atom_explode(buf)) != NULL) {
- printf("%s%s/%s%s%s%c", BOLD, catname, BLUE, atom->PN, NORM, verbose ? ':' : '\n');
- atom_implode(atom);
- }
+ aq = atom_explode(state->query);
+ if (!aq) {
+ /* "fall" back to old behaviour of just performing an extended
+ * regular expression match */
+ if (wregcomp(&preg, state->query, REG_EXTENDED) != 0) {
+ dep_burn_tree(dep_tree);
+ return 1;
+ }
+ }
+
+ match.rm_eo = 0;
+ firstmatch = 1;
+ do { /* find all matches */
+ if (!aq) {
+ ret = regexec(&preg, ptr + match.rm_eo, 1, &match, 0);
} else {
- printf("%s%s/%s%s%s%c", BOLD, catname, BLUE, pkgname, NORM, verbose ? ':' : '\n');
+ char *loc;
+ ret = -1;
+ snprintf(qbuf, sizeof(qbuf), "%s%s%s",
+ aq->CATEGORY ? aq->CATEGORY : "",
+ aq->CATEGORY ? "/" : "",
+ aq->PN);
+ if ((loc = strstr(ptr + match.rm_eo, qbuf)) != NULL) {
+ ret = 0;
+ match.rm_so = loc - ptr;
+ match.rm_eo = match.rm_so + strlen(qbuf);
+ }
}
- if (verbose) {
- /* find the boundaries for this atom */
- while (match.rm_so > 0 && !isspace(ptr[match.rm_so - 1]))
- match.rm_so--;
- while (ptr[match.rm_eo] != '\0' && !isspace(ptr[match.rm_eo]))
- match.rm_eo++;
- printf(" %.*s\n",
+ if (ret != 0)
+ break;
+
+ /* find the boundaries for matched atom */
+ while (match.rm_so > 0 && !isspace(ptr[match.rm_so - 1]))
+ match.rm_so--;
+ while (ptr[match.rm_eo] != '\0' && !isspace(ptr[match.rm_eo]))
+ match.rm_eo++;
+
+ snprintf(qbuf, sizeof(qbuf), "%.*s",
(int)(match.rm_eo - match.rm_so),
ptr + match.rm_so);
+ ac = atom_explode(qbuf);
+
+ ret = atom_compare(ac, aq);
+ if (ret != EQUAL) {
+ atom_implode(ac);
+ break;
+ }
+
+ if (firstmatch == 1) {
+ firstmatch = 0;
+ printf("%s%s/%s%s%s%c", BOLD, catname, BLUE,
+ qdep_name_only ? as->PN : pkgname, NORM,
+ verbose ? ':' : '\n');
+ }
+
+ if (verbose) {
+ printf(" ");
+ if (ac) {
+ printf("%s", atom_op_str[ac->pfx_op]);
+ if (ac->CATEGORY)
+ printf("%s/", ac->CATEGORY);
+ printf("%s", ac->P);
+ if (ac->PR_int)
+ printf("-r%i", ac->PR_int);
+ printf("%s", atom_op_str[ac->sfx_op]);
+ if (ac->SLOT)
+ printf(":%s", ac->SLOT);
+ atom_implode(ac);
+ } else {
+ printf("%s", qbuf);
+ }
+ } else {
+ /* if not verbose, we don't care about any extra matches */
+ atom_implode(ac);
+ break;
}
+ } while (1);
+ if (verbose && firstmatch == 0)
+ printf("\n");
+
+ if (!aq) {
+ regfree(&preg);
+ } else {
+ atom_implode(aq);
}
+ atom_implode(as);
dep_burn_tree(dep_tree);
return 1;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-26 19:08 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-26 19:08 UTC (permalink / raw
To: gentoo-commits
commit: e8c0e327e7e1ec83a63c2c7a6b44567773ec7d94
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 26 19:06:19 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Mar 26 19:06:19 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e8c0e327
qlist_cb: exclude /usr/src/debug by default too
This is an somewhat alternative take to the patch by
Niklas Haas <bgo <AT> nand.wakku.to>.
Also exclude /usr/src/debug by default, because it contains a lot of
clutter.
Bug: https://bugs.gentoo.org/646310
qlist.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/qlist.c b/qlist.c
index cda4ca7..1f8757c 100644
--- a/qlist.c
+++ b/qlist.c
@@ -335,8 +335,9 @@ qlist_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
continue;
if (!state->show_dbg) {
- if (!strncmp(e->name, "/usr/lib/debug", 14) &&
- (e->name[14] == '/' || e->name[14] == '\0'))
+ if ((strncmp(e->name, "/usr/lib/debug", 14) == 0
+ || strncmp(e->name, "/usr/src/debug", 14) == 0)
+ && (e->name[14] == '/' || e->name[14] == '\0'))
continue;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-30 5:56 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-30 5:56 UTC (permalink / raw
To: gentoo-commits
commit: aec94e4d236fb91b04d21bde5f622c2af39ddee8
Author: Matija Skala <mskala <AT> gmx <DOT> com>
AuthorDate: Thu Aug 17 16:03:14 2017 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Mar 29 18:17:33 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=aec94e4d
fix compile on hurd
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
qlop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/qlop.c b/qlop.c
index babcc74..c01b3be 100644
--- a/qlop.c
+++ b/qlop.c
@@ -382,6 +382,8 @@ show_sync_history(const char *logfile, time_t start_time, time_t end_time)
static void show_current_emerge(void);
#ifdef __linux__
# include <asm/param.h>
+#endif
+#if defined __linux__ || defined __GNU__
# include <elf.h>
static unsigned long hz = 0;
static void init_hz(void)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-30 5:56 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-30 5:56 UTC (permalink / raw
To: gentoo-commits
commit: 98cf71419ec081e02677f314f26c6b3d5aaf7ad7
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 29 18:14:04 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Mar 29 18:14:04 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=98cf7141
qlop: break some long lines, no code changes
qlop.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/qlop.c b/qlop.c
index 33e8d37..babcc74 100644
--- a/qlop.c
+++ b/qlop.c
@@ -448,7 +448,9 @@ void show_current_emerge(void)
if (!eat_file(path, &cmdline, &cmdline_len))
continue;
- if (cmdline[0] == '[' && (p = strchr(cmdline, ']')) != NULL && strstr(cmdline, "sandbox") != NULL) {
+ if (cmdline[0] == '[' && (p = strchr(cmdline, ']')) != NULL &&
+ strstr(cmdline, "sandbox") != NULL)
+ {
*p = '\0';
p = cmdline + 1;
q = p + strlen(p) + 1;
@@ -511,7 +513,9 @@ void show_current_emerge(void)
char *p, *q;
time_t start_date = 0;
- if (! (kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open"))) {
+ if (! (kd = kvm_open("/dev/null", "/dev/null", "/dev/null",
+ O_RDONLY, "kvm_open")))
+ {
warnp("Could not open kvm: %s", kvm_geterr(kd));
return;
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-31 6:54 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-31 6:54 UTC (permalink / raw
To: gentoo-commits
commit: b05c690acf8e97890471f4ef45eee821699f13b3
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 20:13:28 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 20:16:41 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b05c690a
initialize_portage_env: move debug var printing after repos.conf
in particular PORTDIR may get set, so ensure we print the value that's
going to be used
main.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/main.c b/main.c
index 7c55358..8000540 100644
--- a/main.c
+++ b/main.c
@@ -943,18 +943,6 @@ initialize_portage_env(void)
}
}
- if (getenv("DEBUG")) {
- for (i = 0; vars_to_read[i].name; ++i) {
- var = &vars_to_read[i];
- fprintf(stderr, "%s = ", var->name);
- switch (var->type) {
- case _Q_BOOL: fprintf(stderr, "%i\n", *var->value.b); break;
- case _Q_STR:
- case _Q_ISTR: fprintf(stderr, "%s\n", *var->value.s); break;
- }
- }
- }
-
/* Make sure ROOT always ends in a slash */
var = &vars_to_read[0];
if ((*var->value.s)[var->value_len - 1] != '/') {
@@ -970,6 +958,18 @@ initialize_portage_env(void)
if (array_cnt(overlays) == 0)
xarraypush_str(overlays, main_overlay);
+ if (getenv("DEBUG")) {
+ for (i = 0; vars_to_read[i].name; ++i) {
+ var = &vars_to_read[i];
+ fprintf(stderr, "%s = ", var->name);
+ switch (var->type) {
+ case _Q_BOOL: fprintf(stderr, "%i\n", *var->value.b); break;
+ case _Q_STR:
+ case _Q_ISTR: fprintf(stderr, "%s\n", *var->value.s); break;
+ }
+ }
+ }
+
if (getenv("PORTAGE_QUIET") != NULL)
setup_quiet();
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-31 6:54 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-31 6:54 UTC (permalink / raw
To: gentoo-commits
commit: 553d512900e5d83ec643475344f57118d8b4ed3f
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 31 06:52:40 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Mar 31 06:52:40 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=553d5129
read_portage_env_file: support reading directories, bug #558306
In particular /etc/portage/make.conf can be a directory. If it is,
process it recursively in sorted order.
Bug: https://bugs.gentoo.org/558306
main.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 8000540..85740b8 100644
--- a/main.c
+++ b/main.c
@@ -639,12 +639,15 @@ set_portage_env_var(env_vars *var, const char *value)
}
}
-/* Helper to read a portage env file (e.g. make.conf) */
+/* Helper to read a portage env file (e.g. make.conf), or recursively if
+ * it points to a directory */
static void
read_portage_env_file(const char *configroot, const char *file, env_vars vars[])
{
size_t i, buflen, line, configroot_len, file_len;
FILE *fp;
+ struct dirent **dents;
+ int dentslen;
char *buf, *s, *p;
if (getenv("DEBUG"))
@@ -659,6 +662,23 @@ read_portage_env_file(const char *configroot, const char *file, env_vars vars[])
memcpy(buf + configroot_len, file, file_len);
buf[buflen - 1] = '\0';
+ if ((dentslen = scandir(buf, &dents, NULL, alphasort)) > 0) {
+ int di;
+ struct dirent *d;
+ char npath[_Q_PATH_MAX];
+
+ /* recurse through all files */
+ for (di = 0; di < dentslen; di++) {
+ d = dents[di];
+ if (d->d_name[0] == '.' || d->d_name[0] == '~')
+ continue;
+ snprintf(npath, sizeof(npath), "%s/%s", file, d->d_name);
+ read_portage_env_file(configroot, npath, vars);
+ }
+ scandir_free(dents, dentslen);
+ goto done;
+ }
+
fp = fopen(buf, "r");
if (fp == NULL)
goto done;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-31 6:54 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-31 6:54 UTC (permalink / raw
To: gentoo-commits
commit: 32d16662a911ff06991a3b0bfb2c833df365457a
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 20:11:17 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 20:16:40 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=32d16662
read_portage_env_file: make debug print the real location
main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 6ed2566..7c55358 100644
--- a/main.c
+++ b/main.c
@@ -648,7 +648,7 @@ read_portage_env_file(const char *configroot, const char *file, env_vars vars[])
char *buf, *s, *p;
if (getenv("DEBUG"))
- fprintf(stderr, "profile %s\n", file);
+ fprintf(stderr, "profile %s/%s\n", configroot, file);
configroot_len = strlen(configroot);
file_len = strlen(file);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-03-31 6:54 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-03-31 6:54 UTC (permalink / raw
To: gentoo-commits
commit: 16e36c085ce6e9a72690f518baf62852b9196ee7
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 20:08:34 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 20:16:38 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=16e36c08
initialize_portage_env: avoid double prefix for repos.conf location
main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.c b/main.c
index ec903fe..6ed2566 100644
--- a/main.c
+++ b/main.c
@@ -964,7 +964,7 @@ initialize_portage_env(void)
}
char *orig_main_overlay = main_overlay;
- read_repos_conf(configroot, CONFIG_EPREFIX "etc/portage/repos.conf");
+ read_repos_conf(configroot, "/etc/portage/repos.conf");
if (orig_main_overlay != main_overlay)
free(orig_main_overlay);
if (array_cnt(overlays) == 0)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-01 10:22 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-01 10:22 UTC (permalink / raw
To: gentoo-commits
commit: 69286497c1b4c8559c638228bb2c9f4359a9c94d
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 1 10:21:59 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Apr 1 10:21:59 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=69286497
read_repos_conf: exclude empty strings as file too
main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index 023b42e..4f9f467 100644
--- a/main.c
+++ b/main.c
@@ -516,11 +516,11 @@ read_repos_conf(const char *configroot, const char *repos_conf)
for (i = 0; i < count; ++i) {
const char *name = confs[i]->d_name;
- if (name[0] == '.')
+ if (name[0] == '.' || name[0] == '\0')
continue;
/* Exclude backup files (aka files with ~ as postfix). */
- if (name[0] != '\0' && name[strlen(name) - 1] == '~')
+ if (name[strlen(name) - 1] == '~')
continue;
#ifdef DT_UNKNOWN
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-01 10:22 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-01 10:22 UTC (permalink / raw
To: gentoo-commits
commit: cd7c5018d4bffa34bd5aab6848525fd83d392de7
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 1 10:20:12 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Apr 1 10:20:12 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=cd7c5018
read_portage_env_file: properly ignore backup files
backup files are suffixed by '~', not prefixed
main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 85740b8..023b42e 100644
--- a/main.c
+++ b/main.c
@@ -670,7 +670,8 @@ read_portage_env_file(const char *configroot, const char *file, env_vars vars[])
/* recurse through all files */
for (di = 0; di < dentslen; di++) {
d = dents[di];
- if (d->d_name[0] == '.' || d->d_name[0] == '~')
+ if (d->d_name[0] == '.' || d->d_name[0] == '\0' ||
+ d->d_name[strlen(d->d_name) - 1] == '~')
continue;
snprintf(npath, sizeof(npath), "%s/%s", file, d->d_name);
read_portage_env_file(configroot, npath, vars);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-02 17:27 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-02 17:27 UTC (permalink / raw
To: gentoo-commits
commit: e8d6478d5fb0b5c9d33318fff9387d7cb27620f7
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 2 17:21:21 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Apr 2 17:21:21 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e8d6478d
qatom_printf: support REPO expansion
qatom.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qatom.c b/qatom.c
index b542de8..9e4b40c 100644
--- a/qatom.c
+++ b/qatom.c
@@ -87,6 +87,9 @@ qatom_printf(const char *format, const depend_atom *atom, int pverbose)
} else if (!strncmp("SLOT", fmt, len)) {
if (showit || atom->SLOT)
printf(":%s", atom->SLOT ? atom->SLOT : "-");
+ } else if (!strncmp("REPO", fmt, len)) {
+ if (showit || atom->REPO)
+ printf("::%s", HN(atom->REPO));
} else if (!strncmp("pfx", fmt, len)) {
if (showit || atom->pfx_op != ATOM_OP_NONE)
fputs(atom->pfx_op == ATOM_OP_NONE ?
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-03 13:39 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-03 13:39 UTC (permalink / raw
To: gentoo-commits
commit: d01affcd8541a539a7e5b329efef1cc49f31569f
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 3 13:25:30 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Apr 3 13:25:30 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d01affcd
qsize: use make_human_readable_str to format sizes by default
This way, sizes are by default converted to the unit that matches the
quantity of the value. This behaviour can be overridden by the -b, -k
and -m options for constant values. Simplifies code, and makes it
easier to grasp for humans.
qsize.c | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/qsize.c b/qsize.c
index 9cd66cf..c485aa6 100644
--- a/qsize.c
+++ b/qsize.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2014 Gentoo Foundation
+ * Copyright 2005-2018 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
@@ -120,15 +120,9 @@ qsize_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
num_files, num_nonfiles);
if (num_ignored)
printf("%'zu names-ignored, ", num_ignored);
- if (state->disp_units)
- printf("%s %s\n",
- make_human_readable_str(num_bytes, 1, state->disp_units),
- state->str_disp_units);
- else
- printf("%'"PRIu64"%s%"PRIu64" KiB\n",
- num_bytes / KILOBYTE,
- decimal_point,
- ((num_bytes % KILOBYTE) * 1000) / KILOBYTE);
+ printf("%s %s\n",
+ make_human_readable_str(num_bytes, 1, state->disp_units),
+ state->disp_units ? state->str_disp_units : "");
}
return EXIT_SUCCESS;
@@ -194,15 +188,10 @@ int qsize_main(int argc, char **argv)
state.num_all_files, state.num_all_nonfiles);
if (state.num_all_ignored)
printf("%'zu names-ignored, ", state.num_all_ignored);
- if (state.disp_units)
- printf("%s %s\n",
- make_human_readable_str(state.num_all_bytes, 1, state.disp_units),
- state.str_disp_units);
- else
- printf("%'"PRIu64"%s%"PRIu64" MiB\n",
- state.num_all_bytes / MEGABYTE,
- decimal_point,
- ((state.num_all_bytes % MEGABYTE) * 1000) / MEGABYTE);
+ printf("%s %s\n",
+ make_human_readable_str(
+ state.num_all_bytes, 1, state.disp_units),
+ state.disp_units ? state.str_disp_units : "");
}
array_for_each(state.atoms, i, atom)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-03 20:13 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-03 20:13 UTC (permalink / raw
To: gentoo-commits
commit: 0baddddc111c7fba7a8a087a2905ca645a27f5f8
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 3 20:12:16 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Apr 3 20:12:16 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0baddddc
qfile_main: use q_vdb_foreach_pkg_sorted, bug #607498
For consistency with almost all other output, use sorted output variant
for qfile as well. The little sorting/memory overhead due to this is
probably ok, given how much it is used already.
Bug: https://bugs.gentoo.org/607498
qfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qfile.c b/qfile.c
index ec08491..3f13df6 100644
--- a/qfile.c
+++ b/qfile.c
@@ -462,7 +462,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(qfile_cb, &state, NULL);
+ found += q_vdb_foreach_pkg_sorted(qfile_cb, &state);
if (state.args.non_orphans) {
/* display orphan files */
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-04 13:16 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-04 13:16 UTC (permalink / raw
To: gentoo-commits
commit: 80d7de29b2c1f977e84bc653933545a6eb589694
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 4 13:13:15 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Apr 4 13:13:15 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=80d7de29
show_merge_times: start counting parallel merges from start of the file
If we start counting parallel merges only once we found something
interesting, we might not be aware of other emerges at that time,
drawing wrong conclusions when seeing a termination message.
Bug: https://bugs.gentoo.org/603024
qlop.c | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/qlop.c b/qlop.c
index 464a488..63bdb7f 100644
--- a/qlop.c
+++ b/qlop.c
@@ -105,6 +105,7 @@ show_merge_times(char *package, const char *logfile, int average, char human_rea
}
/* loop over lines searching for cat/pkg */
+ parallel_emerge = 0;
while (fgets(buf[0], sizeof(buf[0]), fp) != NULL) {
if ((p = strchr(buf[0], '\n')) != NULL)
*p = '\0';
@@ -121,6 +122,25 @@ show_merge_times(char *package, const char *logfile, int average, char human_rea
/* copy message (stripping timestamp) */
strncpy(buf[1], p, BUFSIZ);
rmspace(buf[1]);
+
+ if (strncmp(buf[1], "Started emerge on:", 18) == 0) {
+ /* a parallel emerge was launched */
+ parallel_emerge++;
+ continue;
+ }
+
+ if (strncmp(buf[1], "*** terminating.", 16) == 0) {
+ if (parallel_emerge > 0) {
+ /* a parallel emerge has finished */
+ parallel_emerge--;
+ continue;
+ } else {
+ /* the main emerge was stopped? if there's more lines
+ * this file is just corrupt or truncated at the front */
+ continue;
+ }
+ }
+
if (strncmp(buf[1], ">>> emerge (", 12) == 0) {
/* construct the matching end marker */
snprintf(ep, BUFSIZ, "completed %s", &buf[1][4]);
@@ -150,7 +170,6 @@ show_merge_times(char *package, const char *logfile, int average, char human_rea
(strcmp(pkg, atom->PN) == 0))) ||
(strcmp(pkg, atom->PN) == 0))
{
- parallel_emerge = 0;
while (fgets(buf[0], sizeof(buf[0]), fp) != NULL) {
if ((p = strchr(buf[0], '\n')) != NULL)
*p = '\0';
@@ -173,14 +192,17 @@ show_merge_times(char *package, const char *logfile, int average, char human_rea
/* a parallel emerge has finished */
parallel_emerge--;
continue;
- } else
- /* the main emerge was stopped */
+ } else {
+ /* the main emerge was stopped? if there's
+ * more lines this file is just corrupt or
+ * truncated at the front */
break;
+ }
}
/* pay attention to malformed log files (when the
* end of an emerge process is not indicated by the
- * line '*** terminating'). We assume than the log
+ * line '*** terminating'). We assume that the log
* is malformed when we find a parallel emerge
* process which is trying to emerge the same
* package
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-09 7:15 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-09 7:15 UTC (permalink / raw
To: gentoo-commits
commit: 3ba7c294e8aa701c38a251728843c1a954f68c38
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 5 18:23:54 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Apr 5 18:23:54 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3ba7c294
Revert "qmerge: Only fetch Packages if -f/-F is specified"
This commit changed the logic from fetching Packages when -f is set, to
forcing when -F is set. This is contradicting the documented behaviour
and broke the tests.
It is not clear to me anymore why this change was necessary, so I'm
reverging it.
This reverts commit eedb0ea266b78efd84bc34bc2c6602fb713ba590.
qmerge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 960a9a4..583e4fb 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -190,8 +190,8 @@ qmerge_initialize(void)
mkdir_p(buf, 0755);
xchdir(buf);
- if (force_download) {
- if (force_download == 2)
+ if (force_download != 2) {
+ if (force_download)
unlink(Packages);
if (access(Packages, R_OK) != 0)
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-09 7:15 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-09 7:15 UTC (permalink / raw
To: gentoo-commits
commit: 975186ebc35cc417c198ec922bcbc77226cdb05f
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 5 18:46:03 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Apr 5 18:49:34 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=975186eb
make-tarball: use numeric uid/gid
make-tarball.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make-tarball.sh b/make-tarball.sh
index 02cc501..4f8eed7 100755
--- a/make-tarball.sh
+++ b/make-tarball.sh
@@ -43,7 +43,7 @@ rm -rf autom4te.cache
cd ..
einfo "Generating tarball ..."
-tar cf - "${p}" | xz > "${p}".tar.xz
+tar --numeric-owner -cf - "${p}" | xz > "${p}".tar.xz
rm -r "${p}"
du -b "${p}".tar.*
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-15 15:38 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-15 15:38 UTC (permalink / raw
To: gentoo-commits
commit: 054b993a9433a45c00086fb2841a8150d85eb437
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 15 15:38:20 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Apr 15 15:38:20 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=054b993a
qlop: fix offsets for today and yesterday dates
Makefile | 2466 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
qlop.c | 4 +-
2 files changed, 2303 insertions(+), 167 deletions(-)
diff --git a/Makefile b/Makefile
index 2afb67d..bcde52c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,168 +1,2304 @@
-# Copyright 2005-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-####################################################################
-
-check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
- then echo "$(1)"; else echo "$(2)"; fi)
-istrue = $(if $(filter 1 yes true on,$(strip $1)),1,0)
-
-####################################################
-WFLAGS := -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \
- -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \
- -Wbad-function-cast -Wnested-externs -Wcomment -Winline \
- -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \
- $(call check_gcc, -Wsequence-point) \
- $(call check_gcc, -Wextra) \
- $(call check_gcc, -Wno-sign-compare) \
- $(call check_gcc, -Wold-style-definition)
-
-CFLAGS ?= -O2 -g -pipe
-CFLAGS += -std=gnu99
-CPPFLAGS ?=
-CPPFLAGS += -DENABLE_NLS=$(call istrue,$(NLS))
-DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc, -fsanitize=address -fsanitize=leak -fsanitize=undefined)
-#CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2 -falign-labels=2 -falign-loops=2
-LDFLAGS_static_1 = -static
-LDFLAGS += $(LDFLAGS_static_$(call istrue,$(STATIC)))
-LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo '-lkvm')
-LIBADD += -liniparser
-DESTDIR :=
-PREFIX := $(DESTDIR)/usr
-ETCDIR := $(DESTDIR)/etc
-STRIP := strip
-MKDIR := mkdir -p
-CP := cp
-INSTALL_EXE := install -m755
-
-ifndef V
-Q = @
-else
-Q =
-endif
-export Q
-ifdef PV
-CPPFLAGS += -DVERSION=\"$(PV)\"
-else
-PV := git
-VCSID := $(shell git describe --tags HEAD)
-CPPFLAGS += -DVCSID='"$(VCSID)"'
-endif
-ifndef PF
-PF := portage-utils-$(PV)
-endif
-DOCS := TODO.md README.md qsync
-
-#ifdef PYTHON
-#PYFLAGS ?= $(shell python-config) -DWANT_PYTHON -ldl -pthread -lutil /usr/lib/libpython2.4.so
-##PYFLAGS += -lpython2.4
-#endif
-
-#####################################################
-APPLETS := $(shell ./applets.sh)
-SRC := $(APPLETS:%=%.c) main.c
-APP_FLAGS := $(foreach a,$(APPLETS),-DAPPLET_$a)
-CPPFLAGS += $(APP_FLAGS)
-
-all: q
- @true
-
-debug: clean
- $(MAKE) CFLAGS="$(CFLAGS) $(DBG_CFLAGS)" symlinks
- @-scanelf -o /dev/null -BXxz permsx q
-
-q: $(SRC) libq/*.c *.h libq/*.h
-ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS))
- @printf ': %s ' $(APPLETS)
- @echo ':'
-ifndef V
- @echo $(CC) $(CFLAGS) $(PYFLAGS) $(LDFLAGS) main.c -o q $(LIBADD)
-endif
-endif
- $(Q)$(CC) $(WFLAGS) $(PYFLAGS) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) main.c -o q $(LIBADD)
-
-.depend: $(SRC) applets.h
- sed -n '/^DECLARE_APPLET/s:.*(\(.*\)).*:#include "\1.c":p' applets.h > include_applets.h
- @#$(CC) $(CFLAGS) -MM $(SRC) > .depend
- $(CC) $(CPPFLAGS) $(CFLAGS) -MM main.c > .depend
-
-check: symlinks
- $(MAKE) -C tests $@
-
-dist:
- ./make-tarball.sh $(PV)
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+
+
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/portage-utils
+pkgincludedir = $(includedir)/portage-utils
+pkglibdir = $(libdir)/portage-utils
+pkglibexecdir = $(libexecdir)/portage-utils
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-pc-solaris2.11
+host_triplet = x86_64-pc-solaris2.11
+bin_PROGRAMS = q$(EXEEXT)
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/autotools/m4/00gnulib.m4 \
+ $(top_srcdir)/autotools/m4/absolute-header.m4 \
+ $(top_srcdir)/autotools/m4/alloca.m4 \
+ $(top_srcdir)/autotools/m4/canonicalize.m4 \
+ $(top_srcdir)/autotools/m4/chdir-long.m4 \
+ $(top_srcdir)/autotools/m4/clock_time.m4 \
+ $(top_srcdir)/autotools/m4/close.m4 \
+ $(top_srcdir)/autotools/m4/closedir.m4 \
+ $(top_srcdir)/autotools/m4/dirent_h.m4 \
+ $(top_srcdir)/autotools/m4/dirfd.m4 \
+ $(top_srcdir)/autotools/m4/dirname.m4 \
+ $(top_srcdir)/autotools/m4/double-slash-root.m4 \
+ $(top_srcdir)/autotools/m4/dup.m4 \
+ $(top_srcdir)/autotools/m4/dup2.m4 \
+ $(top_srcdir)/autotools/m4/eealloc.m4 \
+ $(top_srcdir)/autotools/m4/errno_h.m4 \
+ $(top_srcdir)/autotools/m4/error.m4 \
+ $(top_srcdir)/autotools/m4/euidaccess.m4 \
+ $(top_srcdir)/autotools/m4/exponentd.m4 \
+ $(top_srcdir)/autotools/m4/exponentf.m4 \
+ $(top_srcdir)/autotools/m4/exponentl.m4 \
+ $(top_srcdir)/autotools/m4/extensions.m4 \
+ $(top_srcdir)/autotools/m4/extern-inline.m4 \
+ $(top_srcdir)/autotools/m4/faccessat.m4 \
+ $(top_srcdir)/autotools/m4/fchdir.m4 \
+ $(top_srcdir)/autotools/m4/fcntl-o.m4 \
+ $(top_srcdir)/autotools/m4/fcntl.m4 \
+ $(top_srcdir)/autotools/m4/fcntl_h.m4 \
+ $(top_srcdir)/autotools/m4/fdopendir.m4 \
+ $(top_srcdir)/autotools/m4/filenamecat.m4 \
+ $(top_srcdir)/autotools/m4/float_h.m4 \
+ $(top_srcdir)/autotools/m4/fpieee.m4 \
+ $(top_srcdir)/autotools/m4/frexp.m4 \
+ $(top_srcdir)/autotools/m4/frexpl.m4 \
+ $(top_srcdir)/autotools/m4/fstat.m4 \
+ $(top_srcdir)/autotools/m4/fstatat.m4 \
+ $(top_srcdir)/autotools/m4/futimens.m4 \
+ $(top_srcdir)/autotools/m4/getcwd.m4 \
+ $(top_srcdir)/autotools/m4/getdelim.m4 \
+ $(top_srcdir)/autotools/m4/getdtablesize.m4 \
+ $(top_srcdir)/autotools/m4/getgroups.m4 \
+ $(top_srcdir)/autotools/m4/getline.m4 \
+ $(top_srcdir)/autotools/m4/getopt.m4 \
+ $(top_srcdir)/autotools/m4/getprogname.m4 \
+ $(top_srcdir)/autotools/m4/gettime.m4 \
+ $(top_srcdir)/autotools/m4/gettimeofday.m4 \
+ $(top_srcdir)/autotools/m4/gnulib-common.m4 \
+ $(top_srcdir)/autotools/m4/gnulib-comp.m4 \
+ $(top_srcdir)/autotools/m4/group-member.m4 \
+ $(top_srcdir)/autotools/m4/include_next.m4 \
+ $(top_srcdir)/autotools/m4/intmax_t.m4 \
+ $(top_srcdir)/autotools/m4/inttypes-pri.m4 \
+ $(top_srcdir)/autotools/m4/inttypes.m4 \
+ $(top_srcdir)/autotools/m4/inttypes_h.m4 \
+ $(top_srcdir)/autotools/m4/isnand.m4 \
+ $(top_srcdir)/autotools/m4/isnanf.m4 \
+ $(top_srcdir)/autotools/m4/isnanl.m4 \
+ $(top_srcdir)/autotools/m4/largefile.m4 \
+ $(top_srcdir)/autotools/m4/ldexpl.m4 \
+ $(top_srcdir)/autotools/m4/limits-h.m4 \
+ $(top_srcdir)/autotools/m4/localtime-buffer.m4 \
+ $(top_srcdir)/autotools/m4/longlong.m4 \
+ $(top_srcdir)/autotools/m4/lstat.m4 \
+ $(top_srcdir)/autotools/m4/malloc.m4 \
+ $(top_srcdir)/autotools/m4/malloca.m4 \
+ $(top_srcdir)/autotools/m4/math_h.m4 \
+ $(top_srcdir)/autotools/m4/memchr.m4 \
+ $(top_srcdir)/autotools/m4/mempcpy.m4 \
+ $(top_srcdir)/autotools/m4/memrchr.m4 \
+ $(top_srcdir)/autotools/m4/mkdir.m4 \
+ $(top_srcdir)/autotools/m4/mkdirat.m4 \
+ $(top_srcdir)/autotools/m4/mmap-anon.m4 \
+ $(top_srcdir)/autotools/m4/mode_t.m4 \
+ $(top_srcdir)/autotools/m4/msvc-inval.m4 \
+ $(top_srcdir)/autotools/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/autotools/m4/multiarch.m4 \
+ $(top_srcdir)/autotools/m4/nocrash.m4 \
+ $(top_srcdir)/autotools/m4/off_t.m4 \
+ $(top_srcdir)/autotools/m4/open-cloexec.m4 \
+ $(top_srcdir)/autotools/m4/open.m4 \
+ $(top_srcdir)/autotools/m4/openat.m4 \
+ $(top_srcdir)/autotools/m4/opendir.m4 \
+ $(top_srcdir)/autotools/m4/pathmax.m4 \
+ $(top_srcdir)/autotools/m4/printf-frexp.m4 \
+ $(top_srcdir)/autotools/m4/printf-frexpl.m4 \
+ $(top_srcdir)/autotools/m4/printf.m4 \
+ $(top_srcdir)/autotools/m4/readlink.m4 \
+ $(top_srcdir)/autotools/m4/readlinkat.m4 \
+ $(top_srcdir)/autotools/m4/realloc.m4 \
+ $(top_srcdir)/autotools/m4/rename.m4 \
+ $(top_srcdir)/autotools/m4/renameat.m4 \
+ $(top_srcdir)/autotools/m4/rmdir.m4 \
+ $(top_srcdir)/autotools/m4/save-cwd.m4 \
+ $(top_srcdir)/autotools/m4/signbit.m4 \
+ $(top_srcdir)/autotools/m4/size_max.m4 \
+ $(top_srcdir)/autotools/m4/ssize_t.m4 \
+ $(top_srcdir)/autotools/m4/stat-time.m4 \
+ $(top_srcdir)/autotools/m4/stat.m4 \
+ $(top_srcdir)/autotools/m4/stdbool.m4 \
+ $(top_srcdir)/autotools/m4/stddef_h.m4 \
+ $(top_srcdir)/autotools/m4/stdint.m4 \
+ $(top_srcdir)/autotools/m4/stdint_h.m4 \
+ $(top_srcdir)/autotools/m4/stdio_h.m4 \
+ $(top_srcdir)/autotools/m4/stdlib_h.m4 \
+ $(top_srcdir)/autotools/m4/stpcpy.m4 \
+ $(top_srcdir)/autotools/m4/strcase.m4 \
+ $(top_srcdir)/autotools/m4/strcasestr.m4 \
+ $(top_srcdir)/autotools/m4/strdup.m4 \
+ $(top_srcdir)/autotools/m4/strerror.m4 \
+ $(top_srcdir)/autotools/m4/string_h.m4 \
+ $(top_srcdir)/autotools/m4/strings_h.m4 \
+ $(top_srcdir)/autotools/m4/strncat.m4 \
+ $(top_srcdir)/autotools/m4/symlink.m4 \
+ $(top_srcdir)/autotools/m4/symlinkat.m4 \
+ $(top_srcdir)/autotools/m4/sys_socket_h.m4 \
+ $(top_srcdir)/autotools/m4/sys_stat_h.m4 \
+ $(top_srcdir)/autotools/m4/sys_time_h.m4 \
+ $(top_srcdir)/autotools/m4/sys_types_h.m4 \
+ $(top_srcdir)/autotools/m4/time_h.m4 \
+ $(top_srcdir)/autotools/m4/timespec.m4 \
+ $(top_srcdir)/autotools/m4/unistd-safer.m4 \
+ $(top_srcdir)/autotools/m4/unistd_h.m4 \
+ $(top_srcdir)/autotools/m4/unlink.m4 \
+ $(top_srcdir)/autotools/m4/unlinkat.m4 \
+ $(top_srcdir)/autotools/m4/utime.m4 \
+ $(top_srcdir)/autotools/m4/utime_h.m4 \
+ $(top_srcdir)/autotools/m4/utimens.m4 \
+ $(top_srcdir)/autotools/m4/utimensat.m4 \
+ $(top_srcdir)/autotools/m4/utimes.m4 \
+ $(top_srcdir)/autotools/m4/vasnprintf.m4 \
+ $(top_srcdir)/autotools/m4/vasprintf-posix.m4 \
+ $(top_srcdir)/autotools/m4/vasprintf.m4 \
+ $(top_srcdir)/autotools/m4/warn-on-use.m4 \
+ $(top_srcdir)/autotools/m4/wchar_h.m4 \
+ $(top_srcdir)/autotools/m4/wchar_t.m4 \
+ $(top_srcdir)/autotools/m4/wint_t.m4 \
+ $(top_srcdir)/autotools/m4/xsize.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(dist_postsyncd_SCRIPTS) \
+ $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(postsyncddir)" \
+ "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_q_OBJECTS = q-main.$(OBJEXT)
+q_OBJECTS = $(am_q_OBJECTS)
+am__DEPENDENCIES_1 =
+q_DEPENDENCIES = $(top_builddir)/autotools/gnulib/libgnu.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+SCRIPTS = $(dist_postsyncd_SCRIPTS)
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.
+depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am__v_lt_1 =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(q_SOURCES)
+DIST_SOURCES = $(q_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(dist_man_MANS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(top_srcdir)/autotools/compile \
+ $(top_srcdir)/autotools/config.guess \
+ $(top_srcdir)/autotools/config.sub \
+ $(top_srcdir)/autotools/depcomp \
+ $(top_srcdir)/autotools/install-sh \
+ $(top_srcdir)/autotools/missing COPYING autotools/compile \
+ autotools/config.guess autotools/config.sub autotools/depcomp \
+ autotools/install-sh autotools/missing
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+GZIP_ENV = --best
+DIST_ARCHIVES = $(distdir).tar.xz
+DIST_TARGETS = dist-xz
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing aclocal-1.15
+ALLOCA =
+ALLOCA_H = alloca.h
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 0
+APPLE_UNIVERSAL_BUILD = 0
+AR = ar
+ARFLAGS = cr
+AUTOCONF = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing autoconf
+AUTOHEADER = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing autoheader
+AUTOMAKE = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing automake-1.15
+AWK = gawk
+BITSIZEOF_PTRDIFF_T =
+BITSIZEOF_SIG_ATOMIC_T =
+BITSIZEOF_SIZE_T =
+BITSIZEOF_WCHAR_T =
+BITSIZEOF_WINT_T =
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2 -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings -Wbad-function-cast -Wnested-externs -Wcomment -Winline -Wchar-subscripts -Wcast-align -Wno-format-nonliteral -Wsequence-point -Wold-style-definition -Wextra
+CPP = gcc -E
+CPPFLAGS =
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO_C = \c
+ECHO_N =
+ECHO_T =
+EGREP = /gentoo/prefix64/usr/bin/grep -E
+EMULTIHOP_HIDDEN =
+EMULTIHOP_VALUE =
+ENOLINK_HIDDEN =
+ENOLINK_VALUE =
+EOVERFLOW_HIDDEN =
+EOVERFLOW_VALUE =
+ERRNO_H =
+EXEEXT =
+FLOAT_H =
+GETOPT_CDEFS_H =
+GETOPT_H =
+GNULIB_ACOSF = 0
+GNULIB_ACOSL = 0
+GNULIB_ALPHASORT = 0
+GNULIB_ASINF = 0
+GNULIB_ASINL = 0
+GNULIB_ATAN2F = 0
+GNULIB_ATANF = 0
+GNULIB_ATANL = 0
+GNULIB_ATOLL = 0
+GNULIB_BTOWC = 0
+GNULIB_CALLOC_POSIX = 0
+GNULIB_CANONICALIZE_FILE_NAME = 1
+GNULIB_CBRT = 0
+GNULIB_CBRTF = 0
+GNULIB_CBRTL = 0
+GNULIB_CEIL = 0
+GNULIB_CEILF = 0
+GNULIB_CEILL = 0
+GNULIB_CHDIR = 1
+GNULIB_CHOWN = 0
+GNULIB_CLOSE = 1
+GNULIB_CLOSEDIR = 1
+GNULIB_COPYSIGN = 0
+GNULIB_COPYSIGNF = 0
+GNULIB_COPYSIGNL = 0
+GNULIB_COSF = 0
+GNULIB_COSHF = 0
+GNULIB_COSL = 0
+GNULIB_CTIME = 0
+GNULIB_DIRFD = 1
+GNULIB_DPRINTF = 0
+GNULIB_DUP = 1
+GNULIB_DUP2 = 1
+GNULIB_DUP3 = 0
+GNULIB_ENVIRON = 0
+GNULIB_EUIDACCESS = 1
+GNULIB_EXP2 = 0
+GNULIB_EXP2F = 0
+GNULIB_EXP2L = 0
+GNULIB_EXPF = 0
+GNULIB_EXPL = 0
+GNULIB_EXPLICIT_BZERO = 0
+GNULIB_EXPM1 = 0
+GNULIB_EXPM1F = 0
+GNULIB_EXPM1L = 0
+GNULIB_FABSF = 0
+GNULIB_FABSL = 0
+GNULIB_FACCESSAT = 1
+GNULIB_FCHDIR = 1
+GNULIB_FCHMODAT = 0
+GNULIB_FCHOWNAT = 0
+GNULIB_FCLOSE = 0
+GNULIB_FCNTL = 1
+GNULIB_FDATASYNC = 0
+GNULIB_FDOPEN = 0
+GNULIB_FDOPENDIR = 1
+GNULIB_FFLUSH = 0
+GNULIB_FFS = 0
+GNULIB_FFSL = 0
+GNULIB_FFSLL = 0
+GNULIB_FGETC = 1
+GNULIB_FGETS = 1
+GNULIB_FLOOR = 0
+GNULIB_FLOORF = 0
+GNULIB_FLOORL = 0
+GNULIB_FMA = 0
+GNULIB_FMAF = 0
+GNULIB_FMAL = 0
+GNULIB_FMOD = 0
+GNULIB_FMODF = 0
+GNULIB_FMODL = 0
+GNULIB_FOPEN = 0
+GNULIB_FPRINTF = 1
+GNULIB_FPRINTF_POSIX = 0
+GNULIB_FPURGE = 0
+GNULIB_FPUTC = 1
+GNULIB_FPUTS = 1
+GNULIB_FREAD = 1
+GNULIB_FREOPEN = 0
+GNULIB_FREXP = 1
+GNULIB_FREXPF = 0
+GNULIB_FREXPL = 1
+GNULIB_FSCANF = 1
+GNULIB_FSEEK = 0
+GNULIB_FSEEKO = 0
+GNULIB_FSTAT = 1
+GNULIB_FSTATAT = 1
+GNULIB_FSYNC = 0
+GNULIB_FTELL = 0
+GNULIB_FTELLO = 0
+GNULIB_FTRUNCATE = 0
+GNULIB_FUTIMENS = 1
+GNULIB_FWRITE = 1
+GNULIB_GETC = 1
+GNULIB_GETCHAR = 1
+GNULIB_GETCWD = 1
+GNULIB_GETDELIM = 1
+GNULIB_GETDOMAINNAME = 0
+GNULIB_GETDTABLESIZE = 1
+GNULIB_GETGROUPS = 1
+GNULIB_GETHOSTNAME = 0
+GNULIB_GETLINE = 1
+GNULIB_GETLOADAVG = 0
+GNULIB_GETLOGIN = 0
+GNULIB_GETLOGIN_R = 0
+GNULIB_GETPAGESIZE = 0
+GNULIB_GETSUBOPT = 0
+GNULIB_GETTIMEOFDAY = 1
+GNULIB_GETUSERSHELL = 0
+GNULIB_GL_UNISTD_H_GETOPT =
+GNULIB_GRANTPT = 0
+GNULIB_GROUP_MEMBER = 1
+GNULIB_HYPOT = 0
+GNULIB_HYPOTF = 0
+GNULIB_HYPOTL = 0
+GNULIB_ILOGB = 0
+GNULIB_ILOGBF = 0
+GNULIB_ILOGBL = 0
+GNULIB_IMAXABS = 0
+GNULIB_IMAXDIV = 0
+GNULIB_ISATTY = 0
+GNULIB_ISFINITE = 0
+GNULIB_ISINF = 0
+GNULIB_ISNAN = 0
+GNULIB_ISNAND = 0
+GNULIB_ISNANF = 0
+GNULIB_ISNANL = 0
+GNULIB_LCHMOD = 0
+GNULIB_LCHOWN = 0
+GNULIB_LDEXPF = 0
+GNULIB_LDEXPL = 0
+GNULIB_LINK = 0
+GNULIB_LINKAT = 0
+GNULIB_LOCALTIME = 0
+GNULIB_LOG = 0
+GNULIB_LOG10 = 0
+GNULIB_LOG10F = 0
+GNULIB_LOG10L = 0
+GNULIB_LOG1P = 0
+GNULIB_LOG1PF = 0
+GNULIB_LOG1PL = 0
+GNULIB_LOG2 = 0
+GNULIB_LOG2F = 0
+GNULIB_LOG2L = 0
+GNULIB_LOGB = 0
+GNULIB_LOGBF = 0
+GNULIB_LOGBL = 0
+GNULIB_LOGF = 0
+GNULIB_LOGL = 0
+GNULIB_LSEEK = 0
+GNULIB_LSTAT = 1
+GNULIB_MALLOC_POSIX = 1
+GNULIB_MBRLEN = 0
+GNULIB_MBRTOWC = 0
+GNULIB_MBSCASECMP = 0
+GNULIB_MBSCASESTR = 0
+GNULIB_MBSCHR = 0
+GNULIB_MBSCSPN = 0
+GNULIB_MBSINIT = 0
+GNULIB_MBSLEN = 0
+GNULIB_MBSNCASECMP = 0
+GNULIB_MBSNLEN = 0
+GNULIB_MBSNRTOWCS = 0
+GNULIB_MBSPBRK = 0
+GNULIB_MBSPCASECMP = 0
+GNULIB_MBSRCHR = 0
+GNULIB_MBSRTOWCS = 0
+GNULIB_MBSSEP = 0
+GNULIB_MBSSPN = 0
+GNULIB_MBSSTR = 0
+GNULIB_MBSTOK_R = 0
+GNULIB_MBTOWC = 0
+GNULIB_MEMCHR = 1
+GNULIB_MEMMEM = 0
+GNULIB_MEMPCPY = 1
+GNULIB_MEMRCHR = 1
+GNULIB_MKDIRAT = 1
+GNULIB_MKDTEMP = 0
+GNULIB_MKFIFO = 0
+GNULIB_MKFIFOAT = 0
+GNULIB_MKNOD = 0
+GNULIB_MKNODAT = 0
+GNULIB_MKOSTEMP = 0
+GNULIB_MKOSTEMPS = 0
+GNULIB_MKSTEMP = 0
+GNULIB_MKSTEMPS = 0
+GNULIB_MKTIME = 0
+GNULIB_MODF = 0
+GNULIB_MODFF = 0
+GNULIB_MODFL = 0
+GNULIB_NANOSLEEP = 0
+GNULIB_NONBLOCKING = 0
+GNULIB_OBSTACK_PRINTF = 0
+GNULIB_OBSTACK_PRINTF_POSIX = 0
+GNULIB_OPEN = 1
+GNULIB_OPENAT = 1
+GNULIB_OPENDIR = 1
+GNULIB_OVERRIDES_STRUCT_STAT = 0
+GNULIB_OVERRIDES_WINT_T = 0
+GNULIB_PCLOSE = 0
+GNULIB_PERROR = 0
+GNULIB_PIPE = 0
+GNULIB_PIPE2 = 0
+GNULIB_POPEN = 0
+GNULIB_POSIX_OPENPT = 0
+GNULIB_POWF = 0
+GNULIB_PREAD = 0
+GNULIB_PRINTF = 1
+GNULIB_PRINTF_POSIX = 0
+GNULIB_PTSNAME = 0
+GNULIB_PTSNAME_R = 0
+GNULIB_PUTC = 1
+GNULIB_PUTCHAR = 1
+GNULIB_PUTENV = 0
+GNULIB_PUTS = 1
+GNULIB_PWRITE = 0
+GNULIB_QSORT_R = 0
+GNULIB_RANDOM = 0
+GNULIB_RANDOM_R = 0
+GNULIB_RAWMEMCHR = 0
+GNULIB_READ = 0
+GNULIB_READDIR = 0
+GNULIB_READLINK = 1
+GNULIB_READLINKAT = 1
+GNULIB_REALLOCARRAY = 0
+GNULIB_REALLOC_POSIX = 1
+GNULIB_REALPATH = 1
+GNULIB_REMAINDER = 0
+GNULIB_REMAINDERF = 0
+GNULIB_REMAINDERL = 0
+GNULIB_REMOVE = 0
+GNULIB_RENAME = 1
+GNULIB_RENAMEAT = 1
+GNULIB_REWINDDIR = 0
+GNULIB_RINT = 0
+GNULIB_RINTF = 0
+GNULIB_RINTL = 0
+GNULIB_RMDIR = 1
+GNULIB_ROUND = 0
+GNULIB_ROUNDF = 0
+GNULIB_ROUNDL = 0
+GNULIB_RPMATCH = 0
+GNULIB_SCANDIR = 0
+GNULIB_SCANF = 1
+GNULIB_SECURE_GETENV = 0
+GNULIB_SETENV = 0
+GNULIB_SETHOSTNAME = 0
+GNULIB_SIGNBIT = 1
+GNULIB_SINF = 0
+GNULIB_SINHF = 0
+GNULIB_SINL = 0
+GNULIB_SLEEP = 0
+GNULIB_SNPRINTF = 0
+GNULIB_SPRINTF_POSIX = 0
+GNULIB_SQRTF = 0
+GNULIB_SQRTL = 0
+GNULIB_STAT = 1
+GNULIB_STDIO_H_NONBLOCKING = 0
+GNULIB_STDIO_H_SIGPIPE = 0
+GNULIB_STPCPY = 1
+GNULIB_STPNCPY = 0
+GNULIB_STRCASESTR = 1
+GNULIB_STRCHRNUL = 0
+GNULIB_STRDUP = 1
+GNULIB_STRERROR = 1
+GNULIB_STRERROR_R = 0
+GNULIB_STRFTIME = 0
+GNULIB_STRNCAT = 1
+GNULIB_STRNDUP = 0
+GNULIB_STRNLEN = 0
+GNULIB_STRPBRK = 0
+GNULIB_STRPTIME = 0
+GNULIB_STRSEP = 0
+GNULIB_STRSIGNAL = 0
+GNULIB_STRSTR = 0
+GNULIB_STRTOD = 0
+GNULIB_STRTOIMAX = 0
+GNULIB_STRTOK_R = 0
+GNULIB_STRTOLL = 0
+GNULIB_STRTOULL = 0
+GNULIB_STRTOUMAX = 0
+GNULIB_STRVERSCMP = 0
+GNULIB_SYMLINK = 1
+GNULIB_SYMLINKAT = 1
+GNULIB_SYSTEM_POSIX = 0
+GNULIB_TANF = 0
+GNULIB_TANHF = 0
+GNULIB_TANL = 0
+GNULIB_TIMEGM = 0
+GNULIB_TIME_R = 0
+GNULIB_TIME_RZ = 0
+GNULIB_TMPFILE = 0
+GNULIB_TRUNC = 0
+GNULIB_TRUNCATE = 0
+GNULIB_TRUNCF = 0
+GNULIB_TRUNCL = 0
+GNULIB_TTYNAME_R = 0
+GNULIB_TZSET = 0
+GNULIB_UNISTD_H_NONBLOCKING = 0
+GNULIB_UNISTD_H_SIGPIPE = 0
+GNULIB_UNLINK = 1
+GNULIB_UNLINKAT = 1
+GNULIB_UNLOCKPT = 0
+GNULIB_UNSETENV = 0
+GNULIB_USLEEP = 0
+GNULIB_UTIME = 1
+GNULIB_UTIMENSAT = 1
+GNULIB_VASPRINTF = 1
+GNULIB_VDPRINTF = 0
+GNULIB_VFPRINTF = 1
+GNULIB_VFPRINTF_POSIX = 0
+GNULIB_VFSCANF = 0
+GNULIB_VPRINTF = 1
+GNULIB_VPRINTF_POSIX = 0
+GNULIB_VSCANF = 0
+GNULIB_VSNPRINTF = 0
+GNULIB_VSPRINTF_POSIX = 0
+GNULIB_WCPCPY = 0
+GNULIB_WCPNCPY = 0
+GNULIB_WCRTOMB = 0
+GNULIB_WCSCASECMP = 0
+GNULIB_WCSCAT = 0
+GNULIB_WCSCHR = 0
+GNULIB_WCSCMP = 0
+GNULIB_WCSCOLL = 0
+GNULIB_WCSCPY = 0
+GNULIB_WCSCSPN = 0
+GNULIB_WCSDUP = 0
+GNULIB_WCSFTIME = 0
+GNULIB_WCSLEN = 0
+GNULIB_WCSNCASECMP = 0
+GNULIB_WCSNCAT = 0
+GNULIB_WCSNCMP = 0
+GNULIB_WCSNCPY = 0
+GNULIB_WCSNLEN = 0
+GNULIB_WCSNRTOMBS = 0
+GNULIB_WCSPBRK = 0
+GNULIB_WCSRCHR = 0
+GNULIB_WCSRTOMBS = 0
+GNULIB_WCSSPN = 0
+GNULIB_WCSSTR = 0
+GNULIB_WCSTOK = 0
+GNULIB_WCSWIDTH = 0
+GNULIB_WCSXFRM = 0
+GNULIB_WCTOB = 0
+GNULIB_WCTOMB = 0
+GNULIB_WCWIDTH = 0
+GNULIB_WMEMCHR = 0
+GNULIB_WMEMCMP = 0
+GNULIB_WMEMCPY = 0
+GNULIB_WMEMMOVE = 0
+GNULIB_WMEMSET = 0
+GNULIB_WRITE = 0
+GNULIB__EXIT = 0
+GREP = /gentoo/prefix64/usr/bin/grep
+HAVE_ACOSF = 1
+HAVE_ACOSL = 1
+HAVE_ALPHASORT = 1
+HAVE_ASINF = 1
+HAVE_ASINL = 1
+HAVE_ATAN2F = 1
+HAVE_ATANF = 1
+HAVE_ATANL = 1
+HAVE_ATOLL = 1
+HAVE_BTOWC = 1
+HAVE_C99_STDINT_H = 1
+HAVE_CANONICALIZE_FILE_NAME = 1
+HAVE_CBRT = 1
+HAVE_CBRTF = 1
+HAVE_CBRTL = 1
+HAVE_CHOWN = 1
+HAVE_CLOSEDIR = 1
+HAVE_COPYSIGN = 1
+HAVE_COPYSIGNL = 1
+HAVE_COSF = 1
+HAVE_COSHF = 1
+HAVE_COSL = 1
+HAVE_CRTDEFS_H = 0
+HAVE_DECL_ACOSL = 1
+HAVE_DECL_ASINL = 1
+HAVE_DECL_ATANL = 1
+HAVE_DECL_CBRTF = 1
+HAVE_DECL_CBRTL = 1
+HAVE_DECL_CEILF = 1
+HAVE_DECL_CEILL = 1
+HAVE_DECL_COPYSIGNF = 1
+HAVE_DECL_COSL = 1
+HAVE_DECL_DIRFD = 1
+HAVE_DECL_ENVIRON = 1
+HAVE_DECL_EXP2 = 1
+HAVE_DECL_EXP2F = 1
+HAVE_DECL_EXP2L = 1
+HAVE_DECL_EXPL = 1
+HAVE_DECL_EXPM1L = 1
+HAVE_DECL_FCHDIR = 1
+HAVE_DECL_FDATASYNC = 1
+HAVE_DECL_FDOPENDIR = 1
+HAVE_DECL_FLOORF = 1
+HAVE_DECL_FLOORL = 1
+HAVE_DECL_FPURGE = 1
+HAVE_DECL_FREXPL = 1
+HAVE_DECL_FSEEKO = 1
+HAVE_DECL_FTELLO = 1
+HAVE_DECL_GETDELIM = 1
+HAVE_DECL_GETDOMAINNAME = 1
+HAVE_DECL_GETLINE = 1
+HAVE_DECL_GETLOADAVG = 1
+HAVE_DECL_GETLOGIN = 1
+HAVE_DECL_GETLOGIN_R = 1
+HAVE_DECL_GETPAGESIZE = 1
+HAVE_DECL_GETUSERSHELL = 1
+HAVE_DECL_IMAXABS = 1
+HAVE_DECL_IMAXDIV = 1
+HAVE_DECL_INITSTATE = 1
+HAVE_DECL_LDEXPL = 1
+HAVE_DECL_LOCALTIME_R = 1
+HAVE_DECL_LOG10L = 1
+HAVE_DECL_LOG2 = 1
+HAVE_DECL_LOG2F = 1
+HAVE_DECL_LOG2L = 1
+HAVE_DECL_LOGB = 1
+HAVE_DECL_LOGL = 1
+HAVE_DECL_MEMMEM = 1
+HAVE_DECL_MEMRCHR = 0
+HAVE_DECL_OBSTACK_PRINTF = 1
+HAVE_DECL_REMAINDER = 1
+HAVE_DECL_REMAINDERL = 1
+HAVE_DECL_RINTF = 1
+HAVE_DECL_ROUND = 1
+HAVE_DECL_ROUNDF = 1
+HAVE_DECL_ROUNDL = 1
+HAVE_DECL_SETENV = 1
+HAVE_DECL_SETHOSTNAME = 1
+HAVE_DECL_SETSTATE = 1
+HAVE_DECL_SINL = 1
+HAVE_DECL_SNPRINTF = 1
+HAVE_DECL_SQRTL = 1
+HAVE_DECL_STRDUP = 1
+HAVE_DECL_STRERROR_R = 1
+HAVE_DECL_STRNCASECMP = 1
+HAVE_DECL_STRNDUP = 1
+HAVE_DECL_STRNLEN = 1
+HAVE_DECL_STRSIGNAL = 1
+HAVE_DECL_STRTOIMAX = 1
+HAVE_DECL_STRTOK_R = 1
+HAVE_DECL_STRTOUMAX = 1
+HAVE_DECL_TANL = 1
+HAVE_DECL_TRUNC = 1
+HAVE_DECL_TRUNCF = 1
+HAVE_DECL_TRUNCL = 1
+HAVE_DECL_TTYNAME_R = 1
+HAVE_DECL_UNSETENV = 1
+HAVE_DECL_VSNPRINTF = 1
+HAVE_DECL_WCTOB = 1
+HAVE_DECL_WCWIDTH = 1
+HAVE_DIRENT_H = 1
+HAVE_DPRINTF = 1
+HAVE_DUP2 = 1
+HAVE_DUP3 = 1
+HAVE_EUIDACCESS = 0
+HAVE_EXPF = 1
+HAVE_EXPL = 1
+HAVE_EXPLICIT_BZERO = 1
+HAVE_EXPM1 = 1
+HAVE_EXPM1F = 1
+HAVE_FABSF = 1
+HAVE_FABSL = 1
+HAVE_FACCESSAT = 1
+HAVE_FCHDIR = 1
+HAVE_FCHMODAT = 1
+HAVE_FCHOWNAT = 1
+HAVE_FCNTL = 1
+HAVE_FDATASYNC = 1
+HAVE_FDOPENDIR = 1
+HAVE_FEATURES_H = 0
+HAVE_FFS = 1
+HAVE_FFSL = 1
+HAVE_FFSLL = 1
+HAVE_FMA = 1
+HAVE_FMAF = 1
+HAVE_FMAL = 1
+HAVE_FMODF = 1
+HAVE_FMODL = 1
+HAVE_FREXPF = 1
+HAVE_FSEEKO = 1
+HAVE_FSTATAT = 1
+HAVE_FSYNC = 1
+HAVE_FTELLO = 1
+HAVE_FTRUNCATE = 1
+HAVE_FUTIMENS = 1
+HAVE_GETDTABLESIZE = 1
+HAVE_GETGROUPS = 1
+HAVE_GETHOSTNAME = 1
+HAVE_GETLOGIN = 1
+HAVE_GETOPT_H = 1
+HAVE_GETPAGESIZE = 1
+HAVE_GETSUBOPT = 1
+HAVE_GETTIMEOFDAY = 1
+HAVE_GRANTPT = 1
+HAVE_GROUP_MEMBER = 0
+HAVE_HYPOTF = 1
+HAVE_HYPOTL = 1
+HAVE_ILOGB = 1
+HAVE_ILOGBF = 1
+HAVE_ILOGBL = 1
+HAVE_INTTYPES_H = 1
+HAVE_ISNAND = 1
+HAVE_ISNANF = 1
+HAVE_ISNANL = 1
+HAVE_LCHMOD = 1
+HAVE_LCHOWN = 1
+HAVE_LDEXPF = 1
+HAVE_LINK = 1
+HAVE_LINKAT = 1
+HAVE_LOG10F = 1
+HAVE_LOG10L = 1
+HAVE_LOG1P = 1
+HAVE_LOG1PF = 1
+HAVE_LOG1PL = 1
+HAVE_LOGBF = 1
+HAVE_LOGBL = 1
+HAVE_LOGF = 1
+HAVE_LOGL = 1
+HAVE_LONG_LONG_INT = 1
+HAVE_LSTAT = 1
+HAVE_MAX_ALIGN_T = 1
+HAVE_MBRLEN = 1
+HAVE_MBRTOWC = 1
+HAVE_MBSINIT = 1
+HAVE_MBSLEN = 0
+HAVE_MBSNRTOWCS = 1
+HAVE_MBSRTOWCS = 1
+HAVE_MEMCHR = 1
+HAVE_MEMPCPY = 0
+HAVE_MKDIRAT = 1
+HAVE_MKDTEMP = 1
+HAVE_MKFIFO = 1
+HAVE_MKFIFOAT = 1
+HAVE_MKNOD = 1
+HAVE_MKNODAT = 1
+HAVE_MKOSTEMP = 1
+HAVE_MKOSTEMPS = 1
+HAVE_MKSTEMP = 1
+HAVE_MKSTEMPS = 1
+HAVE_MODFF = 1
+HAVE_MODFL = 1
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = 0
+HAVE_NANOSLEEP = 1
+HAVE_OPENAT = 1
+HAVE_OPENDIR = 1
+HAVE_OS_H = 0
+HAVE_PCLOSE = 1
+HAVE_PIPE = 1
+HAVE_PIPE2 = 1
+HAVE_POPEN = 1
+HAVE_POSIX_OPENPT = 1
+HAVE_POWF = 1
+HAVE_PREAD = 1
+HAVE_PTSNAME = 1
+HAVE_PTSNAME_R = 1
+HAVE_PWRITE = 1
+HAVE_QSORT_R = 1
+HAVE_RANDOM = 1
+HAVE_RANDOM_H = 1
+HAVE_RANDOM_R = 1
+HAVE_RAWMEMCHR = 1
+HAVE_READDIR = 1
+HAVE_READLINK = 1
+HAVE_READLINKAT = 1
+HAVE_REALLOCARRAY = 1
+HAVE_REALPATH = 1
+HAVE_REMAINDER = 1
+HAVE_REMAINDERF = 1
+HAVE_RENAMEAT = 1
+HAVE_REWINDDIR = 1
+HAVE_RINT = 1
+HAVE_RINTL = 1
+HAVE_RPMATCH = 1
+HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0
+HAVE_SCANDIR = 1
+HAVE_SECURE_GETENV = 1
+HAVE_SETENV = 1
+HAVE_SETHOSTNAME = 1
+HAVE_SIGNED_SIG_ATOMIC_T =
+HAVE_SIGNED_WCHAR_T =
+HAVE_SIGNED_WINT_T =
+HAVE_SINF = 1
+HAVE_SINHF = 1
+HAVE_SINL = 1
+HAVE_SLEEP = 1
+HAVE_SQRTF = 1
+HAVE_SQRTL = 1
+HAVE_STDINT_H = 1
+HAVE_STPCPY = 1
+HAVE_STPNCPY = 1
+HAVE_STRCASECMP = 1
+HAVE_STRCASESTR = 1
+HAVE_STRCHRNUL = 1
+HAVE_STRINGS_H = 1
+HAVE_STRPBRK = 1
+HAVE_STRPTIME = 1
+HAVE_STRSEP = 1
+HAVE_STRTOD = 1
+HAVE_STRTOLL = 1
+HAVE_STRTOULL = 1
+HAVE_STRUCT_RANDOM_DATA = 1
+HAVE_STRUCT_TIMEVAL = 1
+HAVE_STRVERSCMP = 1
+HAVE_SYMLINK = 1
+HAVE_SYMLINKAT = 1
+HAVE_SYS_BITYPES_H = 0
+HAVE_SYS_CDEFS_H =
+HAVE_SYS_INTTYPES_H = 0
+HAVE_SYS_LOADAVG_H = 0
+HAVE_SYS_PARAM_H = 0
+HAVE_SYS_TIME_H = 1
+HAVE_SYS_TYPES_H = 1
+HAVE_TANF = 1
+HAVE_TANHF = 1
+HAVE_TANL = 1
+HAVE_TIMEGM = 1
+HAVE_TIMEZONE_T = 0
+HAVE_TRUNCATE = 1
+HAVE_TZSET = 1
+HAVE_UNISTD_H = 1
+HAVE_UNLINKAT = 1
+HAVE_UNLOCKPT = 1
+HAVE_UNSIGNED_LONG_LONG_INT = 1
+HAVE_USLEEP = 1
+HAVE_UTIME = 1
+HAVE_UTIMENSAT = 1
+HAVE_UTIME_H = 1
+HAVE_VASPRINTF = 1
+HAVE_VDPRINTF = 1
+HAVE_WCHAR_H = 1
+HAVE_WCHAR_T = 1
+HAVE_WCPCPY = 1
+HAVE_WCPNCPY = 1
+HAVE_WCRTOMB = 1
+HAVE_WCSCASECMP = 1
+HAVE_WCSCAT = 1
+HAVE_WCSCHR = 1
+HAVE_WCSCMP = 1
+HAVE_WCSCOLL = 1
+HAVE_WCSCPY = 1
+HAVE_WCSCSPN = 1
+HAVE_WCSDUP = 1
+HAVE_WCSFTIME = 1
+HAVE_WCSLEN = 1
+HAVE_WCSNCASECMP = 1
+HAVE_WCSNCAT = 1
+HAVE_WCSNCMP = 1
+HAVE_WCSNCPY = 1
+HAVE_WCSNLEN = 1
+HAVE_WCSNRTOMBS = 1
+HAVE_WCSPBRK = 1
+HAVE_WCSRCHR = 1
+HAVE_WCSRTOMBS = 1
+HAVE_WCSSPN = 1
+HAVE_WCSSTR = 1
+HAVE_WCSTOK = 1
+HAVE_WCSWIDTH = 1
+HAVE_WCSXFRM = 1
+HAVE_WINSOCK2_H = 0
+HAVE_WINT_T = 1
+HAVE_WMEMCHR = 1
+HAVE_WMEMCMP = 1
+HAVE_WMEMCPY = 1
+HAVE_WMEMMOVE = 1
+HAVE_WMEMSET = 1
+HAVE__BOOL = 1
+HAVE__EXIT = 1
+INCLUDE_NEXT = include_next
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = include_next
+INSTALL = /gentoo/prefix64/usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+INT32_MAX_LT_INTMAX_MAX = 1
+INT64_MAX_EQ_LONG_MAX = 1
+LDFLAGS =
+LIBGNU_LIBDEPS =
+LIBGNU_LTLIBDEPS =
+LIBINTL =
+LIBOBJS =
+LIBS = -lkvm
+LIB_CLOCK_GETTIME =
+LIB_EACCESS = -lgen
+LIMITS_H = limits.h
+LTLIBINTL =
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing makeinfo
+MKDIR_P = /gentoo/prefix64/usr/bin/mkdir -p
+NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = <dirent.h>
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H =
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = <fcntl.h>
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H =
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = <getopt.h>
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = <inttypes.h>
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = <limits.h>
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = <math.h>
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H =
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = <stdint.h>
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = <stdio.h>
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = <stdlib.h>
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = <strings.h>
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = <string.h>
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = <sys/stat.h>
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = <sys/time.h>
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = <sys/types.h>
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = <time.h>
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = <unistd.h>
+NEXT_AS_FIRST_DIRECTIVE_UTIME_H = <utime.h>
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = <wchar.h>
+NEXT_DIRENT_H = <dirent.h>
+NEXT_ERRNO_H =
+NEXT_FCNTL_H = <fcntl.h>
+NEXT_FLOAT_H =
+NEXT_GETOPT_H = <getopt.h>
+NEXT_INTTYPES_H = <inttypes.h>
+NEXT_LIMITS_H = <limits.h>
+NEXT_MATH_H = <math.h>
+NEXT_STDDEF_H =
+NEXT_STDINT_H = <stdint.h>
+NEXT_STDIO_H = <stdio.h>
+NEXT_STDLIB_H = <stdlib.h>
+NEXT_STRINGS_H = <strings.h>
+NEXT_STRING_H = <string.h>
+NEXT_SYS_STAT_H = <sys/stat.h>
+NEXT_SYS_TIME_H = <sys/time.h>
+NEXT_SYS_TYPES_H = <sys/types.h>
+NEXT_TIME_H = <time.h>
+NEXT_UNISTD_H = <unistd.h>
+NEXT_UTIME_H = <utime.h>
+NEXT_WCHAR_H = <wchar.h>
+OBJEXT = o
+PACKAGE = portage-utils
+PACKAGE_BUGREPORT =
+PACKAGE_NAME = portage-utils
+PACKAGE_STRING = portage-utils git
+PACKAGE_TARNAME = portage-utils
+PACKAGE_URL =
+PACKAGE_VERSION = git
+PATH_SEPARATOR = :
+PRAGMA_COLUMNS =
+PRAGMA_SYSTEM_HEADER = #pragma GCC system_header
+PRIPTR_PREFIX = "l"
+PRI_MACROS_BROKEN = 0
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = 0
+PTRDIFF_T_SUFFIX =
+RANLIB = ranlib
+REPLACE_ACOSF = 0
+REPLACE_ASINF = 0
+REPLACE_ATAN2F = 0
+REPLACE_ATANF = 0
+REPLACE_BTOWC = 0
+REPLACE_CALLOC = 0
+REPLACE_CANONICALIZE_FILE_NAME = 0
+REPLACE_CBRTF = 0
+REPLACE_CBRTL = 0
+REPLACE_CEIL = 0
+REPLACE_CEILF = 0
+REPLACE_CEILL = 0
+REPLACE_CHOWN = 0
+REPLACE_CLOSE = 0
+REPLACE_CLOSEDIR = 0
+REPLACE_COSF = 0
+REPLACE_COSHF = 0
+REPLACE_CTIME = GNULIB_PORTCHECK
+REPLACE_DIRFD = 0
+REPLACE_DPRINTF = 0
+REPLACE_DUP = 0
+REPLACE_DUP2 = 0
+REPLACE_EXP2 = 0
+REPLACE_EXP2L = 0
+REPLACE_EXPF = 0
+REPLACE_EXPM1 = 0
+REPLACE_EXPM1F = 0
+REPLACE_FABSL = 0
+REPLACE_FACCESSAT = 0
+REPLACE_FCHOWNAT = 0
+REPLACE_FCLOSE = 0
+REPLACE_FCNTL = 0
+REPLACE_FDOPEN = 0
+REPLACE_FDOPENDIR = 0
+REPLACE_FFLUSH = 0
+REPLACE_FLOOR = 0
+REPLACE_FLOORF = 0
+REPLACE_FLOORL = 0
+REPLACE_FMA = 0
+REPLACE_FMAF = 0
+REPLACE_FMAL = 0
+REPLACE_FMOD = 0
+REPLACE_FMODF = 0
+REPLACE_FMODL = 0
+REPLACE_FOPEN = 0
+REPLACE_FPRINTF = 0
+REPLACE_FPURGE = 0
+REPLACE_FREOPEN = 0
+REPLACE_FREXP = 0
+REPLACE_FREXPF = 0
+REPLACE_FREXPL = 1
+REPLACE_FSEEK = 0
+REPLACE_FSEEKO = 0
+REPLACE_FSTAT = 1
+REPLACE_FSTATAT = 1
+REPLACE_FTELL = 0
+REPLACE_FTELLO = 0
+REPLACE_FTRUNCATE = 0
+REPLACE_FUTIMENS = 1
+REPLACE_GETCWD = 1
+REPLACE_GETDELIM = 0
+REPLACE_GETDOMAINNAME = 0
+REPLACE_GETDTABLESIZE = 0
+REPLACE_GETGROUPS = 0
+REPLACE_GETLINE = 0
+REPLACE_GETLOGIN_R = 0
+REPLACE_GETPAGESIZE = 0
+REPLACE_GETTIMEOFDAY = 0
+REPLACE_GMTIME = 0
+REPLACE_HUGE_VAL = 0
+REPLACE_HYPOT = 0
+REPLACE_HYPOTF = 0
+REPLACE_HYPOTL = 0
+REPLACE_ILOGB = 0
+REPLACE_ILOGBF = 0
+REPLACE_ILOGBL = 0
+REPLACE_ISATTY = 0
+REPLACE_ISFINITE = 0
+REPLACE_ISINF = 0
+REPLACE_ISNAN = 0
+REPLACE_ITOLD = 0
+REPLACE_LCHOWN = 0
+REPLACE_LDEXPL = 0
+REPLACE_LINK = 0
+REPLACE_LINKAT = 0
+REPLACE_LOCALTIME = 0
+REPLACE_LOCALTIME_R = GNULIB_PORTCHECK
+REPLACE_LOG = 0
+REPLACE_LOG10 = 0
+REPLACE_LOG10F = 0
+REPLACE_LOG10L = 0
+REPLACE_LOG1P = 0
+REPLACE_LOG1PF = 0
+REPLACE_LOG1PL = 0
+REPLACE_LOG2 = 0
+REPLACE_LOG2F = 0
+REPLACE_LOG2L = 0
+REPLACE_LOGB = 0
+REPLACE_LOGBF = 0
+REPLACE_LOGBL = 0
+REPLACE_LOGF = 0
+REPLACE_LOGL = 0
+REPLACE_LSEEK = 0
+REPLACE_LSTAT = 1
+REPLACE_MALLOC = 0
+REPLACE_MBRLEN = 0
+REPLACE_MBRTOWC = 0
+REPLACE_MBSINIT = 0
+REPLACE_MBSNRTOWCS = 0
+REPLACE_MBSRTOWCS = 0
+REPLACE_MBSTATE_T = 0
+REPLACE_MBTOWC = 0
+REPLACE_MEMCHR = 0
+REPLACE_MEMMEM = 0
+REPLACE_MKDIR = 0
+REPLACE_MKFIFO = 0
+REPLACE_MKNOD = 0
+REPLACE_MKSTEMP = 0
+REPLACE_MKTIME = GNULIB_PORTCHECK
+REPLACE_MODF = 0
+REPLACE_MODFF = 0
+REPLACE_MODFL = 0
+REPLACE_NAN = 0
+REPLACE_NANOSLEEP = GNULIB_PORTCHECK
+REPLACE_NULL = 0
+REPLACE_OBSTACK_PRINTF = 0
+REPLACE_OPEN = 0
+REPLACE_OPENAT = 0
+REPLACE_OPENDIR = 0
+REPLACE_PERROR = 0
+REPLACE_POPEN = 0
+REPLACE_PREAD = 0
+REPLACE_PRINTF = 0
+REPLACE_PTSNAME = 0
+REPLACE_PTSNAME_R = 0
+REPLACE_PUTENV = 0
+REPLACE_PWRITE = 0
+REPLACE_QSORT_R = 0
+REPLACE_RANDOM_R = 0
+REPLACE_READ = 0
+REPLACE_READLINK = 0
+REPLACE_READLINKAT = 0
+REPLACE_REALLOC = 0
+REPLACE_REALPATH = 0
+REPLACE_REMAINDER = 0
+REPLACE_REMAINDERF = 0
+REPLACE_REMAINDERL = 0
+REPLACE_REMOVE = 0
+REPLACE_RENAME = 1
+REPLACE_RENAMEAT = 1
+REPLACE_RMDIR = 0
+REPLACE_ROUND = 0
+REPLACE_ROUNDF = 0
+REPLACE_ROUNDL = 0
+REPLACE_SETENV = 0
+REPLACE_SIGNBIT = 0
+REPLACE_SIGNBIT_USING_GCC = 1
+REPLACE_SINF = 0
+REPLACE_SINHF = 0
+REPLACE_SLEEP = 0
+REPLACE_SNPRINTF = 0
+REPLACE_SPRINTF = 0
+REPLACE_SQRTF = 0
+REPLACE_SQRTL = 0
+REPLACE_STAT = 0
+REPLACE_STDIO_READ_FUNCS = 0
+REPLACE_STDIO_WRITE_FUNCS = 0
+REPLACE_STPNCPY = 0
+REPLACE_STRCASESTR = 0
+REPLACE_STRCHRNUL = 0
+REPLACE_STRDUP = 0
+REPLACE_STRERROR = 0
+REPLACE_STRERROR_R = 0
+REPLACE_STRFTIME = GNULIB_PORTCHECK
+REPLACE_STRNCAT = 0
+REPLACE_STRNDUP = 0
+REPLACE_STRNLEN = 0
+REPLACE_STRSIGNAL = 0
+REPLACE_STRSTR = 0
+REPLACE_STRTOD = 0
+REPLACE_STRTOIMAX = 0
+REPLACE_STRTOK_R = 0
+REPLACE_STRTOUMAX = 0
+REPLACE_STRUCT_TIMEVAL = 0
+REPLACE_SYMLINK = 0
+REPLACE_SYMLINKAT = 0
+REPLACE_TANF = 0
+REPLACE_TANHF = 0
+REPLACE_TIMEGM = GNULIB_PORTCHECK
+REPLACE_TMPFILE = 0
+REPLACE_TRUNC = 0
+REPLACE_TRUNCATE = 0
+REPLACE_TRUNCF = 0
+REPLACE_TRUNCL = 0
+REPLACE_TTYNAME_R = 0
+REPLACE_TZSET = GNULIB_PORTCHECK
+REPLACE_UNLINK = 0
+REPLACE_UNLINKAT = 0
+REPLACE_UNSETENV = 0
+REPLACE_USLEEP = 0
+REPLACE_UTIME = 0
+REPLACE_UTIMENSAT = 0
+REPLACE_VASPRINTF = 1
+REPLACE_VDPRINTF = 0
+REPLACE_VFPRINTF = 0
+REPLACE_VPRINTF = 0
+REPLACE_VSNPRINTF = 0
+REPLACE_VSPRINTF = 0
+REPLACE_WCRTOMB = 0
+REPLACE_WCSFTIME = 0
+REPLACE_WCSNRTOMBS = 0
+REPLACE_WCSRTOMBS = 0
+REPLACE_WCSWIDTH = 0
+REPLACE_WCTOB = 0
+REPLACE_WCTOMB = 0
+REPLACE_WCWIDTH = 0
+REPLACE_WRITE = 0
+SET_MAKE =
+SHELL = /bin/sh
+SIG_ATOMIC_T_SUFFIX =
+SIZE_T_SUFFIX =
+STDBOOL_H =
+STDDEF_H =
+STDINT_H = stdint.h
+STRIP =
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = 0
+TIME_H_DEFINES_STRUCT_TIMESPEC = 1
+UINT32_MAX_LT_UINTMAX_MAX = 1
+UINT64_MAX_EQ_ULONG_MAX = 1
+UNDEFINE_STRTOK_R = 0
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = 0
+UNISTD_H_HAVE_WINSOCK2_H = 0
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = 0
+UTIME_H =
+VERSION = git
+WCHAR_T_SUFFIX =
+WINDOWS_64_BIT_OFF_T = 0
+WINDOWS_64_BIT_ST_SIZE = 0
+WINDOWS_STAT_INODES = 0
+WINDOWS_STAT_TIMESPEC = 0
+WINT_T_SUFFIX =
+abs_builddir = /net/ptah/export/gentoo/working-repos/portage-utils
+abs_srcdir = /net/ptah/export/gentoo/working-repos/portage-utils
+abs_top_builddir = /net/ptah/export/gentoo/working-repos/portage-utils
+abs_top_srcdir = /net/ptah/export/gentoo/working-repos/portage-utils
+ac_ct_CC = gcc
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-pc-solaris2.11
+build_alias =
+build_cpu = x86_64
+build_os = solaris2.11
+build_vendor = pc
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+gl_LIBOBJS = asnprintf.o asprintf.o chdir-long.o error.o euidaccess.o frexpl.o fstat.o fstatat.o futimens.o getcwd-lgpl.o group-member.o localtime-buffer.o lstat.o mempcpy.o memrchr.o openat-proc.o printf-args.o printf-parse.o rename.o renameat.o vasnprintf.o vasprintf.o
+gl_LTLIBOBJS = asnprintf.lo asprintf.lo chdir-long.lo error.lo euidaccess.lo frexpl.lo fstat.lo fstatat.lo futimens.lo getcwd-lgpl.lo group-member.lo localtime-buffer.lo lstat.lo mempcpy.lo memrchr.lo openat-proc.lo printf-args.lo printf-parse.lo rename.lo renameat.lo vasnprintf.lo vasprintf.lo
+gltests_LIBOBJS =
+gltests_LTLIBOBJS =
+gltests_WITNESS = IN_PORTAGE_UTILS_GNULIB_TESTS
+host = x86_64-pc-solaris2.11
+host_alias =
+host_cpu = x86_64
+host_os = solaris2.11
+host_vendor = pc
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias =
+top_build_prefix =
+top_builddir = .
+top_srcdir = .
+ACLOCAL_AMFLAGS = -I autotools/m4
+SUBDIRS = autotools/gnulib
+portagedir = $(sysconfdir)/portage
+postsyncddir = $(portagedir)/repo.postsync.d
+dist_postsyncd_SCRIPTS = repo.postsync/q-reinit
+q_SOURCES = main.c
+
+# @@@ GEN START @@@ #
+q_CPPFLAGS = -I$(top_builddir)/autotools/gnulib \
+ -I$(top_srcdir)/autotools/gnulib -DAPPLET_q -DAPPLET_qatom \
+ -DAPPLET_qcache -DAPPLET_qcheck -DAPPLET_qdepends \
+ -DAPPLET_qfile -DAPPLET_qgrep -DAPPLET_qlist -DAPPLET_qlop \
+ -DAPPLET_qmerge -DAPPLET_qpkg -DAPPLET_qsearch -DAPPLET_qsize \
+ -DAPPLET_qtbz2 -DAPPLET_quse -DAPPLET_qxpak
+q_LDADD = \
+ $(top_builddir)/autotools/gnulib/libgnu.a \
+ -liniparser \
+ $(LIB_CLOCK_GETTIME) \
+ $(LIB_EACCESS)
+
+TMAKE = \
+ $(MAKE) -C $(abs_top_srcdir)/tests \
+ AUTOTOOLS=true \
+ abs_top_builddir="$(abs_top_builddir)" \
+ abs_top_srcdir="$(abs_top_srcdir)"
+
+
+# Start off with base values which we append below
+dist_man_MANS = man/q.1 man/qatom.1 man/qcache.1 man/qcheck.1 \
+ man/qdepends.1 man/qfile.1 man/qgrep.1 man/qlist.1 man/qlop.1 \
+ man/qmerge.1 man/qpkg.1 man/qsearch.1 man/qsize.1 man/qtbz2.1 \
+ man/quse.1 man/qxpak.1
+APPLETS = q qatom qcache qcheck qdepends qfile qgrep qlist qlop qmerge \
+ qpkg qsearch qsize qtbz2 quse qxpak
+EXTRA_DIST = autotools/m4/gnulib-cache.m4 applets.h config.h \
+ include_applets.h libq/atom_compare.c libq/atom_explode.c \
+ libq/basename.c libq/busybox.h libq/colors.c libq/compat.c \
+ libq/copy_file.c libq/hash_fd.c libq/human_readable.c \
+ libq/i18n.h libq/libq.c libq/libq.h libq/md5_sha1_sum.c \
+ libq/prelink.c libq/profile.c libq/rmspace.c libq/safe_io.c \
+ libq/scandirat.c libq/vdb.c libq/vdb_get_next_dir.c \
+ libq/virtuals.c libq/xarray.c libq/xasprintf.c libq/xchdir.c \
+ libq/xmalloc.c libq/xmkdir.c libq/xregex.c libq/xstrdup.c \
+ libq/xsystem.c main.c main.h porting.h q.c qatom.c qcache.c \
+ qcheck.c qdepends.c qfile.c qglsa.c qgrep.c qlist.c qlop.c \
+ qmerge.c qpkg.c qsearch.c qsize.c qtbz2.c quse.c qxpak.c \
+ tests/Makefile tests/atom_compare/.gitignore \
+ tests/atom_compare/Makefile tests/atom_compare/atom-compare.py \
+ tests/atom_compare/static.good \
+ tests/atom_compare/static.q.good \
+ tests/atom_compare/static.q.tests \
+ tests/atom_compare/static.tests tests/atom_explode/.gitignore \
+ tests/atom_explode/Makefile tests/atom_explode/atom-explode.py \
+ tests/atom_explode/basic.good tests/atom_explode/basic.tests \
+ tests/atom_explode/dotest tests/atom_explode/test.c \
+ tests/copy_file/.gitignore tests/copy_file/Makefile \
+ tests/copy_file/dotest tests/copy_file/test.c tests/init.sh \
+ tests/install/.gitignore tests/install/Makefile \
+ tests/install/dotest tests/mkdir/.gitignore \
+ tests/mkdir/Makefile tests/mkdir/dotest tests/mkdir/test.c \
+ tests/profile/Makefile tests/profile/dotest \
+ tests/profile/profile1/etc/parent.conf \
+ tests/profile/profile1/etc/portage/make.conf \
+ tests/profile/profile1/etc/portage/subdir/file.conf \
+ tests/profile/profile1/etc/portage/this.level.conf \
+ tests/qatom/Makefile tests/qatom/dotest tests/qcheck/Makefile \
+ tests/qcheck/dotest tests/qcheck/list01.good \
+ tests/qcheck/list02.good tests/qcheck/list03.good \
+ tests/qcheck/list04.good tests/qcheck/list05.good \
+ tests/qcheck/list06.good tests/qcheck/list07.good \
+ tests/qcheck/list08.good tests/qcheck/list09.good \
+ tests/qcheck/root/a-b/pkg-1.0/CONTENTS \
+ tests/qcheck/root/a-b/pkg-1.0/SLOT \
+ tests/qcheck/root/a-b/pkg-1.0/repository \
+ tests/qcheck/root/bin/bad-md5 tests/qcheck/root/bin/bad-mtime \
+ tests/qcheck/root/bin/bad-mtime-obj \
+ tests/qcheck/root/bin/bad-sha1 tests/qcheck/root/bin/good-md5 \
+ tests/qcheck/root/bin/good-sha1 \
+ tests/qcheck/root/cat/pkg-1/CONTENTS \
+ tests/qcheck/root/cat/pkg-1/SLOT \
+ tests/qcheck/root/cat/pkg-1/repository tests/qdepends/Makefile \
+ tests/qdepends/dotest tests/qdepends/list01.good \
+ tests/qdepends/list02.good tests/qdepends/list03.good \
+ tests/qdepends/list04.good tests/qdepends/list05.good \
+ tests/qdepends/list06.good tests/qdepends/list07.good \
+ tests/qdepends/list08.good \
+ tests/qdepends/root/app-arch/cpio-2.11/CONTENTS \
+ tests/qdepends/root/app-arch/cpio-2.11/SLOT \
+ tests/qdepends/root/app-arch/cpio-2.11/repository \
+ tests/qdepends/root/x11-apps/xdm-1.1.11-r3/DEPEND \
+ tests/qdepends/root/x11-apps/xdm-1.1.11-r3/RDEPEND \
+ tests/qdepends/root/x11-apps/xdm-1.1.11-r3/USE \
+ tests/qfile/Makefile tests/qfile/dotest tests/qlist/Makefile \
+ tests/qlist/dotest tests/qlist/list01.good \
+ tests/qlist/list02.good tests/qlist/list03.good \
+ tests/qlist/list04.good tests/qlist/list05.good \
+ tests/qlist/list06.good tests/qlist/list07.good \
+ tests/qlist/list08.good tests/qlist/list09.good \
+ tests/qlist/list10.good tests/qlist/list11.good \
+ tests/qlist/list12.good tests/qlist/list13.good \
+ tests/qlist/list14.good tests/qlist/list15.good \
+ tests/qlist/list16.good tests/qlist/root/-merge-foo/CONTENTS \
+ tests/qlist/root/a-b/a-0/CONTENTS \
+ tests/qlist/root/a-b/a-0/SLOT \
+ tests/qlist/root/a-b/a-0/repository \
+ tests/qlist/root/a-b/b-0/CONTENTS \
+ tests/qlist/root/a-b/b-0/SLOT \
+ tests/qlist/root/a-b/b-0/repository \
+ tests/qlist/root/app-arch/cpio-2.11/CONTENTS \
+ tests/qlist/root/app-arch/cpio-2.11/SLOT \
+ tests/qlist/root/app-arch/cpio-2.11/repository \
+ tests/qlist/root/cat/pkg-1/CONTENTS \
+ tests/qlist/root/cat/pkg-1/SLOT \
+ tests/qlist/root/cat/pkg-1/repository \
+ tests/qlist/root/cat/sub-2/CONTENTS \
+ tests/qlist/root/cat/sub-2/SLOT \
+ tests/qlist/root/cat/sub-2/repository \
+ tests/qlist/root/sys-fs/mtools-4.0.13/CONTENTS \
+ tests/qlist/root/sys-fs/mtools-4.0.13/SLOT \
+ tests/qlist/root/sys-fs/mtools-4.0.13/repository \
+ tests/qlop/Makefile tests/qlop/dotest tests/qlop/list01.good \
+ tests/qlop/list02.good tests/qlop/list03.good \
+ tests/qlop/list04.good tests/qlop/list05.good \
+ tests/qlop/list06.good tests/qlop/list07.good \
+ tests/qlop/list08.good tests/qlop/sync.log \
+ tests/qlop/test04.good tests/qmerge/Makefile \
+ tests/qmerge/dotest tests/qmerge/packages/Packages \
+ tests/qmerge/packages/sys-devel/qmerge-test-1.3.tbz2 \
+ tests/qtbz2/Makefile tests/qtbz2/dotest tests/quse/Makefile \
+ tests/quse/dotest tests/quse/list01.good \
+ tests/quse/portdir/profiles/arch.list \
+ tests/quse/portdir/profiles/desc/elibc.desc \
+ tests/quse/portdir/profiles/desc/one.desc \
+ tests/quse/portdir/profiles/desc/two.desc \
+ tests/quse/portdir/profiles/use.desc \
+ tests/quse/portdir/profiles/use.local.desc \
+ tests/qxpak/Makefile tests/qxpak/dotest \
+ tests/qxpak/list01.good tests/qxpak/list02.good \
+ tests/reinitialize/Makefile tests/reinitialize/dotest \
+ tests/rmspace/.gitignore tests/rmspace/Makefile \
+ tests/rmspace/dotest tests/rmspace/test.c \
+ tests/source/Makefile tests/source/dotest tests/source/space \
+ tests/subdir.mk tests/tests.h
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+q$(EXEEXT): $(q_OBJECTS) $(q_DEPENDENCIES) $(EXTRA_q_DEPENDENCIES)
+ @rm -f q$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(q_OBJECTS) $(q_LDADD) $(LIBS)
+install-dist_postsyncdSCRIPTS: $(dist_postsyncd_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ @list='$(dist_postsyncd_SCRIPTS)'; test -n "$(postsyncddir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(postsyncddir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(postsyncddir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(postsyncddir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(postsyncddir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-dist_postsyncdSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_postsyncd_SCRIPTS)'; test -n "$(postsyncddir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ dir='$(DESTDIR)$(postsyncddir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/q-main.Po
+
+.c.o:
+ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# $(AM_V_CC)source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# $(AM_V_CC)source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+q-main.o: main.c
+ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT q-main.o -MD -MP -MF $(DEPDIR)/q-main.Tpo -c -o q-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+ $(AM_V_at)$(am__mv) $(DEPDIR)/q-main.Tpo $(DEPDIR)/q-main.Po
+# $(AM_V_CC)source='main.c' object='q-main.o' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o q-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+
+q-main.obj: main.c
+ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT q-main.obj -MD -MP -MF $(DEPDIR)/q-main.Tpo -c -o q-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+ $(AM_V_at)$(am__mv) $(DEPDIR)/q-main.Tpo $(DEPDIR)/q-main.Po
+# $(AM_V_CC)source='main.c' object='q-main.obj' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o q-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+install-man1: $(dist_man_MANS)
+ @$(NORMAL_INSTALL)
+ @list1=''; \
+ list2='$(dist_man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
distcheck: dist
- rm -rf portage-utils-$(PV)
- tar xf portage-utils-$(PV).tar.xz
- $(MAKE) -C portage-utils-$(PV)
- $(MAKE) -C portage-utils-$(PV) check
- rm -rf portage-utils-$(PV)
-
-clean:
- -rm -f q $(APPLETS)
- $(MAKE) -C tests clean
-distclean: clean testclean
- -rm -f *~ core .#*
- -rm -f `find . -type l`
-
-testclean:
- cd tests && $(MAKE) clean
-
-install: all
- $(MKDIR) $(PREFIX)/bin/
- $(INSTALL_EXE) q $(PREFIX)/bin/
-
- set -e ; \
- for applet in $(filter-out q,$(APPLETS)) ; do \
- ln -sf q $(PREFIX)/bin/$${applet} ; \
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=../.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(postsyncddir)" "$(DESTDIR)$(man1dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-dist_postsyncdSCRIPTS install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_postsyncdSCRIPTS \
+ uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: $(am__recursive_targets) all install-am install-exec-am \
+ install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-binPROGRAMS \
+ clean-cscope clean-generic clean-local cscope cscopelist-am \
+ ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \
+ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-dist_postsyncdSCRIPTS install-dvi install-dvi-am \
+ install-exec install-exec-am install-exec-hook install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man1 install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-binPROGRAMS \
+ uninstall-dist_postsyncdSCRIPTS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
+
+
+install-exec-hook:
+ cd $(DESTDIR)$(bindir); \
+ for applet in $(APPLETS) ; do \
+ [ ! -e "$$applet" ] && ln -s q $${applet} ; \
done
+check-hook:
+ $(TMAKE) check
+clean-local:
+ $(TMAKE) clean
+ -rmdir tests/*/ tests/
+ rm -f $(APPLETS)
+check: check-hook
+# @@@ GEN START @@@ #
- $(MKDIR) $(ETCDIR)/portage/repo.postsync.d
- $(INSTALL_EXE) repo.postsync/* $(ETCDIR)/portage/repo.postsync.d/
-
-ifneq ($(wildcard man/*.1),)
- $(MKDIR) $(PREFIX)/share/man/man1/
- cp $(wildcard man/*.1) $(PREFIX)/share/man/man1/
-endif
-
- $(MKDIR) $(PREFIX)/share/doc/$(PF)
- cp $(DOCS) $(PREFIX)/share/doc/$(PF)/
-
-man: q
- ./man/mkman.py
-
-symlinks: q
- ./q --install
-
--include .depend
-
-.PHONY: all check clean debug dist distclean install man symlinks testclean
-
-#
-# All logic related to autotools is below here
-#
-GEN_MARK_START = \# @@@ GEN START @@@ \#
-GEN_MARK_END = \# @@@ GEN START @@@ \#
-EXTRA_DIST = \
- $(SRC) \
- qglsa.c \
- $(wildcard libq/*.c *.h libq/*.h) \
- $(shell find tests -type f)
-MAKE_MULTI_LINES = $(patsubst %,\\\\\n\t%,$(sort $(1)))
-# 2nd level of indirection here is so the $(find) doesn't pick up
-# files in EXTRA_DIST that get cleaned up ...
-autotools-update: clean
- $(MAKE) _autotools-update
-_autotools-update:
- sed -i '/^$(GEN_MARK_START)$$/,/^$(GEN_MARK_END)$$/d' Makefile.am
- printf '%s\nq_CPPFLAGS += %b\ndist_man_MANS += %b\nAPPLETS += %b\nEXTRA_DIST += %b\n%s\n' \
- "$(GEN_MARK_START)" \
- "$(call MAKE_MULTI_LINES,$(APP_FLAGS))" \
- "$(call MAKE_MULTI_LINES,$(wildcard man/*.1))" \
- "$(call MAKE_MULTI_LINES,$(APPLETS))" \
- "$(call MAKE_MULTI_LINES,$(EXTRA_DIST))" \
- "$(GEN_MARK_END)" \
- >> Makefile.am
-autotools: autotools-update
- ./autogen.sh --from=make
-
-.PHONY: autotools autotools-update _autotools-update
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/qlop.c b/qlop.c
index 7bac8c2..a042fa7 100644
--- a/qlop.c
+++ b/qlop.c
@@ -760,10 +760,10 @@ parse_date(const char *sdate, time_t *t)
if (ret < 2) {
if (strcmp(sdate, "today") == 0) {
- num = 0;
+ num = 1;
snprintf(dur, len, "%s", "day");
} else if (strcmp(sdate, "yesterday") == 0) {
- num = 1;
+ num = 2;
snprintf(dur, len, "%s", "day");
} else {
return false;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-15 15:41 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-15 15:41 UTC (permalink / raw
To: gentoo-commits
commit: ce88951da19eb0b82d53fc18764afeed845a3626
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 15 15:41:00 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Apr 15 15:41:00 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ce88951d
Makefile: revert to non-autotools version
This reverts the accidential commit to Makefile from
054b993a9433a45c00086fb2841a8150d85eb437.
Makefile | 2466 +++++---------------------------------------------------------
1 file changed, 165 insertions(+), 2301 deletions(-)
diff --git a/Makefile b/Makefile
index bcde52c..2afb67d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2304 +1,168 @@
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
-# Makefile. Generated from Makefile.in by configure.
-
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-
-
-
-am__is_gnu_make = { \
- if test -z '$(MAKELEVEL)'; then \
- false; \
- elif test -n '$(MAKE_HOST)'; then \
- true; \
- elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
- true; \
- else \
- false; \
- fi; \
-}
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/portage-utils
-pkgincludedir = $(includedir)/portage-utils
-pkglibdir = $(libdir)/portage-utils
-pkglibexecdir = $(libexecdir)/portage-utils
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = x86_64-pc-solaris2.11
-host_triplet = x86_64-pc-solaris2.11
-bin_PROGRAMS = q$(EXEEXT)
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/autotools/m4/00gnulib.m4 \
- $(top_srcdir)/autotools/m4/absolute-header.m4 \
- $(top_srcdir)/autotools/m4/alloca.m4 \
- $(top_srcdir)/autotools/m4/canonicalize.m4 \
- $(top_srcdir)/autotools/m4/chdir-long.m4 \
- $(top_srcdir)/autotools/m4/clock_time.m4 \
- $(top_srcdir)/autotools/m4/close.m4 \
- $(top_srcdir)/autotools/m4/closedir.m4 \
- $(top_srcdir)/autotools/m4/dirent_h.m4 \
- $(top_srcdir)/autotools/m4/dirfd.m4 \
- $(top_srcdir)/autotools/m4/dirname.m4 \
- $(top_srcdir)/autotools/m4/double-slash-root.m4 \
- $(top_srcdir)/autotools/m4/dup.m4 \
- $(top_srcdir)/autotools/m4/dup2.m4 \
- $(top_srcdir)/autotools/m4/eealloc.m4 \
- $(top_srcdir)/autotools/m4/errno_h.m4 \
- $(top_srcdir)/autotools/m4/error.m4 \
- $(top_srcdir)/autotools/m4/euidaccess.m4 \
- $(top_srcdir)/autotools/m4/exponentd.m4 \
- $(top_srcdir)/autotools/m4/exponentf.m4 \
- $(top_srcdir)/autotools/m4/exponentl.m4 \
- $(top_srcdir)/autotools/m4/extensions.m4 \
- $(top_srcdir)/autotools/m4/extern-inline.m4 \
- $(top_srcdir)/autotools/m4/faccessat.m4 \
- $(top_srcdir)/autotools/m4/fchdir.m4 \
- $(top_srcdir)/autotools/m4/fcntl-o.m4 \
- $(top_srcdir)/autotools/m4/fcntl.m4 \
- $(top_srcdir)/autotools/m4/fcntl_h.m4 \
- $(top_srcdir)/autotools/m4/fdopendir.m4 \
- $(top_srcdir)/autotools/m4/filenamecat.m4 \
- $(top_srcdir)/autotools/m4/float_h.m4 \
- $(top_srcdir)/autotools/m4/fpieee.m4 \
- $(top_srcdir)/autotools/m4/frexp.m4 \
- $(top_srcdir)/autotools/m4/frexpl.m4 \
- $(top_srcdir)/autotools/m4/fstat.m4 \
- $(top_srcdir)/autotools/m4/fstatat.m4 \
- $(top_srcdir)/autotools/m4/futimens.m4 \
- $(top_srcdir)/autotools/m4/getcwd.m4 \
- $(top_srcdir)/autotools/m4/getdelim.m4 \
- $(top_srcdir)/autotools/m4/getdtablesize.m4 \
- $(top_srcdir)/autotools/m4/getgroups.m4 \
- $(top_srcdir)/autotools/m4/getline.m4 \
- $(top_srcdir)/autotools/m4/getopt.m4 \
- $(top_srcdir)/autotools/m4/getprogname.m4 \
- $(top_srcdir)/autotools/m4/gettime.m4 \
- $(top_srcdir)/autotools/m4/gettimeofday.m4 \
- $(top_srcdir)/autotools/m4/gnulib-common.m4 \
- $(top_srcdir)/autotools/m4/gnulib-comp.m4 \
- $(top_srcdir)/autotools/m4/group-member.m4 \
- $(top_srcdir)/autotools/m4/include_next.m4 \
- $(top_srcdir)/autotools/m4/intmax_t.m4 \
- $(top_srcdir)/autotools/m4/inttypes-pri.m4 \
- $(top_srcdir)/autotools/m4/inttypes.m4 \
- $(top_srcdir)/autotools/m4/inttypes_h.m4 \
- $(top_srcdir)/autotools/m4/isnand.m4 \
- $(top_srcdir)/autotools/m4/isnanf.m4 \
- $(top_srcdir)/autotools/m4/isnanl.m4 \
- $(top_srcdir)/autotools/m4/largefile.m4 \
- $(top_srcdir)/autotools/m4/ldexpl.m4 \
- $(top_srcdir)/autotools/m4/limits-h.m4 \
- $(top_srcdir)/autotools/m4/localtime-buffer.m4 \
- $(top_srcdir)/autotools/m4/longlong.m4 \
- $(top_srcdir)/autotools/m4/lstat.m4 \
- $(top_srcdir)/autotools/m4/malloc.m4 \
- $(top_srcdir)/autotools/m4/malloca.m4 \
- $(top_srcdir)/autotools/m4/math_h.m4 \
- $(top_srcdir)/autotools/m4/memchr.m4 \
- $(top_srcdir)/autotools/m4/mempcpy.m4 \
- $(top_srcdir)/autotools/m4/memrchr.m4 \
- $(top_srcdir)/autotools/m4/mkdir.m4 \
- $(top_srcdir)/autotools/m4/mkdirat.m4 \
- $(top_srcdir)/autotools/m4/mmap-anon.m4 \
- $(top_srcdir)/autotools/m4/mode_t.m4 \
- $(top_srcdir)/autotools/m4/msvc-inval.m4 \
- $(top_srcdir)/autotools/m4/msvc-nothrow.m4 \
- $(top_srcdir)/autotools/m4/multiarch.m4 \
- $(top_srcdir)/autotools/m4/nocrash.m4 \
- $(top_srcdir)/autotools/m4/off_t.m4 \
- $(top_srcdir)/autotools/m4/open-cloexec.m4 \
- $(top_srcdir)/autotools/m4/open.m4 \
- $(top_srcdir)/autotools/m4/openat.m4 \
- $(top_srcdir)/autotools/m4/opendir.m4 \
- $(top_srcdir)/autotools/m4/pathmax.m4 \
- $(top_srcdir)/autotools/m4/printf-frexp.m4 \
- $(top_srcdir)/autotools/m4/printf-frexpl.m4 \
- $(top_srcdir)/autotools/m4/printf.m4 \
- $(top_srcdir)/autotools/m4/readlink.m4 \
- $(top_srcdir)/autotools/m4/readlinkat.m4 \
- $(top_srcdir)/autotools/m4/realloc.m4 \
- $(top_srcdir)/autotools/m4/rename.m4 \
- $(top_srcdir)/autotools/m4/renameat.m4 \
- $(top_srcdir)/autotools/m4/rmdir.m4 \
- $(top_srcdir)/autotools/m4/save-cwd.m4 \
- $(top_srcdir)/autotools/m4/signbit.m4 \
- $(top_srcdir)/autotools/m4/size_max.m4 \
- $(top_srcdir)/autotools/m4/ssize_t.m4 \
- $(top_srcdir)/autotools/m4/stat-time.m4 \
- $(top_srcdir)/autotools/m4/stat.m4 \
- $(top_srcdir)/autotools/m4/stdbool.m4 \
- $(top_srcdir)/autotools/m4/stddef_h.m4 \
- $(top_srcdir)/autotools/m4/stdint.m4 \
- $(top_srcdir)/autotools/m4/stdint_h.m4 \
- $(top_srcdir)/autotools/m4/stdio_h.m4 \
- $(top_srcdir)/autotools/m4/stdlib_h.m4 \
- $(top_srcdir)/autotools/m4/stpcpy.m4 \
- $(top_srcdir)/autotools/m4/strcase.m4 \
- $(top_srcdir)/autotools/m4/strcasestr.m4 \
- $(top_srcdir)/autotools/m4/strdup.m4 \
- $(top_srcdir)/autotools/m4/strerror.m4 \
- $(top_srcdir)/autotools/m4/string_h.m4 \
- $(top_srcdir)/autotools/m4/strings_h.m4 \
- $(top_srcdir)/autotools/m4/strncat.m4 \
- $(top_srcdir)/autotools/m4/symlink.m4 \
- $(top_srcdir)/autotools/m4/symlinkat.m4 \
- $(top_srcdir)/autotools/m4/sys_socket_h.m4 \
- $(top_srcdir)/autotools/m4/sys_stat_h.m4 \
- $(top_srcdir)/autotools/m4/sys_time_h.m4 \
- $(top_srcdir)/autotools/m4/sys_types_h.m4 \
- $(top_srcdir)/autotools/m4/time_h.m4 \
- $(top_srcdir)/autotools/m4/timespec.m4 \
- $(top_srcdir)/autotools/m4/unistd-safer.m4 \
- $(top_srcdir)/autotools/m4/unistd_h.m4 \
- $(top_srcdir)/autotools/m4/unlink.m4 \
- $(top_srcdir)/autotools/m4/unlinkat.m4 \
- $(top_srcdir)/autotools/m4/utime.m4 \
- $(top_srcdir)/autotools/m4/utime_h.m4 \
- $(top_srcdir)/autotools/m4/utimens.m4 \
- $(top_srcdir)/autotools/m4/utimensat.m4 \
- $(top_srcdir)/autotools/m4/utimes.m4 \
- $(top_srcdir)/autotools/m4/vasnprintf.m4 \
- $(top_srcdir)/autotools/m4/vasprintf-posix.m4 \
- $(top_srcdir)/autotools/m4/vasprintf.m4 \
- $(top_srcdir)/autotools/m4/warn-on-use.m4 \
- $(top_srcdir)/autotools/m4/wchar_h.m4 \
- $(top_srcdir)/autotools/m4/wchar_t.m4 \
- $(top_srcdir)/autotools/m4/wint_t.m4 \
- $(top_srcdir)/autotools/m4/xsize.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
- $(am__configure_deps) $(dist_postsyncd_SCRIPTS) \
- $(am__DIST_COMMON)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(postsyncddir)" \
- "$(DESTDIR)$(man1dir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_q_OBJECTS = q-main.$(OBJEXT)
-q_OBJECTS = $(am_q_OBJECTS)
-am__DEPENDENCIES_1 =
-q_DEPENDENCIES = $(top_builddir)/autotools/gnulib/libgnu.a \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-SCRIPTS = $(dist_postsyncd_SCRIPTS)
-AM_V_P = $(am__v_P_$(V))
-am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.
-depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
-am__v_lt_0 = --silent
-am__v_lt_1 =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(q_SOURCES)
-DIST_SOURCES = $(q_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-man1dir = $(mandir)/man1
-NROFF = nroff
-MANS = $(dist_man_MANS)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.h.in
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
- $(srcdir)/config.h.in $(top_srcdir)/autotools/compile \
- $(top_srcdir)/autotools/config.guess \
- $(top_srcdir)/autotools/config.sub \
- $(top_srcdir)/autotools/depcomp \
- $(top_srcdir)/autotools/install-sh \
- $(top_srcdir)/autotools/missing COPYING autotools/compile \
- autotools/config.guess autotools/config.sub autotools/depcomp \
- autotools/install-sh autotools/missing
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__post_remove_distdir = $(am__remove_distdir)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-GZIP_ENV = --best
-DIST_ARCHIVES = $(distdir).tar.xz
-DIST_TARGETS = dist-xz
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing aclocal-1.15
-ALLOCA =
-ALLOCA_H = alloca.h
-AMTAR = $${TAR-tar}
-AM_DEFAULT_VERBOSITY = 0
-APPLE_UNIVERSAL_BUILD = 0
-AR = ar
-ARFLAGS = cr
-AUTOCONF = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing autoconf
-AUTOHEADER = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing autoheader
-AUTOMAKE = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing automake-1.15
-AWK = gawk
-BITSIZEOF_PTRDIFF_T =
-BITSIZEOF_SIG_ATOMIC_T =
-BITSIZEOF_SIZE_T =
-BITSIZEOF_WCHAR_T =
-BITSIZEOF_WINT_T =
-CC = gcc
-CCDEPMODE = depmode=gcc3
-CFLAGS = -g -O2 -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings -Wbad-function-cast -Wnested-externs -Wcomment -Winline -Wchar-subscripts -Wcast-align -Wno-format-nonliteral -Wsequence-point -Wold-style-definition -Wextra
-CPP = gcc -E
-CPPFLAGS =
-CYGPATH_W = echo
-DEFS = -DHAVE_CONFIG_H
-DEPDIR = .deps
-ECHO_C = \c
-ECHO_N =
-ECHO_T =
-EGREP = /gentoo/prefix64/usr/bin/grep -E
-EMULTIHOP_HIDDEN =
-EMULTIHOP_VALUE =
-ENOLINK_HIDDEN =
-ENOLINK_VALUE =
-EOVERFLOW_HIDDEN =
-EOVERFLOW_VALUE =
-ERRNO_H =
-EXEEXT =
-FLOAT_H =
-GETOPT_CDEFS_H =
-GETOPT_H =
-GNULIB_ACOSF = 0
-GNULIB_ACOSL = 0
-GNULIB_ALPHASORT = 0
-GNULIB_ASINF = 0
-GNULIB_ASINL = 0
-GNULIB_ATAN2F = 0
-GNULIB_ATANF = 0
-GNULIB_ATANL = 0
-GNULIB_ATOLL = 0
-GNULIB_BTOWC = 0
-GNULIB_CALLOC_POSIX = 0
-GNULIB_CANONICALIZE_FILE_NAME = 1
-GNULIB_CBRT = 0
-GNULIB_CBRTF = 0
-GNULIB_CBRTL = 0
-GNULIB_CEIL = 0
-GNULIB_CEILF = 0
-GNULIB_CEILL = 0
-GNULIB_CHDIR = 1
-GNULIB_CHOWN = 0
-GNULIB_CLOSE = 1
-GNULIB_CLOSEDIR = 1
-GNULIB_COPYSIGN = 0
-GNULIB_COPYSIGNF = 0
-GNULIB_COPYSIGNL = 0
-GNULIB_COSF = 0
-GNULIB_COSHF = 0
-GNULIB_COSL = 0
-GNULIB_CTIME = 0
-GNULIB_DIRFD = 1
-GNULIB_DPRINTF = 0
-GNULIB_DUP = 1
-GNULIB_DUP2 = 1
-GNULIB_DUP3 = 0
-GNULIB_ENVIRON = 0
-GNULIB_EUIDACCESS = 1
-GNULIB_EXP2 = 0
-GNULIB_EXP2F = 0
-GNULIB_EXP2L = 0
-GNULIB_EXPF = 0
-GNULIB_EXPL = 0
-GNULIB_EXPLICIT_BZERO = 0
-GNULIB_EXPM1 = 0
-GNULIB_EXPM1F = 0
-GNULIB_EXPM1L = 0
-GNULIB_FABSF = 0
-GNULIB_FABSL = 0
-GNULIB_FACCESSAT = 1
-GNULIB_FCHDIR = 1
-GNULIB_FCHMODAT = 0
-GNULIB_FCHOWNAT = 0
-GNULIB_FCLOSE = 0
-GNULIB_FCNTL = 1
-GNULIB_FDATASYNC = 0
-GNULIB_FDOPEN = 0
-GNULIB_FDOPENDIR = 1
-GNULIB_FFLUSH = 0
-GNULIB_FFS = 0
-GNULIB_FFSL = 0
-GNULIB_FFSLL = 0
-GNULIB_FGETC = 1
-GNULIB_FGETS = 1
-GNULIB_FLOOR = 0
-GNULIB_FLOORF = 0
-GNULIB_FLOORL = 0
-GNULIB_FMA = 0
-GNULIB_FMAF = 0
-GNULIB_FMAL = 0
-GNULIB_FMOD = 0
-GNULIB_FMODF = 0
-GNULIB_FMODL = 0
-GNULIB_FOPEN = 0
-GNULIB_FPRINTF = 1
-GNULIB_FPRINTF_POSIX = 0
-GNULIB_FPURGE = 0
-GNULIB_FPUTC = 1
-GNULIB_FPUTS = 1
-GNULIB_FREAD = 1
-GNULIB_FREOPEN = 0
-GNULIB_FREXP = 1
-GNULIB_FREXPF = 0
-GNULIB_FREXPL = 1
-GNULIB_FSCANF = 1
-GNULIB_FSEEK = 0
-GNULIB_FSEEKO = 0
-GNULIB_FSTAT = 1
-GNULIB_FSTATAT = 1
-GNULIB_FSYNC = 0
-GNULIB_FTELL = 0
-GNULIB_FTELLO = 0
-GNULIB_FTRUNCATE = 0
-GNULIB_FUTIMENS = 1
-GNULIB_FWRITE = 1
-GNULIB_GETC = 1
-GNULIB_GETCHAR = 1
-GNULIB_GETCWD = 1
-GNULIB_GETDELIM = 1
-GNULIB_GETDOMAINNAME = 0
-GNULIB_GETDTABLESIZE = 1
-GNULIB_GETGROUPS = 1
-GNULIB_GETHOSTNAME = 0
-GNULIB_GETLINE = 1
-GNULIB_GETLOADAVG = 0
-GNULIB_GETLOGIN = 0
-GNULIB_GETLOGIN_R = 0
-GNULIB_GETPAGESIZE = 0
-GNULIB_GETSUBOPT = 0
-GNULIB_GETTIMEOFDAY = 1
-GNULIB_GETUSERSHELL = 0
-GNULIB_GL_UNISTD_H_GETOPT =
-GNULIB_GRANTPT = 0
-GNULIB_GROUP_MEMBER = 1
-GNULIB_HYPOT = 0
-GNULIB_HYPOTF = 0
-GNULIB_HYPOTL = 0
-GNULIB_ILOGB = 0
-GNULIB_ILOGBF = 0
-GNULIB_ILOGBL = 0
-GNULIB_IMAXABS = 0
-GNULIB_IMAXDIV = 0
-GNULIB_ISATTY = 0
-GNULIB_ISFINITE = 0
-GNULIB_ISINF = 0
-GNULIB_ISNAN = 0
-GNULIB_ISNAND = 0
-GNULIB_ISNANF = 0
-GNULIB_ISNANL = 0
-GNULIB_LCHMOD = 0
-GNULIB_LCHOWN = 0
-GNULIB_LDEXPF = 0
-GNULIB_LDEXPL = 0
-GNULIB_LINK = 0
-GNULIB_LINKAT = 0
-GNULIB_LOCALTIME = 0
-GNULIB_LOG = 0
-GNULIB_LOG10 = 0
-GNULIB_LOG10F = 0
-GNULIB_LOG10L = 0
-GNULIB_LOG1P = 0
-GNULIB_LOG1PF = 0
-GNULIB_LOG1PL = 0
-GNULIB_LOG2 = 0
-GNULIB_LOG2F = 0
-GNULIB_LOG2L = 0
-GNULIB_LOGB = 0
-GNULIB_LOGBF = 0
-GNULIB_LOGBL = 0
-GNULIB_LOGF = 0
-GNULIB_LOGL = 0
-GNULIB_LSEEK = 0
-GNULIB_LSTAT = 1
-GNULIB_MALLOC_POSIX = 1
-GNULIB_MBRLEN = 0
-GNULIB_MBRTOWC = 0
-GNULIB_MBSCASECMP = 0
-GNULIB_MBSCASESTR = 0
-GNULIB_MBSCHR = 0
-GNULIB_MBSCSPN = 0
-GNULIB_MBSINIT = 0
-GNULIB_MBSLEN = 0
-GNULIB_MBSNCASECMP = 0
-GNULIB_MBSNLEN = 0
-GNULIB_MBSNRTOWCS = 0
-GNULIB_MBSPBRK = 0
-GNULIB_MBSPCASECMP = 0
-GNULIB_MBSRCHR = 0
-GNULIB_MBSRTOWCS = 0
-GNULIB_MBSSEP = 0
-GNULIB_MBSSPN = 0
-GNULIB_MBSSTR = 0
-GNULIB_MBSTOK_R = 0
-GNULIB_MBTOWC = 0
-GNULIB_MEMCHR = 1
-GNULIB_MEMMEM = 0
-GNULIB_MEMPCPY = 1
-GNULIB_MEMRCHR = 1
-GNULIB_MKDIRAT = 1
-GNULIB_MKDTEMP = 0
-GNULIB_MKFIFO = 0
-GNULIB_MKFIFOAT = 0
-GNULIB_MKNOD = 0
-GNULIB_MKNODAT = 0
-GNULIB_MKOSTEMP = 0
-GNULIB_MKOSTEMPS = 0
-GNULIB_MKSTEMP = 0
-GNULIB_MKSTEMPS = 0
-GNULIB_MKTIME = 0
-GNULIB_MODF = 0
-GNULIB_MODFF = 0
-GNULIB_MODFL = 0
-GNULIB_NANOSLEEP = 0
-GNULIB_NONBLOCKING = 0
-GNULIB_OBSTACK_PRINTF = 0
-GNULIB_OBSTACK_PRINTF_POSIX = 0
-GNULIB_OPEN = 1
-GNULIB_OPENAT = 1
-GNULIB_OPENDIR = 1
-GNULIB_OVERRIDES_STRUCT_STAT = 0
-GNULIB_OVERRIDES_WINT_T = 0
-GNULIB_PCLOSE = 0
-GNULIB_PERROR = 0
-GNULIB_PIPE = 0
-GNULIB_PIPE2 = 0
-GNULIB_POPEN = 0
-GNULIB_POSIX_OPENPT = 0
-GNULIB_POWF = 0
-GNULIB_PREAD = 0
-GNULIB_PRINTF = 1
-GNULIB_PRINTF_POSIX = 0
-GNULIB_PTSNAME = 0
-GNULIB_PTSNAME_R = 0
-GNULIB_PUTC = 1
-GNULIB_PUTCHAR = 1
-GNULIB_PUTENV = 0
-GNULIB_PUTS = 1
-GNULIB_PWRITE = 0
-GNULIB_QSORT_R = 0
-GNULIB_RANDOM = 0
-GNULIB_RANDOM_R = 0
-GNULIB_RAWMEMCHR = 0
-GNULIB_READ = 0
-GNULIB_READDIR = 0
-GNULIB_READLINK = 1
-GNULIB_READLINKAT = 1
-GNULIB_REALLOCARRAY = 0
-GNULIB_REALLOC_POSIX = 1
-GNULIB_REALPATH = 1
-GNULIB_REMAINDER = 0
-GNULIB_REMAINDERF = 0
-GNULIB_REMAINDERL = 0
-GNULIB_REMOVE = 0
-GNULIB_RENAME = 1
-GNULIB_RENAMEAT = 1
-GNULIB_REWINDDIR = 0
-GNULIB_RINT = 0
-GNULIB_RINTF = 0
-GNULIB_RINTL = 0
-GNULIB_RMDIR = 1
-GNULIB_ROUND = 0
-GNULIB_ROUNDF = 0
-GNULIB_ROUNDL = 0
-GNULIB_RPMATCH = 0
-GNULIB_SCANDIR = 0
-GNULIB_SCANF = 1
-GNULIB_SECURE_GETENV = 0
-GNULIB_SETENV = 0
-GNULIB_SETHOSTNAME = 0
-GNULIB_SIGNBIT = 1
-GNULIB_SINF = 0
-GNULIB_SINHF = 0
-GNULIB_SINL = 0
-GNULIB_SLEEP = 0
-GNULIB_SNPRINTF = 0
-GNULIB_SPRINTF_POSIX = 0
-GNULIB_SQRTF = 0
-GNULIB_SQRTL = 0
-GNULIB_STAT = 1
-GNULIB_STDIO_H_NONBLOCKING = 0
-GNULIB_STDIO_H_SIGPIPE = 0
-GNULIB_STPCPY = 1
-GNULIB_STPNCPY = 0
-GNULIB_STRCASESTR = 1
-GNULIB_STRCHRNUL = 0
-GNULIB_STRDUP = 1
-GNULIB_STRERROR = 1
-GNULIB_STRERROR_R = 0
-GNULIB_STRFTIME = 0
-GNULIB_STRNCAT = 1
-GNULIB_STRNDUP = 0
-GNULIB_STRNLEN = 0
-GNULIB_STRPBRK = 0
-GNULIB_STRPTIME = 0
-GNULIB_STRSEP = 0
-GNULIB_STRSIGNAL = 0
-GNULIB_STRSTR = 0
-GNULIB_STRTOD = 0
-GNULIB_STRTOIMAX = 0
-GNULIB_STRTOK_R = 0
-GNULIB_STRTOLL = 0
-GNULIB_STRTOULL = 0
-GNULIB_STRTOUMAX = 0
-GNULIB_STRVERSCMP = 0
-GNULIB_SYMLINK = 1
-GNULIB_SYMLINKAT = 1
-GNULIB_SYSTEM_POSIX = 0
-GNULIB_TANF = 0
-GNULIB_TANHF = 0
-GNULIB_TANL = 0
-GNULIB_TIMEGM = 0
-GNULIB_TIME_R = 0
-GNULIB_TIME_RZ = 0
-GNULIB_TMPFILE = 0
-GNULIB_TRUNC = 0
-GNULIB_TRUNCATE = 0
-GNULIB_TRUNCF = 0
-GNULIB_TRUNCL = 0
-GNULIB_TTYNAME_R = 0
-GNULIB_TZSET = 0
-GNULIB_UNISTD_H_NONBLOCKING = 0
-GNULIB_UNISTD_H_SIGPIPE = 0
-GNULIB_UNLINK = 1
-GNULIB_UNLINKAT = 1
-GNULIB_UNLOCKPT = 0
-GNULIB_UNSETENV = 0
-GNULIB_USLEEP = 0
-GNULIB_UTIME = 1
-GNULIB_UTIMENSAT = 1
-GNULIB_VASPRINTF = 1
-GNULIB_VDPRINTF = 0
-GNULIB_VFPRINTF = 1
-GNULIB_VFPRINTF_POSIX = 0
-GNULIB_VFSCANF = 0
-GNULIB_VPRINTF = 1
-GNULIB_VPRINTF_POSIX = 0
-GNULIB_VSCANF = 0
-GNULIB_VSNPRINTF = 0
-GNULIB_VSPRINTF_POSIX = 0
-GNULIB_WCPCPY = 0
-GNULIB_WCPNCPY = 0
-GNULIB_WCRTOMB = 0
-GNULIB_WCSCASECMP = 0
-GNULIB_WCSCAT = 0
-GNULIB_WCSCHR = 0
-GNULIB_WCSCMP = 0
-GNULIB_WCSCOLL = 0
-GNULIB_WCSCPY = 0
-GNULIB_WCSCSPN = 0
-GNULIB_WCSDUP = 0
-GNULIB_WCSFTIME = 0
-GNULIB_WCSLEN = 0
-GNULIB_WCSNCASECMP = 0
-GNULIB_WCSNCAT = 0
-GNULIB_WCSNCMP = 0
-GNULIB_WCSNCPY = 0
-GNULIB_WCSNLEN = 0
-GNULIB_WCSNRTOMBS = 0
-GNULIB_WCSPBRK = 0
-GNULIB_WCSRCHR = 0
-GNULIB_WCSRTOMBS = 0
-GNULIB_WCSSPN = 0
-GNULIB_WCSSTR = 0
-GNULIB_WCSTOK = 0
-GNULIB_WCSWIDTH = 0
-GNULIB_WCSXFRM = 0
-GNULIB_WCTOB = 0
-GNULIB_WCTOMB = 0
-GNULIB_WCWIDTH = 0
-GNULIB_WMEMCHR = 0
-GNULIB_WMEMCMP = 0
-GNULIB_WMEMCPY = 0
-GNULIB_WMEMMOVE = 0
-GNULIB_WMEMSET = 0
-GNULIB_WRITE = 0
-GNULIB__EXIT = 0
-GREP = /gentoo/prefix64/usr/bin/grep
-HAVE_ACOSF = 1
-HAVE_ACOSL = 1
-HAVE_ALPHASORT = 1
-HAVE_ASINF = 1
-HAVE_ASINL = 1
-HAVE_ATAN2F = 1
-HAVE_ATANF = 1
-HAVE_ATANL = 1
-HAVE_ATOLL = 1
-HAVE_BTOWC = 1
-HAVE_C99_STDINT_H = 1
-HAVE_CANONICALIZE_FILE_NAME = 1
-HAVE_CBRT = 1
-HAVE_CBRTF = 1
-HAVE_CBRTL = 1
-HAVE_CHOWN = 1
-HAVE_CLOSEDIR = 1
-HAVE_COPYSIGN = 1
-HAVE_COPYSIGNL = 1
-HAVE_COSF = 1
-HAVE_COSHF = 1
-HAVE_COSL = 1
-HAVE_CRTDEFS_H = 0
-HAVE_DECL_ACOSL = 1
-HAVE_DECL_ASINL = 1
-HAVE_DECL_ATANL = 1
-HAVE_DECL_CBRTF = 1
-HAVE_DECL_CBRTL = 1
-HAVE_DECL_CEILF = 1
-HAVE_DECL_CEILL = 1
-HAVE_DECL_COPYSIGNF = 1
-HAVE_DECL_COSL = 1
-HAVE_DECL_DIRFD = 1
-HAVE_DECL_ENVIRON = 1
-HAVE_DECL_EXP2 = 1
-HAVE_DECL_EXP2F = 1
-HAVE_DECL_EXP2L = 1
-HAVE_DECL_EXPL = 1
-HAVE_DECL_EXPM1L = 1
-HAVE_DECL_FCHDIR = 1
-HAVE_DECL_FDATASYNC = 1
-HAVE_DECL_FDOPENDIR = 1
-HAVE_DECL_FLOORF = 1
-HAVE_DECL_FLOORL = 1
-HAVE_DECL_FPURGE = 1
-HAVE_DECL_FREXPL = 1
-HAVE_DECL_FSEEKO = 1
-HAVE_DECL_FTELLO = 1
-HAVE_DECL_GETDELIM = 1
-HAVE_DECL_GETDOMAINNAME = 1
-HAVE_DECL_GETLINE = 1
-HAVE_DECL_GETLOADAVG = 1
-HAVE_DECL_GETLOGIN = 1
-HAVE_DECL_GETLOGIN_R = 1
-HAVE_DECL_GETPAGESIZE = 1
-HAVE_DECL_GETUSERSHELL = 1
-HAVE_DECL_IMAXABS = 1
-HAVE_DECL_IMAXDIV = 1
-HAVE_DECL_INITSTATE = 1
-HAVE_DECL_LDEXPL = 1
-HAVE_DECL_LOCALTIME_R = 1
-HAVE_DECL_LOG10L = 1
-HAVE_DECL_LOG2 = 1
-HAVE_DECL_LOG2F = 1
-HAVE_DECL_LOG2L = 1
-HAVE_DECL_LOGB = 1
-HAVE_DECL_LOGL = 1
-HAVE_DECL_MEMMEM = 1
-HAVE_DECL_MEMRCHR = 0
-HAVE_DECL_OBSTACK_PRINTF = 1
-HAVE_DECL_REMAINDER = 1
-HAVE_DECL_REMAINDERL = 1
-HAVE_DECL_RINTF = 1
-HAVE_DECL_ROUND = 1
-HAVE_DECL_ROUNDF = 1
-HAVE_DECL_ROUNDL = 1
-HAVE_DECL_SETENV = 1
-HAVE_DECL_SETHOSTNAME = 1
-HAVE_DECL_SETSTATE = 1
-HAVE_DECL_SINL = 1
-HAVE_DECL_SNPRINTF = 1
-HAVE_DECL_SQRTL = 1
-HAVE_DECL_STRDUP = 1
-HAVE_DECL_STRERROR_R = 1
-HAVE_DECL_STRNCASECMP = 1
-HAVE_DECL_STRNDUP = 1
-HAVE_DECL_STRNLEN = 1
-HAVE_DECL_STRSIGNAL = 1
-HAVE_DECL_STRTOIMAX = 1
-HAVE_DECL_STRTOK_R = 1
-HAVE_DECL_STRTOUMAX = 1
-HAVE_DECL_TANL = 1
-HAVE_DECL_TRUNC = 1
-HAVE_DECL_TRUNCF = 1
-HAVE_DECL_TRUNCL = 1
-HAVE_DECL_TTYNAME_R = 1
-HAVE_DECL_UNSETENV = 1
-HAVE_DECL_VSNPRINTF = 1
-HAVE_DECL_WCTOB = 1
-HAVE_DECL_WCWIDTH = 1
-HAVE_DIRENT_H = 1
-HAVE_DPRINTF = 1
-HAVE_DUP2 = 1
-HAVE_DUP3 = 1
-HAVE_EUIDACCESS = 0
-HAVE_EXPF = 1
-HAVE_EXPL = 1
-HAVE_EXPLICIT_BZERO = 1
-HAVE_EXPM1 = 1
-HAVE_EXPM1F = 1
-HAVE_FABSF = 1
-HAVE_FABSL = 1
-HAVE_FACCESSAT = 1
-HAVE_FCHDIR = 1
-HAVE_FCHMODAT = 1
-HAVE_FCHOWNAT = 1
-HAVE_FCNTL = 1
-HAVE_FDATASYNC = 1
-HAVE_FDOPENDIR = 1
-HAVE_FEATURES_H = 0
-HAVE_FFS = 1
-HAVE_FFSL = 1
-HAVE_FFSLL = 1
-HAVE_FMA = 1
-HAVE_FMAF = 1
-HAVE_FMAL = 1
-HAVE_FMODF = 1
-HAVE_FMODL = 1
-HAVE_FREXPF = 1
-HAVE_FSEEKO = 1
-HAVE_FSTATAT = 1
-HAVE_FSYNC = 1
-HAVE_FTELLO = 1
-HAVE_FTRUNCATE = 1
-HAVE_FUTIMENS = 1
-HAVE_GETDTABLESIZE = 1
-HAVE_GETGROUPS = 1
-HAVE_GETHOSTNAME = 1
-HAVE_GETLOGIN = 1
-HAVE_GETOPT_H = 1
-HAVE_GETPAGESIZE = 1
-HAVE_GETSUBOPT = 1
-HAVE_GETTIMEOFDAY = 1
-HAVE_GRANTPT = 1
-HAVE_GROUP_MEMBER = 0
-HAVE_HYPOTF = 1
-HAVE_HYPOTL = 1
-HAVE_ILOGB = 1
-HAVE_ILOGBF = 1
-HAVE_ILOGBL = 1
-HAVE_INTTYPES_H = 1
-HAVE_ISNAND = 1
-HAVE_ISNANF = 1
-HAVE_ISNANL = 1
-HAVE_LCHMOD = 1
-HAVE_LCHOWN = 1
-HAVE_LDEXPF = 1
-HAVE_LINK = 1
-HAVE_LINKAT = 1
-HAVE_LOG10F = 1
-HAVE_LOG10L = 1
-HAVE_LOG1P = 1
-HAVE_LOG1PF = 1
-HAVE_LOG1PL = 1
-HAVE_LOGBF = 1
-HAVE_LOGBL = 1
-HAVE_LOGF = 1
-HAVE_LOGL = 1
-HAVE_LONG_LONG_INT = 1
-HAVE_LSTAT = 1
-HAVE_MAX_ALIGN_T = 1
-HAVE_MBRLEN = 1
-HAVE_MBRTOWC = 1
-HAVE_MBSINIT = 1
-HAVE_MBSLEN = 0
-HAVE_MBSNRTOWCS = 1
-HAVE_MBSRTOWCS = 1
-HAVE_MEMCHR = 1
-HAVE_MEMPCPY = 0
-HAVE_MKDIRAT = 1
-HAVE_MKDTEMP = 1
-HAVE_MKFIFO = 1
-HAVE_MKFIFOAT = 1
-HAVE_MKNOD = 1
-HAVE_MKNODAT = 1
-HAVE_MKOSTEMP = 1
-HAVE_MKOSTEMPS = 1
-HAVE_MKSTEMP = 1
-HAVE_MKSTEMPS = 1
-HAVE_MODFF = 1
-HAVE_MODFL = 1
-HAVE_MSVC_INVALID_PARAMETER_HANDLER = 0
-HAVE_NANOSLEEP = 1
-HAVE_OPENAT = 1
-HAVE_OPENDIR = 1
-HAVE_OS_H = 0
-HAVE_PCLOSE = 1
-HAVE_PIPE = 1
-HAVE_PIPE2 = 1
-HAVE_POPEN = 1
-HAVE_POSIX_OPENPT = 1
-HAVE_POWF = 1
-HAVE_PREAD = 1
-HAVE_PTSNAME = 1
-HAVE_PTSNAME_R = 1
-HAVE_PWRITE = 1
-HAVE_QSORT_R = 1
-HAVE_RANDOM = 1
-HAVE_RANDOM_H = 1
-HAVE_RANDOM_R = 1
-HAVE_RAWMEMCHR = 1
-HAVE_READDIR = 1
-HAVE_READLINK = 1
-HAVE_READLINKAT = 1
-HAVE_REALLOCARRAY = 1
-HAVE_REALPATH = 1
-HAVE_REMAINDER = 1
-HAVE_REMAINDERF = 1
-HAVE_RENAMEAT = 1
-HAVE_REWINDDIR = 1
-HAVE_RINT = 1
-HAVE_RINTL = 1
-HAVE_RPMATCH = 1
-HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0
-HAVE_SCANDIR = 1
-HAVE_SECURE_GETENV = 1
-HAVE_SETENV = 1
-HAVE_SETHOSTNAME = 1
-HAVE_SIGNED_SIG_ATOMIC_T =
-HAVE_SIGNED_WCHAR_T =
-HAVE_SIGNED_WINT_T =
-HAVE_SINF = 1
-HAVE_SINHF = 1
-HAVE_SINL = 1
-HAVE_SLEEP = 1
-HAVE_SQRTF = 1
-HAVE_SQRTL = 1
-HAVE_STDINT_H = 1
-HAVE_STPCPY = 1
-HAVE_STPNCPY = 1
-HAVE_STRCASECMP = 1
-HAVE_STRCASESTR = 1
-HAVE_STRCHRNUL = 1
-HAVE_STRINGS_H = 1
-HAVE_STRPBRK = 1
-HAVE_STRPTIME = 1
-HAVE_STRSEP = 1
-HAVE_STRTOD = 1
-HAVE_STRTOLL = 1
-HAVE_STRTOULL = 1
-HAVE_STRUCT_RANDOM_DATA = 1
-HAVE_STRUCT_TIMEVAL = 1
-HAVE_STRVERSCMP = 1
-HAVE_SYMLINK = 1
-HAVE_SYMLINKAT = 1
-HAVE_SYS_BITYPES_H = 0
-HAVE_SYS_CDEFS_H =
-HAVE_SYS_INTTYPES_H = 0
-HAVE_SYS_LOADAVG_H = 0
-HAVE_SYS_PARAM_H = 0
-HAVE_SYS_TIME_H = 1
-HAVE_SYS_TYPES_H = 1
-HAVE_TANF = 1
-HAVE_TANHF = 1
-HAVE_TANL = 1
-HAVE_TIMEGM = 1
-HAVE_TIMEZONE_T = 0
-HAVE_TRUNCATE = 1
-HAVE_TZSET = 1
-HAVE_UNISTD_H = 1
-HAVE_UNLINKAT = 1
-HAVE_UNLOCKPT = 1
-HAVE_UNSIGNED_LONG_LONG_INT = 1
-HAVE_USLEEP = 1
-HAVE_UTIME = 1
-HAVE_UTIMENSAT = 1
-HAVE_UTIME_H = 1
-HAVE_VASPRINTF = 1
-HAVE_VDPRINTF = 1
-HAVE_WCHAR_H = 1
-HAVE_WCHAR_T = 1
-HAVE_WCPCPY = 1
-HAVE_WCPNCPY = 1
-HAVE_WCRTOMB = 1
-HAVE_WCSCASECMP = 1
-HAVE_WCSCAT = 1
-HAVE_WCSCHR = 1
-HAVE_WCSCMP = 1
-HAVE_WCSCOLL = 1
-HAVE_WCSCPY = 1
-HAVE_WCSCSPN = 1
-HAVE_WCSDUP = 1
-HAVE_WCSFTIME = 1
-HAVE_WCSLEN = 1
-HAVE_WCSNCASECMP = 1
-HAVE_WCSNCAT = 1
-HAVE_WCSNCMP = 1
-HAVE_WCSNCPY = 1
-HAVE_WCSNLEN = 1
-HAVE_WCSNRTOMBS = 1
-HAVE_WCSPBRK = 1
-HAVE_WCSRCHR = 1
-HAVE_WCSRTOMBS = 1
-HAVE_WCSSPN = 1
-HAVE_WCSSTR = 1
-HAVE_WCSTOK = 1
-HAVE_WCSWIDTH = 1
-HAVE_WCSXFRM = 1
-HAVE_WINSOCK2_H = 0
-HAVE_WINT_T = 1
-HAVE_WMEMCHR = 1
-HAVE_WMEMCMP = 1
-HAVE_WMEMCPY = 1
-HAVE_WMEMMOVE = 1
-HAVE_WMEMSET = 1
-HAVE__BOOL = 1
-HAVE__EXIT = 1
-INCLUDE_NEXT = include_next
-INCLUDE_NEXT_AS_FIRST_DIRECTIVE = include_next
-INSTALL = /gentoo/prefix64/usr/bin/install -c
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-INT32_MAX_LT_INTMAX_MAX = 1
-INT64_MAX_EQ_LONG_MAX = 1
-LDFLAGS =
-LIBGNU_LIBDEPS =
-LIBGNU_LTLIBDEPS =
-LIBINTL =
-LIBOBJS =
-LIBS = -lkvm
-LIB_CLOCK_GETTIME =
-LIB_EACCESS = -lgen
-LIMITS_H = limits.h
-LTLIBINTL =
-LTLIBOBJS =
-MAKEINFO = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/missing makeinfo
-MKDIR_P = /gentoo/prefix64/usr/bin/mkdir -p
-NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = <dirent.h>
-NEXT_AS_FIRST_DIRECTIVE_ERRNO_H =
-NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = <fcntl.h>
-NEXT_AS_FIRST_DIRECTIVE_FLOAT_H =
-NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = <getopt.h>
-NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = <inttypes.h>
-NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = <limits.h>
-NEXT_AS_FIRST_DIRECTIVE_MATH_H = <math.h>
-NEXT_AS_FIRST_DIRECTIVE_STDDEF_H =
-NEXT_AS_FIRST_DIRECTIVE_STDINT_H = <stdint.h>
-NEXT_AS_FIRST_DIRECTIVE_STDIO_H = <stdio.h>
-NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = <stdlib.h>
-NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = <strings.h>
-NEXT_AS_FIRST_DIRECTIVE_STRING_H = <string.h>
-NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = <sys/stat.h>
-NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = <sys/time.h>
-NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = <sys/types.h>
-NEXT_AS_FIRST_DIRECTIVE_TIME_H = <time.h>
-NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = <unistd.h>
-NEXT_AS_FIRST_DIRECTIVE_UTIME_H = <utime.h>
-NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = <wchar.h>
-NEXT_DIRENT_H = <dirent.h>
-NEXT_ERRNO_H =
-NEXT_FCNTL_H = <fcntl.h>
-NEXT_FLOAT_H =
-NEXT_GETOPT_H = <getopt.h>
-NEXT_INTTYPES_H = <inttypes.h>
-NEXT_LIMITS_H = <limits.h>
-NEXT_MATH_H = <math.h>
-NEXT_STDDEF_H =
-NEXT_STDINT_H = <stdint.h>
-NEXT_STDIO_H = <stdio.h>
-NEXT_STDLIB_H = <stdlib.h>
-NEXT_STRINGS_H = <strings.h>
-NEXT_STRING_H = <string.h>
-NEXT_SYS_STAT_H = <sys/stat.h>
-NEXT_SYS_TIME_H = <sys/time.h>
-NEXT_SYS_TYPES_H = <sys/types.h>
-NEXT_TIME_H = <time.h>
-NEXT_UNISTD_H = <unistd.h>
-NEXT_UTIME_H = <utime.h>
-NEXT_WCHAR_H = <wchar.h>
-OBJEXT = o
-PACKAGE = portage-utils
-PACKAGE_BUGREPORT =
-PACKAGE_NAME = portage-utils
-PACKAGE_STRING = portage-utils git
-PACKAGE_TARNAME = portage-utils
-PACKAGE_URL =
-PACKAGE_VERSION = git
-PATH_SEPARATOR = :
-PRAGMA_COLUMNS =
-PRAGMA_SYSTEM_HEADER = #pragma GCC system_header
-PRIPTR_PREFIX = "l"
-PRI_MACROS_BROKEN = 0
-PTHREAD_H_DEFINES_STRUCT_TIMESPEC = 0
-PTRDIFF_T_SUFFIX =
-RANLIB = ranlib
-REPLACE_ACOSF = 0
-REPLACE_ASINF = 0
-REPLACE_ATAN2F = 0
-REPLACE_ATANF = 0
-REPLACE_BTOWC = 0
-REPLACE_CALLOC = 0
-REPLACE_CANONICALIZE_FILE_NAME = 0
-REPLACE_CBRTF = 0
-REPLACE_CBRTL = 0
-REPLACE_CEIL = 0
-REPLACE_CEILF = 0
-REPLACE_CEILL = 0
-REPLACE_CHOWN = 0
-REPLACE_CLOSE = 0
-REPLACE_CLOSEDIR = 0
-REPLACE_COSF = 0
-REPLACE_COSHF = 0
-REPLACE_CTIME = GNULIB_PORTCHECK
-REPLACE_DIRFD = 0
-REPLACE_DPRINTF = 0
-REPLACE_DUP = 0
-REPLACE_DUP2 = 0
-REPLACE_EXP2 = 0
-REPLACE_EXP2L = 0
-REPLACE_EXPF = 0
-REPLACE_EXPM1 = 0
-REPLACE_EXPM1F = 0
-REPLACE_FABSL = 0
-REPLACE_FACCESSAT = 0
-REPLACE_FCHOWNAT = 0
-REPLACE_FCLOSE = 0
-REPLACE_FCNTL = 0
-REPLACE_FDOPEN = 0
-REPLACE_FDOPENDIR = 0
-REPLACE_FFLUSH = 0
-REPLACE_FLOOR = 0
-REPLACE_FLOORF = 0
-REPLACE_FLOORL = 0
-REPLACE_FMA = 0
-REPLACE_FMAF = 0
-REPLACE_FMAL = 0
-REPLACE_FMOD = 0
-REPLACE_FMODF = 0
-REPLACE_FMODL = 0
-REPLACE_FOPEN = 0
-REPLACE_FPRINTF = 0
-REPLACE_FPURGE = 0
-REPLACE_FREOPEN = 0
-REPLACE_FREXP = 0
-REPLACE_FREXPF = 0
-REPLACE_FREXPL = 1
-REPLACE_FSEEK = 0
-REPLACE_FSEEKO = 0
-REPLACE_FSTAT = 1
-REPLACE_FSTATAT = 1
-REPLACE_FTELL = 0
-REPLACE_FTELLO = 0
-REPLACE_FTRUNCATE = 0
-REPLACE_FUTIMENS = 1
-REPLACE_GETCWD = 1
-REPLACE_GETDELIM = 0
-REPLACE_GETDOMAINNAME = 0
-REPLACE_GETDTABLESIZE = 0
-REPLACE_GETGROUPS = 0
-REPLACE_GETLINE = 0
-REPLACE_GETLOGIN_R = 0
-REPLACE_GETPAGESIZE = 0
-REPLACE_GETTIMEOFDAY = 0
-REPLACE_GMTIME = 0
-REPLACE_HUGE_VAL = 0
-REPLACE_HYPOT = 0
-REPLACE_HYPOTF = 0
-REPLACE_HYPOTL = 0
-REPLACE_ILOGB = 0
-REPLACE_ILOGBF = 0
-REPLACE_ILOGBL = 0
-REPLACE_ISATTY = 0
-REPLACE_ISFINITE = 0
-REPLACE_ISINF = 0
-REPLACE_ISNAN = 0
-REPLACE_ITOLD = 0
-REPLACE_LCHOWN = 0
-REPLACE_LDEXPL = 0
-REPLACE_LINK = 0
-REPLACE_LINKAT = 0
-REPLACE_LOCALTIME = 0
-REPLACE_LOCALTIME_R = GNULIB_PORTCHECK
-REPLACE_LOG = 0
-REPLACE_LOG10 = 0
-REPLACE_LOG10F = 0
-REPLACE_LOG10L = 0
-REPLACE_LOG1P = 0
-REPLACE_LOG1PF = 0
-REPLACE_LOG1PL = 0
-REPLACE_LOG2 = 0
-REPLACE_LOG2F = 0
-REPLACE_LOG2L = 0
-REPLACE_LOGB = 0
-REPLACE_LOGBF = 0
-REPLACE_LOGBL = 0
-REPLACE_LOGF = 0
-REPLACE_LOGL = 0
-REPLACE_LSEEK = 0
-REPLACE_LSTAT = 1
-REPLACE_MALLOC = 0
-REPLACE_MBRLEN = 0
-REPLACE_MBRTOWC = 0
-REPLACE_MBSINIT = 0
-REPLACE_MBSNRTOWCS = 0
-REPLACE_MBSRTOWCS = 0
-REPLACE_MBSTATE_T = 0
-REPLACE_MBTOWC = 0
-REPLACE_MEMCHR = 0
-REPLACE_MEMMEM = 0
-REPLACE_MKDIR = 0
-REPLACE_MKFIFO = 0
-REPLACE_MKNOD = 0
-REPLACE_MKSTEMP = 0
-REPLACE_MKTIME = GNULIB_PORTCHECK
-REPLACE_MODF = 0
-REPLACE_MODFF = 0
-REPLACE_MODFL = 0
-REPLACE_NAN = 0
-REPLACE_NANOSLEEP = GNULIB_PORTCHECK
-REPLACE_NULL = 0
-REPLACE_OBSTACK_PRINTF = 0
-REPLACE_OPEN = 0
-REPLACE_OPENAT = 0
-REPLACE_OPENDIR = 0
-REPLACE_PERROR = 0
-REPLACE_POPEN = 0
-REPLACE_PREAD = 0
-REPLACE_PRINTF = 0
-REPLACE_PTSNAME = 0
-REPLACE_PTSNAME_R = 0
-REPLACE_PUTENV = 0
-REPLACE_PWRITE = 0
-REPLACE_QSORT_R = 0
-REPLACE_RANDOM_R = 0
-REPLACE_READ = 0
-REPLACE_READLINK = 0
-REPLACE_READLINKAT = 0
-REPLACE_REALLOC = 0
-REPLACE_REALPATH = 0
-REPLACE_REMAINDER = 0
-REPLACE_REMAINDERF = 0
-REPLACE_REMAINDERL = 0
-REPLACE_REMOVE = 0
-REPLACE_RENAME = 1
-REPLACE_RENAMEAT = 1
-REPLACE_RMDIR = 0
-REPLACE_ROUND = 0
-REPLACE_ROUNDF = 0
-REPLACE_ROUNDL = 0
-REPLACE_SETENV = 0
-REPLACE_SIGNBIT = 0
-REPLACE_SIGNBIT_USING_GCC = 1
-REPLACE_SINF = 0
-REPLACE_SINHF = 0
-REPLACE_SLEEP = 0
-REPLACE_SNPRINTF = 0
-REPLACE_SPRINTF = 0
-REPLACE_SQRTF = 0
-REPLACE_SQRTL = 0
-REPLACE_STAT = 0
-REPLACE_STDIO_READ_FUNCS = 0
-REPLACE_STDIO_WRITE_FUNCS = 0
-REPLACE_STPNCPY = 0
-REPLACE_STRCASESTR = 0
-REPLACE_STRCHRNUL = 0
-REPLACE_STRDUP = 0
-REPLACE_STRERROR = 0
-REPLACE_STRERROR_R = 0
-REPLACE_STRFTIME = GNULIB_PORTCHECK
-REPLACE_STRNCAT = 0
-REPLACE_STRNDUP = 0
-REPLACE_STRNLEN = 0
-REPLACE_STRSIGNAL = 0
-REPLACE_STRSTR = 0
-REPLACE_STRTOD = 0
-REPLACE_STRTOIMAX = 0
-REPLACE_STRTOK_R = 0
-REPLACE_STRTOUMAX = 0
-REPLACE_STRUCT_TIMEVAL = 0
-REPLACE_SYMLINK = 0
-REPLACE_SYMLINKAT = 0
-REPLACE_TANF = 0
-REPLACE_TANHF = 0
-REPLACE_TIMEGM = GNULIB_PORTCHECK
-REPLACE_TMPFILE = 0
-REPLACE_TRUNC = 0
-REPLACE_TRUNCATE = 0
-REPLACE_TRUNCF = 0
-REPLACE_TRUNCL = 0
-REPLACE_TTYNAME_R = 0
-REPLACE_TZSET = GNULIB_PORTCHECK
-REPLACE_UNLINK = 0
-REPLACE_UNLINKAT = 0
-REPLACE_UNSETENV = 0
-REPLACE_USLEEP = 0
-REPLACE_UTIME = 0
-REPLACE_UTIMENSAT = 0
-REPLACE_VASPRINTF = 1
-REPLACE_VDPRINTF = 0
-REPLACE_VFPRINTF = 0
-REPLACE_VPRINTF = 0
-REPLACE_VSNPRINTF = 0
-REPLACE_VSPRINTF = 0
-REPLACE_WCRTOMB = 0
-REPLACE_WCSFTIME = 0
-REPLACE_WCSNRTOMBS = 0
-REPLACE_WCSRTOMBS = 0
-REPLACE_WCSWIDTH = 0
-REPLACE_WCTOB = 0
-REPLACE_WCTOMB = 0
-REPLACE_WCWIDTH = 0
-REPLACE_WRITE = 0
-SET_MAKE =
-SHELL = /bin/sh
-SIG_ATOMIC_T_SUFFIX =
-SIZE_T_SUFFIX =
-STDBOOL_H =
-STDDEF_H =
-STDINT_H = stdint.h
-STRIP =
-SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = 0
-TIME_H_DEFINES_STRUCT_TIMESPEC = 1
-UINT32_MAX_LT_UINTMAX_MAX = 1
-UINT64_MAX_EQ_ULONG_MAX = 1
-UNDEFINE_STRTOK_R = 0
-UNISTD_H_DEFINES_STRUCT_TIMESPEC = 0
-UNISTD_H_HAVE_WINSOCK2_H = 0
-UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = 0
-UTIME_H =
-VERSION = git
-WCHAR_T_SUFFIX =
-WINDOWS_64_BIT_OFF_T = 0
-WINDOWS_64_BIT_ST_SIZE = 0
-WINDOWS_STAT_INODES = 0
-WINDOWS_STAT_TIMESPEC = 0
-WINT_T_SUFFIX =
-abs_builddir = /net/ptah/export/gentoo/working-repos/portage-utils
-abs_srcdir = /net/ptah/export/gentoo/working-repos/portage-utils
-abs_top_builddir = /net/ptah/export/gentoo/working-repos/portage-utils
-abs_top_srcdir = /net/ptah/export/gentoo/working-repos/portage-utils
-ac_ct_CC = gcc
-am__include = include
-am__leading_dot = .
-am__quote =
-am__tar = $${TAR-tar} chof - "$$tardir"
-am__untar = $${TAR-tar} xf -
-bindir = ${exec_prefix}/bin
-build = x86_64-pc-solaris2.11
-build_alias =
-build_cpu = x86_64
-build_os = solaris2.11
-build_vendor = pc
-builddir = .
-datadir = ${datarootdir}
-datarootdir = ${prefix}/share
-docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
-dvidir = ${docdir}
-exec_prefix = ${prefix}
-gl_LIBOBJS = asnprintf.o asprintf.o chdir-long.o error.o euidaccess.o frexpl.o fstat.o fstatat.o futimens.o getcwd-lgpl.o group-member.o localtime-buffer.o lstat.o mempcpy.o memrchr.o openat-proc.o printf-args.o printf-parse.o rename.o renameat.o vasnprintf.o vasprintf.o
-gl_LTLIBOBJS = asnprintf.lo asprintf.lo chdir-long.lo error.lo euidaccess.lo frexpl.lo fstat.lo fstatat.lo futimens.lo getcwd-lgpl.lo group-member.lo localtime-buffer.lo lstat.lo mempcpy.lo memrchr.lo openat-proc.lo printf-args.lo printf-parse.lo rename.lo renameat.lo vasnprintf.lo vasprintf.lo
-gltests_LIBOBJS =
-gltests_LTLIBOBJS =
-gltests_WITNESS = IN_PORTAGE_UTILS_GNULIB_TESTS
-host = x86_64-pc-solaris2.11
-host_alias =
-host_cpu = x86_64
-host_os = solaris2.11
-host_vendor = pc
-htmldir = ${docdir}
-includedir = ${prefix}/include
-infodir = ${datarootdir}/info
-install_sh = ${SHELL} /net/ptah/export/gentoo/working-repos/portage-utils/autotools/install-sh
-libdir = ${exec_prefix}/lib
-libexecdir = ${exec_prefix}/libexec
-localedir = ${datarootdir}/locale
-localstatedir = ${prefix}/var
-mandir = ${datarootdir}/man
-mkdir_p = $(MKDIR_P)
-oldincludedir = /usr/include
-pdfdir = ${docdir}
-prefix = /usr/local
-program_transform_name = s,x,x,
-psdir = ${docdir}
-sbindir = ${exec_prefix}/sbin
-sharedstatedir = ${prefix}/com
-srcdir = .
-sysconfdir = ${prefix}/etc
-target_alias =
-top_build_prefix =
-top_builddir = .
-top_srcdir = .
-ACLOCAL_AMFLAGS = -I autotools/m4
-SUBDIRS = autotools/gnulib
-portagedir = $(sysconfdir)/portage
-postsyncddir = $(portagedir)/repo.postsync.d
-dist_postsyncd_SCRIPTS = repo.postsync/q-reinit
-q_SOURCES = main.c
-
-# @@@ GEN START @@@ #
-q_CPPFLAGS = -I$(top_builddir)/autotools/gnulib \
- -I$(top_srcdir)/autotools/gnulib -DAPPLET_q -DAPPLET_qatom \
- -DAPPLET_qcache -DAPPLET_qcheck -DAPPLET_qdepends \
- -DAPPLET_qfile -DAPPLET_qgrep -DAPPLET_qlist -DAPPLET_qlop \
- -DAPPLET_qmerge -DAPPLET_qpkg -DAPPLET_qsearch -DAPPLET_qsize \
- -DAPPLET_qtbz2 -DAPPLET_quse -DAPPLET_qxpak
-q_LDADD = \
- $(top_builddir)/autotools/gnulib/libgnu.a \
- -liniparser \
- $(LIB_CLOCK_GETTIME) \
- $(LIB_EACCESS)
-
-TMAKE = \
- $(MAKE) -C $(abs_top_srcdir)/tests \
- AUTOTOOLS=true \
- abs_top_builddir="$(abs_top_builddir)" \
- abs_top_srcdir="$(abs_top_srcdir)"
-
-
-# Start off with base values which we append below
-dist_man_MANS = man/q.1 man/qatom.1 man/qcache.1 man/qcheck.1 \
- man/qdepends.1 man/qfile.1 man/qgrep.1 man/qlist.1 man/qlop.1 \
- man/qmerge.1 man/qpkg.1 man/qsearch.1 man/qsize.1 man/qtbz2.1 \
- man/quse.1 man/qxpak.1
-APPLETS = q qatom qcache qcheck qdepends qfile qgrep qlist qlop qmerge \
- qpkg qsearch qsize qtbz2 quse qxpak
-EXTRA_DIST = autotools/m4/gnulib-cache.m4 applets.h config.h \
- include_applets.h libq/atom_compare.c libq/atom_explode.c \
- libq/basename.c libq/busybox.h libq/colors.c libq/compat.c \
- libq/copy_file.c libq/hash_fd.c libq/human_readable.c \
- libq/i18n.h libq/libq.c libq/libq.h libq/md5_sha1_sum.c \
- libq/prelink.c libq/profile.c libq/rmspace.c libq/safe_io.c \
- libq/scandirat.c libq/vdb.c libq/vdb_get_next_dir.c \
- libq/virtuals.c libq/xarray.c libq/xasprintf.c libq/xchdir.c \
- libq/xmalloc.c libq/xmkdir.c libq/xregex.c libq/xstrdup.c \
- libq/xsystem.c main.c main.h porting.h q.c qatom.c qcache.c \
- qcheck.c qdepends.c qfile.c qglsa.c qgrep.c qlist.c qlop.c \
- qmerge.c qpkg.c qsearch.c qsize.c qtbz2.c quse.c qxpak.c \
- tests/Makefile tests/atom_compare/.gitignore \
- tests/atom_compare/Makefile tests/atom_compare/atom-compare.py \
- tests/atom_compare/static.good \
- tests/atom_compare/static.q.good \
- tests/atom_compare/static.q.tests \
- tests/atom_compare/static.tests tests/atom_explode/.gitignore \
- tests/atom_explode/Makefile tests/atom_explode/atom-explode.py \
- tests/atom_explode/basic.good tests/atom_explode/basic.tests \
- tests/atom_explode/dotest tests/atom_explode/test.c \
- tests/copy_file/.gitignore tests/copy_file/Makefile \
- tests/copy_file/dotest tests/copy_file/test.c tests/init.sh \
- tests/install/.gitignore tests/install/Makefile \
- tests/install/dotest tests/mkdir/.gitignore \
- tests/mkdir/Makefile tests/mkdir/dotest tests/mkdir/test.c \
- tests/profile/Makefile tests/profile/dotest \
- tests/profile/profile1/etc/parent.conf \
- tests/profile/profile1/etc/portage/make.conf \
- tests/profile/profile1/etc/portage/subdir/file.conf \
- tests/profile/profile1/etc/portage/this.level.conf \
- tests/qatom/Makefile tests/qatom/dotest tests/qcheck/Makefile \
- tests/qcheck/dotest tests/qcheck/list01.good \
- tests/qcheck/list02.good tests/qcheck/list03.good \
- tests/qcheck/list04.good tests/qcheck/list05.good \
- tests/qcheck/list06.good tests/qcheck/list07.good \
- tests/qcheck/list08.good tests/qcheck/list09.good \
- tests/qcheck/root/a-b/pkg-1.0/CONTENTS \
- tests/qcheck/root/a-b/pkg-1.0/SLOT \
- tests/qcheck/root/a-b/pkg-1.0/repository \
- tests/qcheck/root/bin/bad-md5 tests/qcheck/root/bin/bad-mtime \
- tests/qcheck/root/bin/bad-mtime-obj \
- tests/qcheck/root/bin/bad-sha1 tests/qcheck/root/bin/good-md5 \
- tests/qcheck/root/bin/good-sha1 \
- tests/qcheck/root/cat/pkg-1/CONTENTS \
- tests/qcheck/root/cat/pkg-1/SLOT \
- tests/qcheck/root/cat/pkg-1/repository tests/qdepends/Makefile \
- tests/qdepends/dotest tests/qdepends/list01.good \
- tests/qdepends/list02.good tests/qdepends/list03.good \
- tests/qdepends/list04.good tests/qdepends/list05.good \
- tests/qdepends/list06.good tests/qdepends/list07.good \
- tests/qdepends/list08.good \
- tests/qdepends/root/app-arch/cpio-2.11/CONTENTS \
- tests/qdepends/root/app-arch/cpio-2.11/SLOT \
- tests/qdepends/root/app-arch/cpio-2.11/repository \
- tests/qdepends/root/x11-apps/xdm-1.1.11-r3/DEPEND \
- tests/qdepends/root/x11-apps/xdm-1.1.11-r3/RDEPEND \
- tests/qdepends/root/x11-apps/xdm-1.1.11-r3/USE \
- tests/qfile/Makefile tests/qfile/dotest tests/qlist/Makefile \
- tests/qlist/dotest tests/qlist/list01.good \
- tests/qlist/list02.good tests/qlist/list03.good \
- tests/qlist/list04.good tests/qlist/list05.good \
- tests/qlist/list06.good tests/qlist/list07.good \
- tests/qlist/list08.good tests/qlist/list09.good \
- tests/qlist/list10.good tests/qlist/list11.good \
- tests/qlist/list12.good tests/qlist/list13.good \
- tests/qlist/list14.good tests/qlist/list15.good \
- tests/qlist/list16.good tests/qlist/root/-merge-foo/CONTENTS \
- tests/qlist/root/a-b/a-0/CONTENTS \
- tests/qlist/root/a-b/a-0/SLOT \
- tests/qlist/root/a-b/a-0/repository \
- tests/qlist/root/a-b/b-0/CONTENTS \
- tests/qlist/root/a-b/b-0/SLOT \
- tests/qlist/root/a-b/b-0/repository \
- tests/qlist/root/app-arch/cpio-2.11/CONTENTS \
- tests/qlist/root/app-arch/cpio-2.11/SLOT \
- tests/qlist/root/app-arch/cpio-2.11/repository \
- tests/qlist/root/cat/pkg-1/CONTENTS \
- tests/qlist/root/cat/pkg-1/SLOT \
- tests/qlist/root/cat/pkg-1/repository \
- tests/qlist/root/cat/sub-2/CONTENTS \
- tests/qlist/root/cat/sub-2/SLOT \
- tests/qlist/root/cat/sub-2/repository \
- tests/qlist/root/sys-fs/mtools-4.0.13/CONTENTS \
- tests/qlist/root/sys-fs/mtools-4.0.13/SLOT \
- tests/qlist/root/sys-fs/mtools-4.0.13/repository \
- tests/qlop/Makefile tests/qlop/dotest tests/qlop/list01.good \
- tests/qlop/list02.good tests/qlop/list03.good \
- tests/qlop/list04.good tests/qlop/list05.good \
- tests/qlop/list06.good tests/qlop/list07.good \
- tests/qlop/list08.good tests/qlop/sync.log \
- tests/qlop/test04.good tests/qmerge/Makefile \
- tests/qmerge/dotest tests/qmerge/packages/Packages \
- tests/qmerge/packages/sys-devel/qmerge-test-1.3.tbz2 \
- tests/qtbz2/Makefile tests/qtbz2/dotest tests/quse/Makefile \
- tests/quse/dotest tests/quse/list01.good \
- tests/quse/portdir/profiles/arch.list \
- tests/quse/portdir/profiles/desc/elibc.desc \
- tests/quse/portdir/profiles/desc/one.desc \
- tests/quse/portdir/profiles/desc/two.desc \
- tests/quse/portdir/profiles/use.desc \
- tests/quse/portdir/profiles/use.local.desc \
- tests/qxpak/Makefile tests/qxpak/dotest \
- tests/qxpak/list01.good tests/qxpak/list02.good \
- tests/reinitialize/Makefile tests/reinitialize/dotest \
- tests/rmspace/.gitignore tests/rmspace/Makefile \
- tests/rmspace/dotest tests/rmspace/test.c \
- tests/source/Makefile tests/source/dotest tests/source/space \
- tests/subdir.mk tests/tests.h
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-config.h: stamp-h1
- @test -f $@ || rm -f stamp-h1
- @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-q$(EXEEXT): $(q_OBJECTS) $(q_DEPENDENCIES) $(EXTRA_q_DEPENDENCIES)
- @rm -f q$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(q_OBJECTS) $(q_LDADD) $(LIBS)
-install-dist_postsyncdSCRIPTS: $(dist_postsyncd_SCRIPTS)
- @$(NORMAL_INSTALL)
- @list='$(dist_postsyncd_SCRIPTS)'; test -n "$(postsyncddir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(postsyncddir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(postsyncddir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n' \
- -e 'h;s|.*|.|' \
- -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) { files[d] = files[d] " " $$1; \
- if (++n[d] == $(am__install_max)) { \
- print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
- else { print "f", d "/" $$4, $$1 } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(postsyncddir)$$dir'"; \
- $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(postsyncddir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-dist_postsyncdSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_postsyncd_SCRIPTS)'; test -n "$(postsyncddir)" || exit 0; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 's,.*/,,;$(transform)'`; \
- dir='$(DESTDIR)$(postsyncddir)'; $(am__uninstall_files_from_dir)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-include ./$(DEPDIR)/q-main.Po
-
-.c.o:
- $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-# $(AM_V_CC)source='$<' object='$@' libtool=no \
-# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
-# $(AM_V_CC_no)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-# $(AM_V_CC)source='$<' object='$@' libtool=no \
-# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
-# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-q-main.o: main.c
- $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT q-main.o -MD -MP -MF $(DEPDIR)/q-main.Tpo -c -o q-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
- $(AM_V_at)$(am__mv) $(DEPDIR)/q-main.Tpo $(DEPDIR)/q-main.Po
-# $(AM_V_CC)source='main.c' object='q-main.o' libtool=no \
-# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
-# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o q-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
-
-q-main.obj: main.c
- $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT q-main.obj -MD -MP -MF $(DEPDIR)/q-main.Tpo -c -o q-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
- $(AM_V_at)$(am__mv) $(DEPDIR)/q-main.Tpo $(DEPDIR)/q-main.Po
-# $(AM_V_CC)source='main.c' object='q-main.obj' libtool=no \
-# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
-# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(q_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o q-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
-install-man1: $(dist_man_MANS)
- @$(NORMAL_INSTALL)
- @list1=''; \
- list2='$(dist_man_MANS)'; \
- test -n "$(man1dir)" \
- && test -n "`echo $$list1$$list2`" \
- || exit 0; \
- echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
- { for i in $$list1; do echo "$$i"; done; \
- if test -n "$$list2"; then \
- for i in $$list2; do echo "$$i"; done \
- | sed -n '/\.1[a-z]*$$/p'; \
- fi; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
- fi; \
- done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
- done; }
-
-uninstall-man1:
- @$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man1dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.1[a-z]*$$/p'; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscope: cscope.files
- test ! -s cscope.files \
- || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-clean-cscope:
- -rm -f cscope.files
-cscope.files: clean-cscope cscopelist
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
- -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
- $(am__post_remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__post_remove_distdir)
-
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__post_remove_distdir)
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__post_remove_distdir)
-
-dist-tarZ: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
- @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__post_remove_distdir)
-
-dist-shar: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
- @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
- $(am__post_remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__post_remove_distdir)
-
-dist dist-all:
- $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
- $(am__post_remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
+# Copyright 2005-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+####################################################################
+
+check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
+ then echo "$(1)"; else echo "$(2)"; fi)
+istrue = $(if $(filter 1 yes true on,$(strip $1)),1,0)
+
+####################################################
+WFLAGS := -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \
+ -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \
+ -Wbad-function-cast -Wnested-externs -Wcomment -Winline \
+ -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \
+ $(call check_gcc, -Wsequence-point) \
+ $(call check_gcc, -Wextra) \
+ $(call check_gcc, -Wno-sign-compare) \
+ $(call check_gcc, -Wold-style-definition)
+
+CFLAGS ?= -O2 -g -pipe
+CFLAGS += -std=gnu99
+CPPFLAGS ?=
+CPPFLAGS += -DENABLE_NLS=$(call istrue,$(NLS))
+DBG_CFLAGS = -O0 -DEBUG -g3 -ggdb -fno-pie $(call check_gcc, -fsanitize=address -fsanitize=leak -fsanitize=undefined)
+#CFLAGS += -Os -DOPTIMIZE_FOR_SIZE=2 -falign-functions=2 -falign-jumps=2 -falign-labels=2 -falign-loops=2
+LDFLAGS_static_1 = -static
+LDFLAGS += $(LDFLAGS_static_$(call istrue,$(STATIC)))
+LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo '-lkvm')
+LIBADD += -liniparser
+DESTDIR :=
+PREFIX := $(DESTDIR)/usr
+ETCDIR := $(DESTDIR)/etc
+STRIP := strip
+MKDIR := mkdir -p
+CP := cp
+INSTALL_EXE := install -m755
+
+ifndef V
+Q = @
+else
+Q =
+endif
+export Q
+ifdef PV
+CPPFLAGS += -DVERSION=\"$(PV)\"
+else
+PV := git
+VCSID := $(shell git describe --tags HEAD)
+CPPFLAGS += -DVCSID='"$(VCSID)"'
+endif
+ifndef PF
+PF := portage-utils-$(PV)
+endif
+DOCS := TODO.md README.md qsync
+
+#ifdef PYTHON
+#PYFLAGS ?= $(shell python-config) -DWANT_PYTHON -ldl -pthread -lutil /usr/lib/libpython2.4.so
+##PYFLAGS += -lpython2.4
+#endif
+
+#####################################################
+APPLETS := $(shell ./applets.sh)
+SRC := $(APPLETS:%=%.c) main.c
+APP_FLAGS := $(foreach a,$(APPLETS),-DAPPLET_$a)
+CPPFLAGS += $(APP_FLAGS)
+
+all: q
+ @true
+
+debug: clean
+ $(MAKE) CFLAGS="$(CFLAGS) $(DBG_CFLAGS)" symlinks
+ @-scanelf -o /dev/null -BXxz permsx q
+
+q: $(SRC) libq/*.c *.h libq/*.h
+ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS))
+ @printf ': %s ' $(APPLETS)
+ @echo ':'
+ifndef V
+ @echo $(CC) $(CFLAGS) $(PYFLAGS) $(LDFLAGS) main.c -o q $(LIBADD)
+endif
+endif
+ $(Q)$(CC) $(WFLAGS) $(PYFLAGS) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) main.c -o q $(LIBADD)
+
+.depend: $(SRC) applets.h
+ sed -n '/^DECLARE_APPLET/s:.*(\(.*\)).*:#include "\1.c":p' applets.h > include_applets.h
+ @#$(CC) $(CFLAGS) -MM $(SRC) > .depend
+ $(CC) $(CPPFLAGS) $(CFLAGS) -MM main.c > .depend
+
+check: symlinks
+ $(MAKE) -C tests $@
+
+dist:
+ ./make-tarball.sh $(PV)
distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir)
- chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
- chmod a-w $(distdir)
- test -d $(distdir)/_build || exit 0; \
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build/sub \
- && ../../configure \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=../.. --prefix="$$dc_install_base" \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
- $(am__post_remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(postsyncddir)" "$(DESTDIR)$(man1dir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-binPROGRAMS clean-generic clean-local mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-hdr distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-dist_postsyncdSCRIPTS install-man
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man: install-man1
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-dist_postsyncdSCRIPTS \
- uninstall-man
-
-uninstall-man: uninstall-man1
-
-.MAKE: $(am__recursive_targets) all install-am install-exec-am \
- install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
- am--refresh check check-am clean clean-binPROGRAMS \
- clean-cscope clean-generic clean-local cscope cscopelist-am \
- ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \
- dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
- distclean-compile distclean-generic distclean-hdr \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am \
- install-dist_postsyncdSCRIPTS install-dvi install-dvi-am \
- install-exec install-exec-am install-exec-hook install-html \
- install-html-am install-info install-info-am install-man \
- install-man1 install-pdf install-pdf-am install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am uninstall-binPROGRAMS \
- uninstall-dist_postsyncdSCRIPTS uninstall-man uninstall-man1
-
-.PRECIOUS: Makefile
-
-
-install-exec-hook:
- cd $(DESTDIR)$(bindir); \
- for applet in $(APPLETS) ; do \
- [ ! -e "$$applet" ] && ln -s q $${applet} ; \
+ rm -rf portage-utils-$(PV)
+ tar xf portage-utils-$(PV).tar.xz
+ $(MAKE) -C portage-utils-$(PV)
+ $(MAKE) -C portage-utils-$(PV) check
+ rm -rf portage-utils-$(PV)
+
+clean:
+ -rm -f q $(APPLETS)
+ $(MAKE) -C tests clean
+distclean: clean testclean
+ -rm -f *~ core .#*
+ -rm -f `find . -type l`
+
+testclean:
+ cd tests && $(MAKE) clean
+
+install: all
+ $(MKDIR) $(PREFIX)/bin/
+ $(INSTALL_EXE) q $(PREFIX)/bin/
+
+ set -e ; \
+ for applet in $(filter-out q,$(APPLETS)) ; do \
+ ln -sf q $(PREFIX)/bin/$${applet} ; \
done
-check-hook:
- $(TMAKE) check
-clean-local:
- $(TMAKE) clean
- -rmdir tests/*/ tests/
- rm -f $(APPLETS)
-check: check-hook
-# @@@ GEN START @@@ #
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+ $(MKDIR) $(ETCDIR)/portage/repo.postsync.d
+ $(INSTALL_EXE) repo.postsync/* $(ETCDIR)/portage/repo.postsync.d/
+
+ifneq ($(wildcard man/*.1),)
+ $(MKDIR) $(PREFIX)/share/man/man1/
+ cp $(wildcard man/*.1) $(PREFIX)/share/man/man1/
+endif
+
+ $(MKDIR) $(PREFIX)/share/doc/$(PF)
+ cp $(DOCS) $(PREFIX)/share/doc/$(PF)/
+
+man: q
+ ./man/mkman.py
+
+symlinks: q
+ ./q --install
+
+-include .depend
+
+.PHONY: all check clean debug dist distclean install man symlinks testclean
+
+#
+# All logic related to autotools is below here
+#
+GEN_MARK_START = \# @@@ GEN START @@@ \#
+GEN_MARK_END = \# @@@ GEN START @@@ \#
+EXTRA_DIST = \
+ $(SRC) \
+ qglsa.c \
+ $(wildcard libq/*.c *.h libq/*.h) \
+ $(shell find tests -type f)
+MAKE_MULTI_LINES = $(patsubst %,\\\\\n\t%,$(sort $(1)))
+# 2nd level of indirection here is so the $(find) doesn't pick up
+# files in EXTRA_DIST that get cleaned up ...
+autotools-update: clean
+ $(MAKE) _autotools-update
+_autotools-update:
+ sed -i '/^$(GEN_MARK_START)$$/,/^$(GEN_MARK_END)$$/d' Makefile.am
+ printf '%s\nq_CPPFLAGS += %b\ndist_man_MANS += %b\nAPPLETS += %b\nEXTRA_DIST += %b\n%s\n' \
+ "$(GEN_MARK_START)" \
+ "$(call MAKE_MULTI_LINES,$(APP_FLAGS))" \
+ "$(call MAKE_MULTI_LINES,$(wildcard man/*.1))" \
+ "$(call MAKE_MULTI_LINES,$(APPLETS))" \
+ "$(call MAKE_MULTI_LINES,$(EXTRA_DIST))" \
+ "$(GEN_MARK_END)" \
+ >> Makefile.am
+autotools: autotools-update
+ ./autogen.sh --from=make
+
+.PHONY: autotools autotools-update _autotools-update
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-17 20:12 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-17 20:12 UTC (permalink / raw
To: gentoo-commits
commit: 717aa306c7138580d2aa4e3946049b121b7b2b4c
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 17 20:12:11 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Apr 17 20:12:11 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=717aa306
qcache: use metadata/md5-cache iso /var/cache/edb/
main.c | 14 +++++++++-----
qcache.c | 22 +++++++++++++++-------
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/main.c b/main.c
index bf85786..9103dc4 100644
--- a/main.c
+++ b/main.c
@@ -1037,7 +1037,7 @@ initialize_flat(const char *overlay, int cache_type, bool force)
return cache_file;
}
- warn("Updating ebuild %scache in %s ... ",
+ warn("Updating ebuild %scache for %s ... ",
cache_type == CACHE_EBUILD ? "" : "meta", overlay);
count = frac = secs = 0;
@@ -1048,7 +1048,8 @@ initialize_flat(const char *overlay, int cache_type, bool force)
if (cache_type == CACHE_METADATA) {
subdir_fd = openat(overlay_fd, portcachedir_md5, O_RDONLY|O_CLOEXEC);
if (subdir_fd == -1) {
- subdir_fd = openat(overlay_fd, portcachedir_pms, O_RDONLY|O_CLOEXEC);
+ subdir_fd = openat(overlay_fd, portcachedir_pms,
+ O_RDONLY|O_CLOEXEC);
if (subdir_fd == -1) {
warnp("could not read md5 or pms cache dirs in %s", overlay);
goto ret;
@@ -1084,13 +1085,15 @@ initialize_flat(const char *overlay, int cache_type, bool force)
continue;
int c, pkg_cnt;
- pkg_cnt = scandirat(subdir_fd, category[i]->d_name, &pn, q_vdb_filter_pkg, alphasort);
+ pkg_cnt = scandirat(subdir_fd, category[i]->d_name, &pn,
+ q_vdb_filter_pkg, alphasort);
if (pkg_cnt < 0)
continue;
for (c = 0; c < pkg_cnt; c++) {
char de[_Q_PATH_MAX];
- snprintf(de, sizeof(de), "%s/%s", category[i]->d_name, pn[c]->d_name);
+ snprintf(de, sizeof(de), "%s/%s",
+ category[i]->d_name, pn[c]->d_name);
if (fstatat(subdir_fd, de, &st, 0) < 0)
continue;
@@ -1107,7 +1110,8 @@ initialize_flat(const char *overlay, int cache_type, bool force)
}
int e, ebuild_cnt;
- ebuild_cnt = scandirat(subdir_fd, de, &eb, filter_hidden, alphasort);
+ ebuild_cnt = scandirat(subdir_fd, de, &eb,
+ filter_hidden, alphasort);
if (ebuild_cnt < 0)
continue;
for (e = 0; e < ebuild_cnt; ++e) {
diff --git a/qcache.c b/qcache.c
index 545f336..03bcd05 100644
--- a/qcache.c
+++ b/qcache.c
@@ -407,9 +407,11 @@ qcache_traverse_overlay(void (*func)(qcache_data*), const char *overlay)
int i, j, k, len, num_cat, num_pkg, num_ebuild;
struct dirent **categories, **packages, **ebuilds;
- xasprintf(&catpath, "%s/dep/%s", portedb, overlay);
+ xasprintf(&catpath, "%s/metadata/md5-cache", overlay);
- if (-1 == (num_cat = scandir(catpath, &categories, qcache_file_select, alphasort))) {
+ if (-1 == (num_cat = scandir(catpath, &categories,
+ qcache_file_select, alphasort)))
+ {
errp("%s", catpath);
free(catpath);
}
@@ -421,7 +423,9 @@ qcache_traverse_overlay(void (*func)(qcache_data*), const char *overlay)
for (i = 0; i < num_cat; i++) {
xasprintf(&pkgpath, "%s/%s", overlay, categories[i]->d_name);
- if (-1 == (num_pkg = scandir(pkgpath, &packages, qcache_file_select, alphasort))) {
+ if (-1 == (num_pkg = scandir(pkgpath, &packages,
+ qcache_file_select, alphasort)))
+ {
if (errno != ENOENT)
warnp("Found a cache dir, but unable to process %s", pkgpath);
free(categories[i]);
@@ -440,9 +444,12 @@ qcache_traverse_overlay(void (*func)(qcache_data*), const char *overlay)
/* traverse packages */
for (j = 0; j < num_pkg; j++) {
- xasprintf(&ebuildpath, "%s/%s/%s", overlay, categories[i]->d_name, packages[j]->d_name);
+ xasprintf(&ebuildpath, "%s/%s/%s",
+ overlay, categories[i]->d_name, packages[j]->d_name);
- if (-1 == (num_ebuild = scandir(ebuildpath, &ebuilds, qcache_ebuild_select, qcache_vercmp))) {
+ if (-1 == (num_ebuild = scandir(ebuildpath, &ebuilds,
+ qcache_ebuild_select, qcache_vercmp)))
+ {
/* Do not complain about spurious files */
if (errno != ENOTDIR)
warnp("%s", ebuildpath);
@@ -465,7 +472,8 @@ qcache_traverse_overlay(void (*func)(qcache_data*), const char *overlay)
/* traverse ebuilds */
data.num = num_ebuild;
for (k = 0; k < num_ebuild; k++) {
- len = xasprintf(&cachepath, "%s/%s/%s", catpath, categories[i]->d_name, ebuilds[k]->d_name);
+ len = xasprintf(&cachepath, "%s/%s/%s",
+ catpath, categories[i]->d_name, ebuilds[k]->d_name);
cachepath[len - 7] = '\0'; /* remove ".ebuild" */
data.category = categories[i]->d_name;
@@ -484,7 +492,7 @@ qcache_traverse_overlay(void (*func)(qcache_data*), const char *overlay)
if (!warned) {
warned = true;
warnp("unable to read cache '%s'\n"
- "\tperhaps you need to `egencache -j 4` ?", cachepath);
+ "\tperhaps you need to `egencache`?", cachepath);
}
}
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-04-18 13:58 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-04-18 13:58 UTC (permalink / raw
To: gentoo-commits
commit: 4176ede48eabc7fce958d6d9c5d22154fe122447
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 18 13:57:51 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Apr 18 13:57:51 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4176ede4
qcache: make categories counting work properly
qcache.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/qcache.c b/qcache.c
index 03bcd05..a3be446 100644
--- a/qcache.c
+++ b/qcache.c
@@ -747,23 +747,24 @@ qcache_stats(qcache_data *data)
runtime = time(NULL);
- xasprintf(&catpath, "%s/dep/%s", portedb, data->overlay);
+ xasprintf(&catpath, "%s/metadata/md5-cache", data->overlay);
dir = opendir(catpath);
while ((de = readdir(dir))) {
/* Look for all the directories in this path. */
-#ifdef DT_UNKNOWN
+#if defined(DT_UNKNOWN) && defined(DT_DIR)
if (de->d_type == DT_UNKNOWN)
#endif
{
struct stat s;
- if (lstat(de->d_name, &s))
+ char spath[_Q_PATH_MAX];
+ snprintf(spath, sizeof(spath), "%s/%s", catpath, de->d_name);
+ if (lstat(spath, &s) != 0)
continue;
if (!S_ISDIR(s.st_mode))
continue;
}
-
-#ifdef DT_DIR
- if (de->d_type != DT_DIR)
+#if defined(DT_UNKNOWN) && defined(DT_DIR)
+ else if (de->d_type != DT_DIR)
continue;
#endif
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-05-18 10:15 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-05-18 10:15 UTC (permalink / raw
To: gentoo-commits
commit: 3c8e539de00f6ff24f6d65ade95ec5aecc09b5b1
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 10:15:04 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri May 18 10:15:04 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3c8e539d
build-sys: update generated files for qtegrity
.depend | 2 +-
Makefile.am | 5 +++++
include_applets.h | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/.depend b/.depend
index d824273..5de684d 100644
--- a/.depend
+++ b/.depend
@@ -7,4 +7,4 @@ main.o: main.c porting.h main.h libq/libq.c libq/busybox.h libq/i18n.h \
libq/prelink.c libq/profile.c libq/vdb.c libq/vdb_get_next_dir.c \
libq/virtuals.c applets.h include_applets.h q.c qcheck.c qdepends.c \
qfile.c qlist.c qlop.c qsearch.c qsize.c qtbz2.c quse.c qxpak.c qpkg.c \
- qgrep.c qatom.c qmerge.c qcache.c qglsa.c
+ qgrep.c qatom.c qmerge.c qcache.c qglsa.c qtegrity.c
diff --git a/Makefile.am b/Makefile.am
index d609b3f..425a018 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,6 +58,7 @@ q_CPPFLAGS += \
-DAPPLET_qsearch \
-DAPPLET_qsize \
-DAPPLET_qtbz2 \
+ -DAPPLET_qtegrity \
-DAPPLET_quse \
-DAPPLET_qxpak
dist_man_MANS += \
@@ -92,6 +93,7 @@ APPLETS += \
qsearch \
qsize \
qtbz2 \
+ qtegrity \
quse \
qxpak
EXTRA_DIST += \
@@ -145,6 +147,7 @@ EXTRA_DIST += \
qsearch.c \
qsize.c \
qtbz2.c \
+ qtegrity.c \
quse.c \
qxpak.c \
tests/Makefile \
@@ -261,6 +264,7 @@ EXTRA_DIST += \
tests/qlist/root/sys-fs/mtools-4.0.13/SLOT \
tests/qlist/root/sys-fs/mtools-4.0.13/repository \
tests/qlop/Makefile \
+ tests/qlop/aborts.log \
tests/qlop/dotest \
tests/qlop/list01.good \
tests/qlop/list02.good \
@@ -270,6 +274,7 @@ EXTRA_DIST += \
tests/qlop/list06.good \
tests/qlop/list07.good \
tests/qlop/list08.good \
+ tests/qlop/list09.good \
tests/qlop/sync.log \
tests/qlop/test04.good \
tests/qmerge/Makefile \
diff --git a/include_applets.h b/include_applets.h
index bed18e6..6ff8f8a 100644
--- a/include_applets.h
+++ b/include_applets.h
@@ -15,3 +15,4 @@
#include "qmerge.c"
#include "qcache.c"
#include "qglsa.c"
+#include "qtegrity.c"
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-05-18 12:19 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-05-18 12:19 UTC (permalink / raw
To: gentoo-commits
commit: c1deada5ab2f1f66d5e1dd684569f74cd9d1f35d
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 11:35:49 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri May 18 11:35:49 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c1deada5
add qtegrity
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 769c4a1..b4d4456 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,3 +51,4 @@ stamp-h1
/qsize
/quse
/qxpak
+/qtegrity
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-05-18 12:19 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-05-18 12:19 UTC (permalink / raw
To: gentoo-commits
commit: a6abfcfaa1ed4530e152b69ca5c46808c5e93d46
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 11:33:58 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri May 18 11:33:58 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a6abfcfa
version_barf: cleanup, add myself
main.c | 13 ++++++++-----
make-tarball.sh | 4 ++--
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/main.c b/main.c
index 9103dc4..7dbdbe7 100644
--- a/main.c
+++ b/main.c
@@ -189,21 +189,24 @@ usage(int status, const char *flags, struct option const opts[],
static void
version_barf(void)
{
+ const char *vcsid = "";
const char *eprefixid = "";
#ifndef VERSION
# define VERSION "git"
#endif
-#ifndef VCSID
-# define VCSID "<unknown>"
+
+#ifdef VCSID
+ vcsid = " (" VCSID ")";
#endif
if (strlen(CONFIG_EPREFIX) > 1)
eprefixid = "configured for " CONFIG_EPREFIX "\n";
- printf("portage-utils-%s: %s\n"
+
+ printf("portage-utils-%s%s\n"
"%s"
- "%s written for Gentoo by <solar and vapier @ gentoo.org>\n",
- VERSION, VCSID, eprefixid, argv0);
+ "written for Gentoo by solar, vapier and grobian\n",
+ VERSION, vcsid, eprefixid);
exit(EXIT_SUCCESS);
}
diff --git a/make-tarball.sh b/make-tarball.sh
index 4f8eed7..ce25579 100755
--- a/make-tarball.sh
+++ b/make-tarball.sh
@@ -36,8 +36,8 @@ git archive "${ver}" | tar xf - -C "${p}"
cd "${p}"
einfo "Building autotools ..."
-sed -i "/^AC_INIT/s:git:${ver}:" configure.ac
-sed -i "1iPV := ${ver}" Makefile
+sed -i "/^AC_INIT/s:git:${ver#v}:" configure.ac
+sed -i "1iPV := ${ver#v}" Makefile
LC_ALL=C ${MAKE} -s autotools >/dev/null
rm -rf autom4te.cache
cd ..
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-05-18 16:58 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-05-18 16:58 UTC (permalink / raw
To: gentoo-commits
commit: a34f5c952f8da3a83be91244be006d4b59c72aa3
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 15:58:01 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri May 18 15:58:01 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a34f5c95
qtegrity: fix signedness warning
qtegrity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qtegrity.c b/qtegrity.c
index 8af5b08..0b30fb8 100644
--- a/qtegrity.c
+++ b/qtegrity.c
@@ -138,7 +138,7 @@ static void get_digest_from_line(char * line, char * ret, int digest_size, int o
{
size_t dlenstr = strlen(line);
/* Skip first chars to get to digest depends on digest_func in IMA */
- int skip = ((digest_size == SHA256_DIGEST_LENGTH) ||
+ size_t skip = ((digest_size == SHA256_DIGEST_LENGTH) ||
(digest_size == SHA512_DIGEST_LENGTH)) ?
offset+8 : offset+6;
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-06-28 9:35 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-06-28 9:35 UTC (permalink / raw
To: gentoo-commits
commit: 0cda5213a912f6423c1679a283861d3d6cb7e3dc
Author: hoefling <oleg.hoefling <AT> gmail <DOT> com>
AuthorDate: Sun May 27 19:15:53 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun May 27 19:17:38 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0cda5213
fixed snippets highlighting
README.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index fb8d800..59692a7 100644
--- a/README.md
+++ b/README.md
@@ -61,13 +61,14 @@ Having your PORTDIR and VDB on the right file system helps dramatically
IDE raid with PORTDIR on reiserfs:
-```
+```sh
$ q -r
q: Finished 20655 entries in 1.990951 seconds
+```
IDE raid with PORTDIR on ext3:
-```
+```sh
$ q -r
q: Finished 20655 entries in 203.664252 seconds
```
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-06-28 9:35 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-06-28 9:35 UTC (permalink / raw
To: gentoo-commits
commit: 223d945738ca75047f8edd1f18eb9686503decdf
Author: Fabian Groffen <grobian <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Thu Jun 28 09:35:20 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jun 28 09:35:20 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=223d9457
Merge pull request #3 from hoefling/readme-fix
Fix code snippets highlighting in README
README.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-07-18 20:20 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-07-18 20:20 UTC (permalink / raw
To: gentoo-commits
commit: de6b2ac12e02c690f8dee2517af1c09b436f5fc9
Author: Hanno Boeck <hanno <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 18 20:03:34 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jul 18 20:03:34 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=de6b2ac1
main: fix potential buffer underrun
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.c b/main.c
index 7dbdbe7..30dd063 100644
--- a/main.c
+++ b/main.c
@@ -969,7 +969,7 @@ initialize_portage_env(void)
/* Make sure ROOT always ends in a slash */
var = &vars_to_read[0];
- if ((*var->value.s)[var->value_len - 1] != '/') {
+ if (var->value_len == 0 || (*var->value.s)[var->value_len - 1] != '/') {
portroot = xrealloc(portroot, var->value_len + 2);
portroot[var->value_len] = '/';
portroot[var->value_len + 1] = '\0';
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-08-01 13:28 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-08-01 13:28 UTC (permalink / raw
To: gentoo-commits
commit: e04d4940401a13f6851c732b70bdba0a64902d10
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 1 13:26:32 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Aug 1 13:26:32 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e04d4940
qmerge: implement laymans file identification, bug #660508
Portage can create binpkgs compressed differently than with bzip2, so
try to probe the file quickly before untarring, so we can use the
correct flag with tar.
Bug: https://bugs.gentoo.org/660508
qmerge.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 2 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 54d6a79..6d98c43 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -773,6 +773,7 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
char **iargv;
char c;
int iargc;
+ const char *compr;
if (!install || !pkg || !atom)
return;
@@ -914,11 +915,54 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
if (run_applet_l("qxpak", "-d", "vdb", "-x", tbz2, NULL) != 0)
err("`qxpak -d vdb -x %s` failed", tbz2);
+ /* figure out if the data is compressed differently from what the
+ * name suggests, bug #660508, usage of BINPKG_COMPRESS,
+ * due to the minimal nature of where we run, we cannot rely on file
+ * or GNU tar, so have to do some laymans MAGIC hunting ourselves */
+ compr = "j"; /* default: bzip2 */
+ {
+ /* bz2: 2-byte: 'B' 'Z' at byte 0
+ * gz: 4-byte: 1f 8b at byte 0
+ * xz: 4-byte: '7' 'z' 'X' 'Z' at byte 1
+ * tar: 6-byte: 'u' 's' 't' 'a' 'r' \0 at byte 257 */
+ unsigned char magic[257+6];
+ FILE *mfd;
+
+ sprintf(tbz2, "%s.tar.bz2", pkg->PF);
+ mfd = fopen(tbz2, "r");
+ if (mfd != NULL) {
+ size_t mlen = fread(magic, 1, sizeof(magic), mfd);
+ fclose(mfd);
+
+ if (mlen >= 2 && magic[0] == 'B' && magic[1] == 'Z') {
+ compr = "j";
+ } else if (mlen >= 4 &&
+ magic[0] == 037 && magic[1] == 0213 &&
+ magic[2] == 010 && magic[3] == 00)
+ {
+ compr = "z";
+ } else if (mlen >= 5 &&
+ magic[1] == '7' && magic[2] == 'z' &&
+ magic[3] == 'X' && magic[4] == 'Z')
+ {
+ compr = "J";
+ } else if (mlen == 257+6 &&
+ magic[257] == 'u' && magic[258] == 's' &&
+ magic[259] == 't' && magic[260] == 'a' &&
+ magic[261] == 'r' && magic[262] == '\0')
+ {
+ compr = "";
+ }
+ }
+ }
+
free(tbz2);
- /* extrct the binary package data */
+ /* extract the binary package data */
mkdir("image", 0755);
- snprintf(buf, sizeof(buf), BUSYBOX " tar -jx%sf %s.tar.bz2 -C image/", ((verbose > 1) ? "v" : ""), pkg->PF);
+ snprintf(buf, sizeof(buf),
+ BUSYBOX " tar -%sx%sf %s.tar.bz2 -C image/",
+ compr, ((verbose > 1) ? "v" : ""), pkg->PF);
xsystem(buf);
fflush(stdout);
^ permalink raw reply related [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-08-06 7:25 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-08-06 7:25 UTC (permalink / raw
To: gentoo-commits
commit: 2203bd5a8b9c3b26b957d93d9c908940a0e676bb
Author: Fabian Groffen <grobian <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Mon Aug 6 07:24:34 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Aug 6 07:24:34 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=2203bd5a
Merge pull request #4 from vaeth/master
qmerge: support for more decompresssion programs
qmerge.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 65 insertions(+), 11 deletions(-)
^ permalink raw reply [flat|nested] 592+ messages in thread
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2018-08-06 7:25 Fabian Groffen
0 siblings, 0 replies; 592+ messages in thread
From: Fabian Groffen @ 2018-08-06 7:25 UTC (permalink / raw
To: gentoo-commits
commit: e50796ff86a75ec01e1346117e7c753b8e955654
Author: Martin Väth <martin <AT> mvath <DOT> de>
AuthorDate: Thu Aug 2 09:53:42 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Aug 6 04:42:06 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e50796ff
qmerge: Support for more decompresssion programs
Support additional compression programs like zstd or lz4 for BINPKG_COMPRESS.
Also make the gzip test less http://www.onicos.com/staff/iz/formats/gzip.html
and the bzip2 test more https://en.wikipedia.org/wiki/Bzip2#File_format
restrictive.
qmerge.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 65 insertions(+), 11 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 6d98c43..a1b5a86 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -919,12 +919,17 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
* name suggests, bug #660508, usage of BINPKG_COMPRESS,
* due to the minimal nature of where we run, we cannot rely on file
* or GNU tar, so have to do some laymans MAGIC hunting ourselves */
- compr = "j"; /* default: bzip2 */
+ compr = "I brotli"; /* default: brotli; has no magic header */
{
- /* bz2: 2-byte: 'B' 'Z' at byte 0
- * gz: 4-byte: 1f 8b at byte 0
+ /* bz2: 3-byte: 'B' 'Z' 'h' at byte 0
+ * gz: 2-byte: 1f 8b at byte 0
* xz: 4-byte: '7' 'z' 'X' 'Z' at byte 1
- * tar: 6-byte: 'u' 's' 't' 'a' 'r' \0 at byte 257 */
+ * tar: 6-byte: 'u' 's' 't' 'a' 'r' \0 at byte 257
+ * lz4: 4-byte: 4 22 4d 18 at byte 0
+ * zst: 4-byte: 22-28 b5 2f fd at byte 0
+ * lz: 4-byte: 'L' 'Z' 'I' 'P' at byte 0
+ * lzo: 9-byte: 89 'L' 'Z' 'O' 0 d a 1a a at byte 0
+ * br: anything else */
unsigned char magic[257+6];
FILE *mfd;
@@ -934,11 +939,12 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
size_t mlen = fread(magic, 1, sizeof(magic), mfd);
fclose(mfd);
- if (mlen >= 2 && magic[0] == 'B' && magic[1] == 'Z') {
+ if (mlen >= 3 && magic[0] == 'B' && magic[1] == 'Z' &&
+ magic[2] == 'h')
+ {
compr = "j";
- } else if (mlen >= 4 &&
- magic[0] == 037 && magic[1] == 0213 &&
- magic[2] == 010 && magic[3] == 00)
+ } else if (mlen >= 2 &&
+ magic[0] == 037 && magic[1] == 0213)
{
compr = "z";
} else if (mlen >= 5 &&
@@ -952,6 +958,40 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg)
magic[261] == 'r' && magic[262] == '\0')
{
compr = "";
+ } else if (mlen >= 4 &&
+ magic[0] == 0x04 && magic[1] == 0x22 &&
+ magic[2] == 0x4D && magic[3] == 0x18)
+ {
+ compr = "I lz4";
+ } else if (mlen >= 4 &&
+ magic[0] >= 0x22 && magic[0] <= 0x28 &&
+ magic[1] == 0xB5 && magic[2] == 0x2F &&
+ magic[3] == 0xFD)
+ {
+ /*
+ * --long=31 is needed to uncompress files compressed with
+ * --long=xx where xx>27. The option is "safe" in the sense
+ * that not more memory is allocated than what is really
+ * needed to decompress the file. See
+ * https://bugs.gentoo.org/show_bug.cgi?id=634980 */
+ compr = "I zstd --long=31";
+ /*
+ * If really tar -I would be used we would have to quote:
+ * compr = "I \"zstd --long=31\"";
+ * But actually we use a pipe (see below) */
+ } else if (mlen >= 4 &&
+ magic[0] == 'L' && magic[1] == 'Z' &&
+ magic[2] == 'I' &