summaryrefslogtreecommitdiff
path: root/rpmqv.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-08-20 15:17:08 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-08-20 15:23:48 +0300
commitfbd92df7544462a88cd8c752ffe07263dc8bb858 (patch)
treee6e2f009714b930ca8cd7371a9aa62fbc9334834 /rpmqv.c
parente951c42146d89a5f4abdb02eaf9e44eead235e2f (diff)
downloadlibrpm-tizen-fbd92df7544462a88cd8c752ffe07263dc8bb858.tar.gz
librpm-tizen-fbd92df7544462a88cd8c752ffe07263dc8bb858.tar.bz2
librpm-tizen-fbd92df7544462a88cd8c752ffe07263dc8bb858.zip
Argh. Realize we already have equivalents of initCli() and finishCli()
- rpmcliInit() and rpmcliFini() do almost exactly the same as our newborn cli-helpers, but they've been almost unused until now. Use them and lose the new ones.. doh. - The downside is that popt aliases are now broken when running commands from the build tree due to lt-foo in argv[0], whereas initCli() took and explicit popt context name argument. Oh well... - rpmcliFini() was missing several necessary memory cleanup calls, add them there while at it.
Diffstat (limited to 'rpmqv.c')
-rw-r--r--rpmqv.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/rpmqv.c b/rpmqv.c
index e9e23ee3e..8d4bdf0f0 100644
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -123,15 +123,7 @@ int main(int argc, char *argv[])
int i;
#endif
- setprogname(argv[0]); /* Retrofit glibc __progname */
-
- /* XXX glibc churn sanity */
- if (__progname == NULL) {
- if ((__progname = strrchr(argv[0], '/')) != NULL) __progname++;
- else __progname = argv[0];
- }
-
- optCon = initCli("rpm", optionsTable, argc, argv);
+ optCon = rpmcliInit(argc, argv, optionsTable);
/* Set the major mode based on argv[0] */
#ifdef IAM_RPMQV
@@ -547,5 +539,7 @@ exit:
ia->relocations = _free(ia->relocations);
#endif
- return finishCli(optCon, ec);
+ rpmcliFini(optCon);
+
+ return RETVAL(ec);
}