RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 01-Apr-2010 02:55:29 Branch: HEAD Handle: 2010040100552900 Modified files: rpm/tools xiu-instantiate.c xiu-store.c Log: - nix: WIP. Summary: Revision Changes Path 2.2 +10 -13 rpm/tools/xiu-instantiate.c 2.2 +9 -8 rpm/tools/xiu-store.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/tools/xiu-instantiate.c ============================================================================ $ cvs diff -u -r2.1 -r2.2 xiu-instantiate.c --- rpm/tools/xiu-instantiate.c 24 Mar 2010 14:37:31 -0000 2.1 +++ rpm/tools/xiu-instantiate.c 1 Apr 2010 00:55:29 -0000 2.2 @@ -70,7 +70,7 @@ NIX_VERSION = _BASE + 21, /* --version */ }; -static void nixInstantiateArgCallback(poptContext con, +static void rpmnixInstantiateArgCallback(poptContext con, /*...@unused@*/ enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, /*...@unused@*/ void * data) @@ -83,14 +83,6 @@ /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ if (opt->arg == NULL) switch (opt->val) { - case NIX_LOG_TYPE: /* --log-type TYPE */ -#ifdef DYING - s = rpmExpand("--", opt->longName, NULL); - xx = argvAdd(&nix->instArgs, s); - xx = argvAdd(&nix->instArgs, arg); - s = _free(s); -#endif - break; case NIX_ARG: /* --arg ARG1 ARG2 */ #ifdef NOTYET /* XXX needs next 2 args */ xx = argvAdd(&nix->instArgs, arg1); @@ -118,10 +110,10 @@ } } -static struct poptOption nixInstantiateOptions[] = { +struct poptOption _rpmnixInstantiateOptions[] = { /*...@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, - nixInstantiateArgCallback, 0, NULL, NULL }, + rpmnixInstantiateArgCallback, 0, NULL, NULL }, /*...@=type@*/ { "eval-only", '\0', POPT_BIT_SET, &_nix.flags, RPMNIX_FLAGS_EVALONLY, @@ -133,6 +125,8 @@ { "add-root", '\0', POPT_BIT_SET, &_nix.flags, RPMNIX_FLAGS_ADDROOT, N_("add garbage collector roots for the result"), NULL }, + { "indirect", '\0', POPT_BIT_SET, &_nix.flags, RPMNIX_FLAGS_INDIRECT, + N_("print an XML representation of the abstract syntax tree"), NULL }, { "xml", '\0', POPT_BIT_SET, &_nix.flags, RPMNIX_FLAGS_XML, N_("print an XML representation of the abstract syntax tree"), NULL }, { "strict", '\0', POPT_BIT_SET, &_nix.flags, RPMNIX_FLAGS_STRICT, @@ -141,8 +135,11 @@ { "show-trace", '\0', POPT_BIT_SET, &_nix.flags, RPMNIX_FLAGS_SHOWTRACE, N_("FIXME"), NULL }, - { "log-type", '\0', POPT_ARG_STRING, 0, NIX_LOG_TYPE, +#ifdef NOTYET + { "log-type", '\0', POPT_ARG_STRING, &_nix.logType, 0, N_("FIXME"), N_("TYPE") }, +#endif + /* XXX needs next 2 args */ { "arg", '\0', POPT_ARG_NONE, 0, NIX_ARG, N_("FIXME"), N_("ARG1 ARG2") }, @@ -203,7 +200,7 @@ int main(int argc, char *argv[]) { - poptContext optCon = rpmioInit(argc, argv, nixInstantiateOptions); + poptContext optCon = rpmioInit(argc, argv, _rpmnixInstantiateOptions); int ec = 1; /* assume failure */ #ifdef UNUSED ARGV_t av = poptGetArgs(optCon); @@ . patch -p0 <<'@@ .' Index: rpm/tools/xiu-store.c ============================================================================ $ cvs diff -u -r2.1 -r2.2 xiu-store.c --- rpm/tools/xiu-store.c 24 Mar 2010 14:37:31 -0000 2.1 +++ rpm/tools/xiu-store.c 1 Apr 2010 00:55:29 -0000 2.2 @@ -117,15 +117,13 @@ NIX_VERSION = _BASE + 21, /* --version */ }; -static void nixStoreArgCallback(poptContext con, +static void rpmnixStoreArgCallback(poptContext con, /*...@unused@*/ enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, /*...@unused@*/ void * data) /*...@*/ { -#ifdef UNUSED rpmnix nix = &_nix; -#endif /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ if (opt->arg == NULL) @@ -146,7 +144,7 @@ #endif break; case NIX_VERBOSE: /* -v,--verbose */ - verbose++; + nix->verbose++; break; case NIX_VERSION: /* --version */ /* XXX FIXME */ @@ -159,10 +157,10 @@ } } -static struct poptOption nixStoreOptions[] = { +static struct poptOption _rpmnixStoreOptions[] = { /*...@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, - nixStoreArgCallback, 0, NULL, NULL }, + rpmnixStoreArgCallback, 0, NULL, NULL }, /*...@=type@*/ { "max-jobs", 'j', POPT_ARG_INT, &_nix.jobs, 0, @@ -248,8 +246,11 @@ { "gcdelete", '\0', POPT_BIT_SET, &_nix.gc, NIX_GC_DELETE, N_("delete dead paths (default)"), NULL }, - { "log-type", '\0', POPT_ARG_STRING, 0, NIX_LOG_TYPE, +#ifdef NOTYET + { "log-type", '\0', POPT_ARG_STRING, &_mix.logType, 0, N_("FIXME"), N_("TYPE") }, +#endif + /* XXX needs next 2 args */ { "option", '\0', POPT_ARG_NONE, 0, NIX_OPTION, N_("FIXME"), N_("OPT1 OPT2") }, @@ -338,7 +339,7 @@ int main(int argc, char *argv[]) { - poptContext optCon = rpmioInit(argc, argv, nixStoreOptions); + poptContext optCon = rpmioInit(argc, argv, _rpmnixStoreOptions); int ec = 1; /* assume failure */ #ifdef UNUSED rpmnix nix = &_nix; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
