-#if defined(ENABLE_NLS)
- /* set up the correct locale */
- (void) setlocale(LC_ALL, "" );
-
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-#endif
-
- rpmSetVerbosity(RPMLOG_NOTICE); /* XXX silly use by showrc */
-
- /* Only build has it's own set of aliases, everything else uses rpm */
- poptCtx = "rpm";
-
- /* Make a first pass through the arguments, looking for --rcfile */
- /* We need to handle that before dealing with the rest of the arguments. */
- /* XXX popt argv definition should be fixed instead of casting... */
- optCon = poptGetContext(poptCtx, argc, (const char **)argv, optionsTable, 0);
- {
- char *poptfile = rpmGenPath(rpmConfigDir(), LIBRPMALIAS_FILENAME, NULL);
- (void) poptReadConfigFile(optCon, poptfile);
- free(poptfile);
- }
- (void) poptReadDefaultConfig(optCon, 1);
- poptSetExecPath(optCon, rpmConfigDir(), 1);
-
- while ((arg = poptGetNextOpt(optCon)) > 0) {
- optArg = poptGetOptArg(optCon);
-
- switch (arg) {
- default:
- fprintf(stderr, _("Internal error in argument processing (%d) :-(\n"), arg);
- exit(EXIT_FAILURE);
- }
- }
-
- if (arg < -1) {
- fprintf(stderr, "%s: %s\n",
- poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
- poptStrerror(arg));
- exit(EXIT_FAILURE);
- }
-
- rpmcliConfigured();
-
-#ifdef IAM_RPMDB
- if (bigMode == MODE_UNKNOWN || (bigMode & MODES_DB)) {
- if (da->init) {
- if (bigMode != MODE_UNKNOWN)
- argerror(_("only one major mode may be specified"));
- else
- bigMode = MODE_INITDB;
- } else
- if (da->rebuild) {
- if (bigMode != MODE_UNKNOWN)
- argerror(_("only one major mode may be specified"));
- else
- bigMode = MODE_REBUILDDB;
- } else
- if (da->verify) {
- if (bigMode != MODE_UNKNOWN)
- argerror(_("only one major mode may be specified"));
- else
- bigMode = MODE_VERIFYDB;
- }
- }
-#endif /* IAM_RPMDB */
-