summaryrefslogtreecommitdiff
path: root/rpmqv.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-22 18:08:40 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-22 18:08:40 +0200
commit43b08986a8aa0464566716f6fe0d510e96cd77bf (patch)
treea8252ad0d7d188057f6fc3491a83ee947a6907ae /rpmqv.c
parentda83a562e1fd81402a39b7c3edfdc413fa860d8c (diff)
downloadlibrpm-tizen-43b08986a8aa0464566716f6fe0d510e96cd77bf.tar.gz
librpm-tizen-43b08986a8aa0464566716f6fe0d510e96cd77bf.tar.bz2
librpm-tizen-43b08986a8aa0464566716f6fe0d510e96cd77bf.zip
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?
Diffstat (limited to 'rpmqv.c')
-rw-r--r--rpmqv.c9
1 files changed, 7 insertions, 2 deletions
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 <rpm/rpmlib.h> /* RPMSIGTAG, rpmReadPackageFile .. */
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>
+#include <rpm/rpmfileutil.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmps.h>
@@ -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);