diff options
Diffstat (limited to 'rpmqv.c')
-rw-r--r-- | rpmqv.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1,5 +1,4 @@ #include "system.h" -const char *__progname; #include <rpm/rpmcli.h> #include <rpm/rpmlib.h> /* RPMSIGTAG, rpmReadPackageFile .. */ @@ -88,12 +87,14 @@ int main(int argc, char *argv[]) int i; #endif + xsetprogname(argv[0]); /* Portability call -- see system.h */ + optCon = rpmcliInit(argc, argv, optionsTable); /* Set the major mode based on argv[0] */ #ifdef IAM_RPMQV - if (rstreq(__progname, "rpmquery")) bigMode = MODE_QUERY; - if (rstreq(__progname, "rpmverify")) bigMode = MODE_VERIFY; + if (rstreq(xgetprogname(), "rpmquery")) bigMode = MODE_QUERY; + if (rstreq(xgetprogname(), "rpmverify")) bigMode = MODE_VERIFY; #endif #if defined(IAM_RPMQV) @@ -135,7 +136,8 @@ int main(int argc, char *argv[]) #ifdef IAM_RPMEIU if (bigMode == MODE_UNKNOWN || (bigMode & MODES_IE)) { int iflags = (ia->installInterfaceFlags & - (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL)); + (INSTALL_UPGRADE|INSTALL_FRESHEN| + INSTALL_INSTALL|INSTALL_REINSTALL)); int eflags = (ia->installInterfaceFlags & INSTALL_ERASE); if (iflags & eflags) @@ -310,6 +312,8 @@ int main(int argc, char *argv[]) verifyFlags &= ~qva->qva_flags; qva->qva_flags = (rpmQueryFlags) verifyFlags; + rpmtsSetFlags(ts, rpmtsFlags(ts) | (ia->transFlags & RPMTRANS_FLAG_NOPLUGINS)); + if (!poptPeekArg(optCon) && !(qva->qva_source == RPMQV_ALL)) argerror(_("no arguments given for verify")); ec = rpmcliVerify(ts, qva, (ARGV_const_t) poptGetArgs(optCon)); @@ -325,7 +329,7 @@ int main(int argc, char *argv[]) case MODE_ERASE: #endif case MODE_UNKNOWN: - if (poptPeekArg(optCon) != NULL || argc <= 1 || rpmIsVerbose()) { + if (poptPeekArg(optCon) != NULL || argc <= 1) { printUsage(optCon, stderr, 0); ec = argc; } @@ -350,5 +354,7 @@ int main(int argc, char *argv[]) rpmcliFini(optCon); + rpmlog(RPMLOG_DEBUG, "Exit status: %d\n", ec); + return RETVAL(ec); } |