summaryrefslogtreecommitdiff
path: root/lib/tgi.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-10-19 15:54:38 +0000
committerjbj <devnull@localhost>2004-10-19 15:54:38 +0000
commit343b3223e8d23b17809eb04db1d9826a8a709edb (patch)
tree1cc92f801cd6d99cd529ef83956b58ccd3543dbe /lib/tgi.c
parentfb6dac4267136d0209ccdd5ddb13691c178f0ffe (diff)
downloadrpm-343b3223e8d23b17809eb04db1d9826a8a709edb.tar.gz
rpm-343b3223e8d23b17809eb04db1d9826a8a709edb.tar.bz2
rpm-343b3223e8d23b17809eb04db1d9826a8a709edb.zip
Merge iterator types into pseudo tags.
Load argv and ftpopts through iterator modifier, not creator. CVS patchset: 7486 CVS date: 2004/10/19 15:54:38
Diffstat (limited to 'lib/tgi.c')
-rw-r--r--lib/tgi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/tgi.c b/lib/tgi.c
index dfeb39619..73e04bb65 100644
--- a/lib/tgi.c
+++ b/lib/tgi.c
@@ -10,7 +10,7 @@
#include "debug.h"
-static int gitag = RPMGI_FTSWALK;
+static int gitag = RPMDBI_FTSWALK;
static int ftsOpts = 0;
static const char * queryFormat = NULL;
@@ -38,13 +38,13 @@ static struct poptOption optionsTable[] = {
{ "rpmgidebug", 'd', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmgi_debug, -1,
N_("debug generalized iterator"), NULL},
- { "rpmdb", '\0', POPT_ARG_VAL, &gitag, RPMGI_RPMDB,
+ { "rpmdb", '\0', POPT_ARG_VAL, &gitag, RPMDBI_PACKAGES,
N_("iterate rpmdb"), NULL },
- { "hdlist", '\0', POPT_ARG_VAL, &gitag, RPMGI_HDLIST,
+ { "hdlist", '\0', POPT_ARG_VAL, &gitag, RPMDBI_HDLIST,
N_("iterate hdlist"), NULL },
- { "arglist", '\0', POPT_ARG_VAL, &gitag, RPMGI_ARGLIST,
+ { "arglist", '\0', POPT_ARG_VAL, &gitag, RPMDBI_ARGLIST,
N_("iterate arglist"), NULL },
- { "ftswalk", '\0', POPT_ARG_VAL, &gitag, RPMGI_FTSWALK,
+ { "ftswalk", '\0', POPT_ARG_VAL, &gitag, RPMDBI_FTSWALK,
N_("iterate fts(3) walk"), NULL },
{ "qf", '\0', POPT_ARG_STRING, &queryFormat, 0,
@@ -110,8 +110,10 @@ main(int argc, char *const argv[])
(void) rpmtsSetTid(ts, tid);
}
+ gi = rpmgiNew(ts, gitag, NULL, 0);
+
av = poptGetArgs(optCon);
- gi = rpmgiNew(ts, gitag, av, ftsOpts);
+ (void) rpmgiSetArgs(gi, av, ftsOpts);
ac = 0;
while (rpmgiNext(gi) == RPMRC_OK) {