RPMTRANS_FLAG_NOPOSTUN,
N_("do not execute %%postun scriptlet (if any)"), NULL },
+ { "nodigest", '\0', POPT_BIT_SET, &rpmIArgs.qva_flags, VERIFY_DIGEST,
+ N_("don't verify digest(s)"), NULL },
+ { "nosignature", '\0', POPT_BIT_SET, &rpmIArgs.qva_flags, VERIFY_SIGNATURE,
+ N_("don't verify signature(s)"), NULL },
+
{ "notriggers", '\0', POPT_BIT_SET, &rpmIArgs.transFlags,
_noTransTriggers,
N_("do not execute any scriptlet(s) triggered by this package"), NULL},
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
-/** \ingroup rpmcli
- * Install/upgrade/freshen binary rpm package.
- * @param ts transaction set
- * @param fileArgv array of package file names (NULL terminated)
- * @param transFlags bits to control rpmRunTransactions()
- * @param interfaceFlags bits to control rpmInstall()
- * @param probFilter bits to filter problem types
- * @param relocations package file relocations
- * @return 0 on success
- */
-int rpmInstall(rpmTransactionSet ts,
- /*@null@*/ const char ** fileArgv,
- rpmtransFlags transFlags,
- rpmInstallInterfaceFlags interfaceFlags,
- rpmprobFilterFlags probFilter,
- /*@null@*/ rpmRelocation * relocations)
- /*@globals packagesTotal, rpmGlobalMacroContext,
- fileSystem, internalState@*/
- /*@modifies ts, *relocations, packagesTotal, rpmGlobalMacroContext,
- fileSystem, internalState @*/;
-
/** \ingroup rpmcli
* Install source rpm package.
* @param ts transaction set
/*@modifies ts, *specFile, *cookie, rpmGlobalMacroContext,
fileSystem, internalState @*/;
-/** \ingroup rpmcli
- * Erase binary rpm package.
- * @param ts transaction set
- * @param argv array of package file names (NULL terminated)
- * @param transFlags bits to control rpmRunTransactions()
- * @param interfaceFlags bits to control rpmInstall()
- * @return 0 on success
- */
-int rpmErase(rpmTransactionSet ts, /*@null@*/ const char ** argv,
- rpmtransFlags transFlags,
- rpmEraseInterfaceFlags interfaceFlags)
- /*@globals rpmGlobalMacroContext,
- fileSystem, internalState @*/
- /*@modifies ts, rpmGlobalMacroContext,
- fileSystem, internalState @*/;
-
/** \ingroup rpmcli
* Describe database command line requests.
*/
rpmprobFilterFlags probFilter;
rpmInstallInterfaceFlags installInterfaceFlags;
rpmEraseInterfaceFlags eraseInterfaceFlags;
-/*@only@*/ /*@null@*/
+/*@owned@*/ /*@null@*/
rpmRelocation * relocations;
int numRelocations;
int noDeps;
int incldocs;
+ rpmQueryFlags qva_flags; /*!< from --nodigest/--nosignature */
/*@null@*/
const char * prefix;
/*@observer@*/ /*@null@*/
uint_32 rbtid; /*!< from --rollback */
};
+/** \ingroup rpmcli
+ * Install/upgrade/freshen binary rpm package.
+ * @param ts transaction set
+ * @param ia mode flags and parameters
+ * @param fileArgv array of package file names (NULL terminated)
+ * @return 0 on success
+ */
+int rpmInstall(rpmTransactionSet ts, struct rpmInstallArguments_s * ia,
+ /*@null@*/ const char ** fileArgv)
+ /*@globals packagesTotal, rpmGlobalMacroContext,
+ fileSystem, internalState@*/
+ /*@modifies ts, ia, packagesTotal, rpmGlobalMacroContext,
+ fileSystem, internalState @*/;
+
+/** \ingroup rpmcli
+ * Erase binary rpm package.
+ * @param ts transaction set
+ * @param argv array of package file names (NULL terminated)
+ * @param transFlags bits to control rpmRunTransactions()
+ * @param interfaceFlags bits to control rpmInstall()
+ * @return 0 on success
+ */
+int rpmErase(rpmTransactionSet ts, const struct rpmInstallArguments_s * ia,
+ /*@null@*/ const char ** argv)
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
+
/**
* A rollback transaction id element.
*/
*/
int rpmRollback(rpmTransactionSet ts, struct rpmInstallArguments_s * ia,
/*@null@*/ const char ** argv)
- /*@globals rpmGlobalMacroContext,
- fileSystem, internalState @*/
- /*@modifies ts, rpmGlobalMacroContext,
- fileSystem, internalState @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmcli
*/
fprintf(stderr, "*** ds %p\t%s[%d]\n", ds, ds->Type, ds->Count);
/*@=modfilesystem@*/
-
if (ds->tagN == RPMTAG_PROVIDENAME) {
tagEVR = RPMTAG_PROVIDEVERSION;
tagF = RPMTAG_PROVIDEFLAGS;
FD_t fd;
int numFailed;
int numPkgs;
-/*@only@*/ str_t * pkgURL;
-/*@dependent@*/ /*@null@*/ str_t * fnp;
-/*@only@*/ char * pkgState;
+/*@only@*/
+ str_t * pkgURL;
+/*@dependent@*/ /*@null@*/
+ str_t * fnp;
+/*@only@*/
+ char * pkgState;
int prevx;
int pkgx;
int numRPMS;
int numSRPMS;
-/*@only@*/ /*@null@*/ str_t * sourceURL;
+/*@only@*/ /*@null@*/
+ str_t * sourceURL;
int isSource;
int argc;
-/*@only@*/ /*@null@*/ str_t * argv;
-/*@temp@*/ rpmRelocation * relocations;
+/*@only@*/ /*@null@*/
+ str_t * argv;
+/*@dependent@*/
+ rpmRelocation * relocations;
rpmRC rpmrc;
};
/** @todo Generalize --freshen policies. */
-int rpmInstall(rpmTransactionSet ts, const char ** fileArgv,
- rpmtransFlags transFlags,
- rpmInstallInterfaceFlags interfaceFlags,
- rpmprobFilterFlags probFilter,
- rpmRelocation * relocations)
+int rpmInstall(rpmTransactionSet ts,
+ struct rpmInstallArguments_s * ia,
+ const char ** fileArgv)
{
struct rpmEIU * eiu = memset(alloca(sizeof(*eiu)), 0, sizeof(*eiu));
- int notifyFlags = interfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 );
+ rpmInstallInterfaceFlags interfaceFlags;
+ rpmprobFilterFlags probFilter;
+ rpmRelocation * relocations;
+ int notifyFlags;
/*@only@*/ /*@null@*/ const char * fileURL = NULL;
int stopInstall = 0;
const char ** av = NULL;
if (fileArgv == NULL) goto exit;
/*@-branchstate@*/
- ts->transFlags = transFlags;
- ts->dbmode = (transFlags & RPMTRANS_FLAG_TEST)
+ ts->transFlags = ia->transFlags;
+ interfaceFlags = ia->installInterfaceFlags;
+ probFilter = ia->probFilter;
+ relocations = ia->relocations;
+
+ ts->nodigests = (ia->qva_flags & VERIFY_DIGEST);
+ ts->nosignatures = (ia->qva_flags & VERIFY_SIGNATURE);
+
+ ts->dbmode = (ts->transFlags & RPMTRANS_FLAG_TEST)
? O_RDONLY : (O_RDWR|O_CREAT);
ts->notify = rpmShowProgress;
+ notifyFlags = interfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 );
ts->notifyData = (void *) ((long)notifyFlags);
if ((eiu->relocations = relocations) != NULL) {
/*@-nullstate@*/ /* FIX: ts->rootDir may be NULL? */
rc = rpmRunTransactions(ts, ts->notify, ts->notifyData,
- NULL, &probs, transFlags, probFilter);
+ NULL, &probs, ts->transFlags, probFilter);
/*@=nullstate@*/
if (rc < 0) {
continue;
}
- if (!(transFlags & RPMTRANS_FLAG_TEST)) {
+ if (!(ts->transFlags & RPMTRANS_FLAG_TEST)) {
#if !defined(__LCLINT__) /* LCL: segfault */
eiu->rpmrc = rpmInstallSourcePackage(ts, eiu->fd, NULL,
ts->notify, ts->notifyData, NULL);
return eiu->numFailed;
}
-int rpmErase(rpmTransactionSet ts, const char ** argv,
- rpmtransFlags transFlags,
- rpmEraseInterfaceFlags interfaceFlags)
+int rpmErase(rpmTransactionSet ts,
+ const struct rpmInstallArguments_s * ia,
+ const char ** argv)
{
-
int count;
const char ** arg;
int numFailed = 0;
int stopUninstall = 0;
int numPackages = 0;
rpmProblemSet probs;
+ rpmEraseInterfaceFlags interfaceFlags;
if (argv == NULL) return 0;
- ts->transFlags = transFlags;
+ ts->transFlags = ia->transFlags;
+ interfaceFlags = ia->eraseInterfaceFlags;
+
+ ts->nodigests = (ia->qva_flags & VERIFY_DIGEST);
+ ts->nosignatures = (ia->qva_flags & VERIFY_SIGNATURE);
+
/* XXX W2DO? O_EXCL??? */
- ts->dbmode = (transFlags & RPMTRANS_FLAG_TEST)
+ ts->dbmode = (ts->transFlags & RPMTRANS_FLAG_TEST)
? O_RDONLY : (O_RDWR|O_EXCL);
(void) rpmtsOpenDB(ts, ts->dbmode);
}
if (!stopUninstall) {
- transFlags |= RPMTRANS_FLAG_REVERSE;
+ ts->transFlags |= RPMTRANS_FLAG_REVERSE;
numFailed += rpmRunTransactions(ts, NULL, NULL, NULL, &probs,
- transFlags, 0);
+ ts->transFlags, 0);
}
return numFailed;
xx = close(fdno);
return 1;
}
- (void) madvise(mapped, st->st_size, MADV_SEQUENTIAL);
+
+ xx = madvise(mapped, st->st_size, MADV_SEQUENTIAL);
ctx = rpmDigestInit(PGPHASHALGO_MD5, RPMDIGEST_NONE);
xx = rpmDigestUpdate(ctx, mapped, st->st_size);
ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
ec += rpmRollback(ts, ia, NULL);
} else {
- ec += rpmErase(ts, (const char **)poptGetArgs(optCon),
- ia->transFlags, ia->eraseInterfaceFlags);
+ ec += rpmErase(ts, ia, (const char **) poptGetArgs(optCon));
}
break;
ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
/*@i@*/ ec += rpmRollback(ts, ia, NULL);
} else {
- /*@-compdef@*/ /* FIX: ia->relocations[0].newPath undefined */
- ec += rpmInstall(ts, (const char **)poptGetArgs(optCon),
- ia->transFlags, ia->installInterfaceFlags,
- ia->probFilter, ia->relocations);
+ /*@-compmempass@*/ /* FIX: ia->relocations[0].newPath undefined */
+ ec += rpmInstall(ts, ia, (const char **)poptGetArgs(optCon));
+ /*@=compmempass@*/
}
- /*@=compdef@*/
break;
#endif /* IAM_RPMEIU */