4 #include <rpm/rpmcli.h>
8 #if !defined(__GLIBC__) && !defined(__APPLE__)
21 {
"initdb",
'\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode,
MODE_INITDB,
22 N_(
"initialize database"), NULL},
23 {
"rebuilddb",
'\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode,
MODE_REBUILDDB,
24 N_(
"rebuild database inverted lists from installed package headers"),
26 {
"verifydb",
'\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR|POPT_ARGFLAG_DOC_HIDDEN),
32 { NULL,
'\0', POPT_ARG_INCLUDE_TABLE,
dbOptsTable, 0,
33 N_(
"Database options:"), NULL },
35 N_(
"Common options for all rpm modes and executables:"), NULL },
42 int main(
int argc,
char *argv[])
44 int ec = EXIT_FAILURE;
45 poptContext optCon =
rpmcliInit(argc, argv, optionsTable);
48 if (argc < 2 || poptPeekArg(optCon)) {
70 argerror(
_(
"only one major mode may be specified"));
static struct poptOption dbOptsTable[]
void printUsage(poptContext con, FILE *fp, int flags)
static struct poptOption optionsTable[]
rpmts rpmtsFree(rpmts ts)
Destroy transaction set, closing the database as well.
int main(int argc, char *argv[])
poptContext rpmcliInit(int argc, char *const argv[], struct poptOption *optionsTable)
Initialize most everything needed by an rpm CLI executable context.
int rpmtsRebuildDB(rpmts ts)
Rebuild the database used by the transaction.
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
rpmts rpmtsCreate(void)
Create an empty transaction set.
poptContext rpmcliFini(poptContext optCon)
Destroy most everything needed by an rpm CLI executable context.
int rpmtsInitDB(rpmts ts, int dbmode)
Initialize the database used by the transaction.
void argerror(const char *desc)
int rpmtsVerifyDB(rpmts ts)
Verify the database used by the transaction.
int rpmExpandNumeric(const char *arg)
Return macro expansion as a numeric value.
const char * rpmcliRootDir
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
Set verify signatures flag(s).
struct poptOption rpmcliAllPoptTable[]
Popt option table for options shared by all modes and executables.
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.