aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.depend6
-rw-r--r--Makefile11
-rw-r--r--README23
-rw-r--r--TODO8
-rw-r--r--applets.h40
-rw-r--r--config.h21
-rw-r--r--include_applets.h16
-rw-r--r--main.c31
-rw-r--r--q.c6
-rw-r--r--qatom.c8
-rw-r--r--qcheck.c8
-rw-r--r--qdepends.c8
-rw-r--r--qfile.c8
-rw-r--r--qglsa.c8
-rw-r--r--qgrep.c14
-rw-r--r--qlist.c8
-rw-r--r--qlop.c8
-rw-r--r--qmerge.c14
-rw-r--r--qpkg.c8
-rw-r--r--qsearch.c13
-rw-r--r--qsize.c8
-rw-r--r--qtbz2.c8
-rw-r--r--quse.c15
-rw-r--r--qxpak.c8
-rw-r--r--template.c12
25 files changed, 186 insertions, 132 deletions
diff --git a/.depend b/.depend
index d2b6329..e36701e 100644
--- a/.depend
+++ b/.depend
@@ -2,6 +2,6 @@ main.o: main.c libq/libq.c libq/busybox.h libq/i18n.h libq/libq.h \
libq/colors.c libq/xmalloc.c libq/xstrdup.c libq/xasprintf.c \
libq/hash_fd.c libq/md5_sha1_sum.c libq/human_readable.c libq/rmspace.c \
libq/atom_explode.c libq/atom_compare.c libq/vdb_get_next_dir.c \
- libq/virtuals.c applets.h q.c qcheck.c qdepends.c qfile.c qlist.c \
- qlop.c qsearch.c qsize.c qmerge.c qtbz2.c quse.c qxpak.c qpkg.c qgrep.c \
- qatom.c
+ libq/virtuals.c applets.h config.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 qglsa.c
diff --git a/Makefile b/Makefile
index 8ce8a03..627423a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Copyright 2005-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.40 2006/01/23 12:50:58 solar Exp $
+# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.41 2006/01/24 23:35:08 vapier Exp $
####################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -46,10 +46,10 @@ HFLAGS += -DVERSION=\"$(PV)\"
endif
#####################################################
-APPLETS = q qatom qcheck qdepends qfile qgrep qlist qlop qpkg qsearch qsize qtbz2 quse qxpak
-APPLETS += qmerge
-SRC = $(APPLETS:%=%.c) main.c
-MPAGES = man/q.1
+APPLETS_SHELL := sed -n '/^DECLARE_APPLET/s:.*(\(.*\)).*:\1:p' applets.h
+APPLETS := $(shell $(APPLETS_SHELL))
+SRC := $(APPLETS:%=%.c) main.c
+MPAGES := man/q.1
HFLAGS += $(shell for x in $(APPLETS) ; do echo -n "-DAPPLET_$$x "; done)
all: q
@:
@@ -66,6 +66,7 @@ endif
@$(CC) $(WFLAGS) $(LDFLAGS) $(CFLAGS) $(HFLAGS) main.c -o q
depend:
+ $(APPLETS_SHELL) | sed -e 's:^:#include ":;s:$$:.c":' > include_applets.h
@#$(CC) $(CFLAGS) -MM $(SRC) > .depend
$(CC) $(HFLAGS) $(CFLAGS) -MM main.c > .depend
diff --git a/README b/README
index ee1a658..1331a49 100644
--- a/README
+++ b/README
@@ -1,16 +1,14 @@
# Copyright 2005-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/portage-utils/README,v 1.15 2006/01/05 03:35:43 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/portage-utils/README,v 1.16 2006/01/24 23:35:08 vapier Exp $
Developers to contact:
-solar@gentoo.org
-vapier@gentoo.org
+ solar@gentoo.org
+ vapier@gentoo.org
-/* Add notes here */
-disable color when tty = NULL; may break less?
-- multiline reads don't yet work for quse/qsearch
+Dev Notes:
- Speed is everything.
Having your PORTDIR and VDB on the right file system helps dramatically
@@ -32,13 +30,14 @@ so behind the real tree which is hosted on cvs.gentoo.org
cvs -d:pserver:anonymous@zarquon.twobit.net:/var/cvsroot -q -z9 co -R gentoo-projects/portage-utils
+
- Adding applets is easy using the q framework.
-cp template.c qmyapplet.c (all applets use the prefix of the letter 'q')
-edit applets.h add your prototype, then scroll down the typedef for
-applets[] and add your applet name following the existing syntax. Please
-try to keep applet names under 8 chars. Finally, edit main.c, scroll to
-the bottom, and add your applet to the #include list.
+ 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 it's functionality by adding more options vs adding a bunch of new
+on its functionality by adding more options vs adding a bunch of new
little applets.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..cc6592d
--- /dev/null
+++ b/TODO
@@ -0,0 +1,8 @@
+- 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
diff --git a/applets.h b/applets.h
index dc52bf0..137386e 100644
--- a/applets.h
+++ b/applets.h
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/applets.h,v 1.12 2006/01/07 16:25:28 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/applets.h,v 1.13 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -11,27 +11,30 @@
#define _QAPPLETS_H_
/* applet prototypes */
-int q_main(int, char **);
-int qcheck_main(int, char **);
-int qdepends_main(int, char **);
-int qfile_main(int, char **);
-int qlist_main(int, char **);
-int qlop_main(int, char **);
-int qsearch_main(int, char **);
-int qsize_main(int, char **);
-int qtbz2_main(int, char **);
-int quse_main(int, char **);
-int qxpak_main(int, char **);
-int qpkg_main(int, char **);
-int qgrep_main(int, char **);
-int qatom_main(int, char **);
-int qmerge_main(int, char **);
-
typedef int (*APPLET)(int, char **);
+#define DECLARE_APPLET(applet) \
+ extern int applet##_main(int, char **) __attribute__((weak));
+DECLARE_APPLET(q)
+DECLARE_APPLET(qcheck)
+DECLARE_APPLET(qdepends)
+DECLARE_APPLET(qfile)
+DECLARE_APPLET(qlist)
+DECLARE_APPLET(qlop)
+DECLARE_APPLET(qsearch)
+DECLARE_APPLET(qsize)
+DECLARE_APPLET(qtbz2)
+DECLARE_APPLET(quse)
+DECLARE_APPLET(qxpak)
+DECLARE_APPLET(qpkg)
+DECLARE_APPLET(qgrep)
+DECLARE_APPLET(qatom)
+DECLARE_APPLET(qmerge)
+DECLARE_APPLET(qglsa)
+#undef DECLARE_APPLET
+
struct applet_t {
const char *name;
- /* int *func; */
APPLET func;
const char *opts;
const char *desc;
@@ -42,6 +45,7 @@ struct applet_t {
{"qcheck", qcheck_main, "<pkgname>", "verify mtimes/digests"},
{"qdepends", qdepends_main, "<pkgname>", "show dependency info"},
{"qfile", qfile_main, "<filename>", "list all pkgs owning files"},
+ {"qglsa", qglsa_main, "<action> <list>", "check GLSAs against system"},
{"qgrep", qgrep_main, "<misc args>", "grep in ebuilds"},
{"qlist", qlist_main, "<pkgname>", "list files owned by pkgname"},
{"qlop", qlop_main, "<pkgname>", "emerge log analyzer"},
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..adf1cdd
--- /dev/null
+++ b/config.h
@@ -0,0 +1,21 @@
+/* control which applets to include
+ *
+ * #undef OMIT_QFOO -> include QFOO
+ * #define OMIT_QBAR -> disable QBAR
+ */
+
+#undef OMIT_QATOM
+#undef OMIT_QCHECK
+#undef OMIT_QDEPENDS
+#undef OMIT_QFILE
+#define OMIT_QGLSA
+#undef OMIT_QGREP
+#undef OMIT_QLIST
+#undef OMIT_QLOP
+#define OMIT_QMERGE
+#undef OMIT_QPKG
+#undef OMIT_QSEARCH
+#undef OMIT_QSIZE
+#undef OMIT_QTBZ2
+#undef OMIT_QUSE
+#undef OMIT_QXPAK
diff --git a/include_applets.h b/include_applets.h
new file mode 100644
index 0000000..7f85455
--- /dev/null
+++ b/include_applets.h
@@ -0,0 +1,16 @@
+#include "q.c"
+#include "qcheck.c"
+#include "qdepends.c"
+#include "qfile.c"
+#include "qlist.c"
+#include "qlop.c"
+#include "qsearch.c"
+#include "qsize.c"
+#include "qtbz2.c"
+#include "quse.c"
+#include "qxpak.c"
+#include "qpkg.c"
+#include "qgrep.c"
+#include "qatom.c"
+#include "qmerge.c"
+#include "qglsa.c"
diff --git a/main.c b/main.c
index 753a6d8..0983292 100644
--- a/main.c
+++ b/main.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.101 2006/01/24 01:02:26 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.102 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -154,10 +154,11 @@ static void usage(int status, const char *flags, struct option const opts[],
NORM, YELLOW, NORM, DKBLUE, NORM);
printf("%sCurrently defined applets:%s\n", GREEN, NORM);
for (i = 0; applets[i].desc; ++i)
- printf(" %s%8s%s %s%-16s%s%s:%s %s\n",
- YELLOW, applets[i].name, NORM,
- DKBLUE, applets[i].opts, NORM,
- RED, NORM, _(applets[i].desc));
+ if (applets[i].func)
+ printf(" %s%8s%s %s%-16s%s%s:%s %s\n",
+ YELLOW, applets[i].name, NORM,
+ DKBLUE, applets[i].opts, NORM,
+ RED, NORM, _(applets[i].desc));
} else {
printf("%sUsage:%s %s%s%s %s%s%s %s:%s %s\n", GREEN, NORM,
YELLOW, applets[blabber].name, NORM,
@@ -950,23 +951,6 @@ fuckit:
return cpf;
}
-#include "q.c"
-#include "qcheck.c"
-#include "qdepends.c"
-#include "qfile.c"
-#include "qlist.c"
-#include "qlop.c"
-#include "qsearch.c"
-#include "qsize.c"
-#include "qmerge.c"
-#include "qtbz2.c"
-#include "quse.c"
-#include "qxpak.c"
-#include "qpkg.c"
-#include "qgrep.c"
-#include "qatom.c"
-
-
void cleanup() {
reinitialize_as_needed();
free_sets(virtuals);
@@ -998,3 +982,6 @@ int main(int argc, char **argv)
optind = 0;
return q_main(argc, argv);
}
+
+#include "config.h"
+#include "include_applets.h"
diff --git a/q.c b/q.c
index 51603c7..e83671d 100644
--- a/q.c
+++ b/q.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/q.c,v 1.26 2006/01/23 12:50:58 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/q.c,v 1.27 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -18,7 +18,7 @@ static const char *q_opts_help[] = {
"Reinitialize ebuild cache",
COMMON_OPTS_HELP
};
-static const char q_rcsid[] = "$Id: q.c,v 1.26 2006/01/23 12:50:58 solar Exp $";
+static const char q_rcsid[] = "$Id: q.c,v 1.27 2006/01/24 23:35:08 vapier Exp $";
#define q_usage(ret) usage(ret, Q_FLAGS, q_long_opts, q_opts_help, lookup_applet_idx("q"))
@@ -47,7 +47,7 @@ APPLET lookup_applet(char *applet)
}
/* still nothing ? those bastards ... */
warn("Unknown applet '%s'", applet);
- return 0;
+ return NULL;
}
int lookup_applet_idx(const char *applet)
diff --git a/qatom.c b/qatom.c
index 8f56126..940562c 100644
--- a/qatom.c
+++ b/qatom.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qatom.c,v 1.2 2006/01/11 01:37:07 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qatom.c,v 1.3 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QATOM
+
#define QATOM_FLAGS "c" COMMON_FLAGS
static struct option const qatom_long_opts[] = {
{"compare", no_argument, NULL, 'c'},
@@ -17,7 +19,7 @@ static const char *qatom_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qatom_rcsid[] = "$Id: qatom.c,v 1.2 2006/01/11 01:37:07 vapier Exp $";
+static const char qatom_rcsid[] = "$Id: qatom.c,v 1.3 2006/01/24 23:35:08 vapier Exp $";
#define qatom_usage(ret) usage(ret, QATOM_FLAGS, qatom_long_opts, qatom_opts_help, lookup_applet_idx("qatom"))
int qatom_main(int argc, char **argv)
@@ -65,3 +67,5 @@ int qatom_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+
+#endif
diff --git a/qcheck.c b/qcheck.c
index c7df964..3545595 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.21 2006/01/05 03:35:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.22 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QCHECK
+
#define QCHECK_FLAGS "a" COMMON_FLAGS
static struct option const qcheck_long_opts[] = {
{"all", no_argument, NULL, 'a'},
@@ -16,7 +18,7 @@ static const char *qcheck_opts_help[] = {
"List all packages",
COMMON_OPTS_HELP
};
-static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.21 2006/01/05 03:35:43 vapier Exp $";
+static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.22 2006/01/24 23:35:08 vapier Exp $";
#define qcheck_usage(ret) usage(ret, QCHECK_FLAGS, qcheck_long_opts, qcheck_opts_help, lookup_applet_idx("qcheck"))
@@ -161,3 +163,5 @@ int qcheck_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+
+#endif
diff --git a/qdepends.c b/qdepends.c
index 280692e..dac121b 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.33 2006/01/05 03:35:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.34 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QDEPENDS
+
#define QDEPENDS_FLAGS "drpaNk:Q:" COMMON_FLAGS
static struct option const qdepends_long_opts[] = {
{"depend", no_argument, NULL, 'd'},
@@ -28,7 +30,7 @@ static const char *qdepends_opts_help[] = {
"Show all DEPEND info",
COMMON_OPTS_HELP
};
-static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.33 2006/01/05 03:35:43 vapier Exp $";
+static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.34 2006/01/24 23:35:08 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;
@@ -559,3 +561,5 @@ int qdepends_main(int argc, char **argv)
return (query ? qdepends_vdb_deep(depend_file, query)
: qdepends_main_vdb(depend_file, argc, argv));
}
+
+#endif
diff --git a/qfile.c b/qfile.c
index 072c655..52d834b 100644
--- a/qfile.c
+++ b/qfile.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.23 2006/01/05 03:35:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.24 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QFILE
+
#define QFILE_FLAGS "e" COMMON_FLAGS
static struct option const qfile_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
@@ -16,7 +18,7 @@ static const char *qfile_opts_help[] = {
"Exact match",
COMMON_OPTS_HELP
};
-static char qfile_rcsid[] = "$Id: qfile.c,v 1.23 2006/01/05 03:35:43 vapier Exp $";
+static char qfile_rcsid[] = "$Id: qfile.c,v 1.24 2006/01/24 23:35:08 vapier Exp $";
#define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, qfile_opts_help, lookup_applet_idx("qfile"))
void qfile(char *path, char *fullname);
@@ -143,3 +145,5 @@ int qfile_main(int argc, char **argv)
return (found ? EXIT_SUCCESS : EXIT_FAILURE);
}
+
+#endif
diff --git a/qglsa.c b/qglsa.c
index b26c424..adf4346 100644
--- a/qglsa.c
+++ b/qglsa.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qglsa.c,v 1.1 2006/01/24 00:29:00 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qglsa.c,v 1.2 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QGLSA
+
#define QGLSA_DB "/var/cache/edb/glsa"
@@ -29,7 +31,7 @@ static const char *qglsa_opts_help[] = {
"Mark specified GLSAs as fixed",
COMMON_OPTS_HELP
};
-static const char qglsa_rcsid[] = "$Id: qglsa.c,v 1.1 2006/01/24 00:29:00 vapier Exp $";
+static const char qglsa_rcsid[] = "$Id: qglsa.c,v 1.2 2006/01/24 23:35:08 vapier Exp $";
#define qglsa_usage(ret) usage(ret, QGLSA_FLAGS, qglsa_long_opts, qglsa_opts_help, lookup_applet_idx("qglsa"))
@@ -153,3 +155,5 @@ int qglsa_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+
+#endif
diff --git a/qgrep.c b/qgrep.c
index a3c01c0..5166c75 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -1,14 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qgrep.c,v 1.10 2006/01/07 16:25:28 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qgrep.c,v 1.11 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
* Copyright 2005 Petteri R├Ąty - <betelgeuse@gentoo.org>
*/
-#ifdef APPLET_qgrep
+#ifndef OMIT_QGREP
#define QGREP_FLAGS "IiHce" COMMON_FLAGS
static struct option const qgrep_long_opts[] = {
@@ -27,7 +27,7 @@ static const char *qgrep_opts_help[] = {
"Use PATTERN as a regular expression",
COMMON_OPTS_HELP
};
-static const char qgrep_rcsid[] = "$Id: qgrep.c,v 1.10 2006/01/07 16:25:28 solar Exp $";
+static const char qgrep_rcsid[] = "$Id: qgrep.c,v 1.11 2006/01/24 23:35:08 vapier Exp $";
#define qgrep_usage(ret) usage(ret, QGREP_FLAGS, qgrep_long_opts, qgrep_opts_help, lookup_applet_idx("qgrep"))
int qgrep_main(int argc, char **argv)
@@ -120,10 +120,4 @@ int qgrep_main(int argc, char **argv)
return EXIT_SUCCESS;
}
-#else /* ! APPLET_qrep */
-int qgrep_main(int argc, char **argv) {
- errf("%s", err_noapplet);
-}
-#endif /* APPLET_qgrep */
-
-
+#endif
diff --git a/qlist.c b/qlist.c
index 9577787..3d89601 100644
--- a/qlist.c
+++ b/qlist.c
@@ -1,13 +1,15 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qlist.c,v 1.29 2006/01/06 01:59:30 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qlist.c,v 1.30 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
* Copyright 2005 Martin Schlemmer - <azarah@gentoo.org>
*/
+#ifndef OMIT_QLIST
+
#define QLIST_FLAGS "IDedos" COMMON_FLAGS
static struct option const qlist_long_opts[] = {
{"installed", no_argument, NULL, 'I'},
@@ -29,7 +31,7 @@ static const char *qlist_opts_help[] = {
/* "query filename for pkgname", */
COMMON_OPTS_HELP
};
-static const char qlist_rcsid[] = "$Id: qlist.c,v 1.29 2006/01/06 01:59:30 solar Exp $";
+static const char qlist_rcsid[] = "$Id: qlist.c,v 1.30 2006/01/24 23:35:08 vapier Exp $";
#define qlist_usage(ret) usage(ret, QLIST_FLAGS, qlist_long_opts, qlist_opts_help, lookup_applet_idx("qlist"))
@@ -220,4 +222,4 @@ int qlist_main(int argc, char **argv)
return EXIT_SUCCESS;
}
-
+#endif
diff --git a/qlop.c b/qlop.c
index d58c15d..18ded55 100644
--- a/qlop.c
+++ b/qlop.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qlop.c,v 1.26 2006/01/05 03:15:09 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qlop.c,v 1.27 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QLOP
+
#ifdef __linux__
# include <asm/param.h>
# define __QLOP_CURRENT__
@@ -39,7 +41,7 @@ static const char *qlop_opts_help[] = {
"Read emerge logfile instead of " QLOP_DEFAULT_LOGFILE,
COMMON_OPTS_HELP
};
-static const char qlop_rcsid[] = "$Id: qlop.c,v 1.26 2006/01/05 03:15:09 vapier Exp $";
+static const char qlop_rcsid[] = "$Id: qlop.c,v 1.27 2006/01/24 23:35:08 vapier Exp $";
#define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, lookup_applet_idx("qlop"))
#define QLOP_LIST 0x01
@@ -403,3 +405,5 @@ int qlop_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+
+#endif
diff --git a/qmerge.c b/qmerge.c
index 5a9e8a7..cb23841 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -1,13 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.22 2006/01/24 01:02:26 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.23 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
-#ifdef APPLET_qmerge
+#ifndef OMIT_QMERGE
+
/*
--nofiles don't verify files in package
--noscript don't execute %verifyscript (if any)
@@ -45,7 +46,7 @@ static const char *qmerge_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.22 2006/01/24 01:02:26 solar Exp $";
+static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.23 2006/01/24 23:35:08 vapier Exp $";
#define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge"))
char pretend = 0;
@@ -1391,9 +1392,4 @@ int qmerge_main(int argc, char **argv) {
return parse_packages(Packages, ARGC, ARGV);
}
-#else /* ! APPLET_qmerge */
-int qmerge_main(int argc, char **argv) {
- errf("%s%s%s", err_noapplet, DKGREEN, NORM);
-}
-#endif /* APPLET_qmerge */
-
+#endif
diff --git a/qpkg.c b/qpkg.c
index e04cbd7..afd1136 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qpkg.c,v 1.10 2006/01/05 03:35:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qpkg.c,v 1.11 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QPKG
+
#define QPKG_FLAGS "" COMMON_FLAGS
static struct option const qpkg_long_opts[] = {
COMMON_LONG_OPTS
@@ -14,7 +16,7 @@ static struct option const qpkg_long_opts[] = {
static const char *qpkg_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qpkg_rcsid[] = "$Id: qpkg.c,v 1.10 2006/01/05 03:35:43 vapier Exp $";
+static const char qpkg_rcsid[] = "$Id: qpkg.c,v 1.11 2006/01/24 23:35:08 vapier Exp $";
#define qpkg_usage(ret) usage(ret, QPKG_FLAGS, qpkg_long_opts, qpkg_opts_help, lookup_applet_idx("qpkg"))
@@ -213,3 +215,5 @@ retry_mkdir:
return (pkgs_made ? EXIT_SUCCESS : EXIT_FAILURE);
}
+
+#endif
diff --git a/qsearch.c b/qsearch.c
index 1aae905..4278291 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -1,13 +1,13 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qsearch.c,v 1.26 2006/01/07 16:25:28 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qsearch.c,v 1.27 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
-#ifdef APPLET_qsearch
+#ifndef OMIT_QSEARCH
#define QSEARCH_FLAGS "acsSNH" COMMON_FLAGS
static struct option const qsearch_long_opts[] = {
@@ -28,7 +28,7 @@ static const char *qsearch_opts_help[] = {
"Show homepage info",
COMMON_OPTS_HELP
};
-static const char qsearch_rcsid[] = "$Id: qsearch.c,v 1.26 2006/01/07 16:25:28 solar Exp $";
+static const char qsearch_rcsid[] = "$Id: qsearch.c,v 1.27 2006/01/24 23:35:08 vapier Exp $";
#define qsearch_usage(ret) usage(ret, QSEARCH_FLAGS, qsearch_long_opts, qsearch_opts_help, lookup_applet_idx("qsearch"))
@@ -157,9 +157,4 @@ int qsearch_main(int argc, char **argv)
return EXIT_SUCCESS;
}
-
-#else /* ! APPLET_qsearch */
-int qsearch_main(int argc, char **argv) {
- errf("%s", err_noapplet);
-}
-#endif /* APPLET_qsearch */
+#endif
diff --git a/qsize.c b/qsize.c
index b07c5c4..f2913a2 100644
--- a/qsize.c
+++ b/qsize.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qsize.c,v 1.18 2006/01/05 03:35:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qsize.c,v 1.19 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QSIZE
+
#define QSIZE_FLAGS "fasSmkb" COMMON_FLAGS
static struct option const qsize_long_opts[] = {
{"filesystem", no_argument, NULL, 'f'},
@@ -28,7 +30,7 @@ static const char *qsize_opts_help[] = {
"Display size in bytes",
COMMON_OPTS_HELP
};
-static const char qsize_rcsid[] = "$Id: qsize.c,v 1.18 2006/01/05 03:35:43 vapier Exp $";
+static const char qsize_rcsid[] = "$Id: qsize.c,v 1.19 2006/01/24 23:35:08 vapier Exp $";
#define qsize_usage(ret) usage(ret, QSIZE_FLAGS, qsize_long_opts, qsize_opts_help, lookup_applet_idx("qsize"))
@@ -159,3 +161,5 @@ int qsize_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+
+#endif
diff --git a/qtbz2.c b/qtbz2.c
index f3f02cb..eec825e 100644
--- a/qtbz2.c
+++ b/qtbz2.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.9 2006/01/05 03:35:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.10 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QTBZ2
+
/*
# The format for a tbz2/xpak:
#
@@ -44,7 +46,7 @@ static const char *qtbz2_opts_help[] = {
"Write files to stdout",
COMMON_OPTS_HELP
};
-static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.9 2006/01/05 03:35:43 vapier Exp $";
+static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.10 2006/01/24 23:35:08 vapier Exp $";
#define qtbz2_usage(ret) usage(ret, QTBZ2_FLAGS, qtbz2_long_opts, qtbz2_opts_help, lookup_applet_idx("qtbz2"))
@@ -299,3 +301,5 @@ int qtbz2_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+
+#endif
diff --git a/quse.c b/quse.c
index f5be845..81ad8da 100644
--- a/quse.c
+++ b/quse.c
@@ -1,19 +1,19 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/quse.c,v 1.45 2006/01/07 16:25:28 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/quse.c,v 1.46 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QUSE
+
/*
quse -CKe -- '-*' {'~',-,}{alpha,amd64,hppa,ia64,ppc,ppc64,sparc,x86}
quse -Ke -- nls
*/
-#ifdef APPLET_quse
-
#define QUSE_FLAGS "eavKLD" COMMON_FLAGS
static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
@@ -33,7 +33,7 @@ static const char *quse_opts_help[] = {
/* "Use your own variable formats. -F NAME=", */
COMMON_OPTS_HELP
};
-static const char quse_rcsid[] = "$Id: quse.c,v 1.45 2006/01/07 16:25:28 solar Exp $";
+static const char quse_rcsid[] = "$Id: quse.c,v 1.46 2006/01/24 23:35:08 vapier Exp $";
#define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, lookup_applet_idx("quse"))
int quse_describe_flag(int ind, int argc, char **argv);
@@ -351,9 +351,4 @@ int quse_main(int argc, char **argv)
return EXIT_SUCCESS;
}
-#else /* ! APPLET_quse */
-int quse_main(int argc, char **argv) {
- errf("%s", err_noapplet);
-}
-#endif /* APPLET_quse */
-
+#endif
diff --git a/qxpak.c b/qxpak.c
index 45e38c1..b7c6a6d 100644
--- a/qxpak.c
+++ b/qxpak.c
@@ -1,12 +1,14 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qxpak.c,v 1.9 2006/01/05 03:35:43 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qxpak.c,v 1.10 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
+#ifndef OMIT_QXPAK
+
/*
# The format for a tbz2/xpak:
#
@@ -46,7 +48,7 @@ static const char *qxpak_opts_help[] = {
"Write files to stdout",
COMMON_OPTS_HELP
};
-static const char qxpak_rcsid[] = "$Id: qxpak.c,v 1.9 2006/01/05 03:35:43 vapier Exp $";
+static const char qxpak_rcsid[] = "$Id: qxpak.c,v 1.10 2006/01/24 23:35:08 vapier Exp $";
#define qxpak_usage(ret) usage(ret, QXPAK_FLAGS, qxpak_long_opts, qxpak_opts_help, lookup_applet_idx("qxpak"))
@@ -390,3 +392,5 @@ int qxpak_main(int argc, char **argv)
return EXIT_SUCCESS;
}
+
+#endif
diff --git a/template.c b/template.c
index 7350a21..af60ccb 100644
--- a/template.c
+++ b/template.c
@@ -1,13 +1,13 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/template.c,v 1.8 2006/01/07 16:25:28 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/template.c,v 1.9 2006/01/24 23:35:08 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
*/
-#ifdef APPLET_qtemp
+#ifndef OMIT_QTEMP
#define QTEMP_FLAGS "" COMMON_FLAGS
static struct option const qtemp_long_opts[] = {
@@ -17,7 +17,7 @@ static const char *qtemp_opts_help[] = {
COMMON_OPTS_HELP
};
-static const char qtemp_rcsid[] = "$Id: template.c,v 1.8 2006/01/07 16:25:28 solar Exp $";
+static const char qtemp_rcsid[] = "$Id: template.c,v 1.9 2006/01/24 23:35:08 vapier Exp $";
#define qtemp_usage(ret) usage(ret, QTEMP_FLAGS, qtemp_long_opts, qtemp_opts_help, lookup_applet_idx("qtemp"))
@@ -39,8 +39,4 @@ int qtemp_main(int argc, char **argv)
return EXIT_SUCCESS;
}
-#else /* ! APPLET_qtemp */
-int qtemp_main(int argc, char **argv) {
- errf("%s", err_noapplet);
-}
-#endif /* APPLET_qtemp */
+#endif