From 43b08986a8aa0464566716f6fe0d510e96cd77bf Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sat, 22 Nov 2008 18:08:40 +0200 Subject: Use rpmConfigDir() for finding our popt alias file - this allows popt aliases to be reliably available in tests - why do we have the popt initialization done twice? --- rpmqv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'rpmqv.c') diff --git a/rpmqv.c b/rpmqv.c index a9ec0743e..cd8f2ee4f 100644 --- a/rpmqv.c +++ b/rpmqv.c @@ -15,6 +15,7 @@ const char *__progname; #include /* RPMSIGTAG, rpmReadPackageFile .. */ #include #include +#include #include #include @@ -261,11 +262,15 @@ int main(int argc, char *argv[]) /* 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); - (void) poptReadConfigFile(optCon, LIBRPMALIAS_FILENAME); + { + char *poptfile = rpmGenPath(rpmConfigDir(), LIBRPMALIAS_FILENAME, NULL); + (void) poptReadConfigFile(optCon, poptfile); + free(poptfile); + } #if RPM_USES_POPTREADDEFAULTCONFIG (void) poptReadDefaultConfig(optCon, 1); #endif - poptSetExecPath(optCon, RPMCONFIGDIR, 1); + poptSetExecPath(optCon, rpmConfigDir(), 1); while ((arg = poptGetNextOpt(optCon)) > 0) { optArg = poptGetOptArg(optCon); -- cgit v1.2.3