rpmspec.c File Reference
`#include "system.h"`
`#include <rpm/rpmcli.h>`
`#include <rpm/rpmbuild.h>`
`#include <rpm/rpmlog.h>`
`#include <rpm/rpmts.h>`
`#include "cliutils.h"`
`#include "debug.h"`
Include dependency graph for rpmspec.c:

Go to the source code of this file.

## Enumerations

enum

modes {
MODE_BUILD = (1 << 4), MODE_REBUILD = (1 << 5), MODE_RECOMPILE = (1 << 8), MODE_TARBUILD = (1 << 11),
MODE_INITDB = (1 << 0), MODE_REBUILDDB = (1 << 1), MODE_VERIFYDB = (1 << 2), MODE_EXPORTDB = (1 << 3),
MODE_IMPORTDB = (1 << 4), MODE_CHECKSIG = (1 << 0), MODE_IMPORTKEY = (1 << 1), MODE_DELKEY = (1 << 2),
MODE_LISTKEY = (1 << 3), MODE_QUERY = (1 << 0), MODE_VERIFY = (1 << 3), MODE_INSTALL = (1 << 1),
MODE_ERASE = (1 << 2), MODE_UNKNOWN = 0, MODE_ADDSIGN = (1 << 0), MODE_RESIGN = (1 << 1),
MODE_DELSIGN = (1 << 2), MODE_UNKNOWN = 0, MODE_QUERY = (1 << 0), MODE_PARSE = (1 << 1)
}

## Functions

int | main (int argc, char *argv[])

## Variables

const char * | program_name
static int | mode = MODE_UNKNOWN
static int | source = RPMQV_SPECRPMS
const char * | target = NULL
char * | queryformat = NULL
static struct poptOption | specOptsTable []
static struct poptOption | optionsTable []

## Enumeration Type Documentation

## modes

enum modes

Enumerator
MODE_BUILD |
MODE_REBUILD |
MODE_RECOMPILE |
MODE_TARBUILD |
MODE_INITDB |
MODE_REBUILDDB |
MODE_VERIFYDB |
MODE_EXPORTDB |
MODE_IMPORTDB |
MODE_CHECKSIG |
MODE_IMPORTKEY |
MODE_DELKEY |
MODE_LISTKEY |
MODE_QUERY |
MODE_VERIFY |
MODE_INSTALL |
MODE_ERASE |
MODE_UNKNOWN |
MODE_ADDSIGN |
MODE_RESIGN |
MODE_DELSIGN |
MODE_UNKNOWN |
MODE_QUERY |
MODE_PARSE |

Definition at line 13 of file rpmspec.c.

## Function Documentation

## main()

int main | ( | int | argc,
|  | char * | argv[]
| ) |  |

Definition at line 55 of file rpmspec.c.

References _, argerror(), finishPipe(), initPipe(), mode, MODE_PARSE, MODE_QUERY, MODE_UNKNOWN, optionsTable, printUsage(), queryformat, rpmQVKArguments_s::qva_queryFormat, rpmQVKArguments_s::qva_source, rpmQVKArguments_s::qva_specQuery, RETVAL, RPMBUILD_NONE, rpmcliFini(), rpmcliInit(), rpmcliPipeOutput, rpmcliQuery(), rpmcliRcfile, rpmFreeMacros(), rpmFreeRpmrc(), rpmIsVerbose, rpmQVKArgs, rpmReadConfigFiles(), RPMSPEC_ANYARCH, RPMSPEC_FORCE, rpmSpecFree(), rpmSpecGetSection(), rpmSpecParse(), rpmspecQuery(), rpmtsCreate(), rpmtsFree(), source, and target.

## Variable Documentation

## mode

int mode = MODE_UNKNOWN

static

Definition at line 19 of file rpmspec.c.

Referenced by main().

## optionsTable

struct poptOption optionsTable[]

static

Initial value:
= {
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, specOptsTable, 0,
"Spec options:" , NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
"Common options for all rpm modes and executables:" , NULL },
POPT_AUTOALIAS
POPT_AUTOHELP
POPT_TABLEEND
}
specOptsTable
static struct poptOption specOptsTable[]
Definition: rpmspec.c:24
rpmcliAllPoptTable
struct poptOption rpmcliAllPoptTable[]
Popt option table for options shared by all modes and executables.

Definition at line 43 of file rpmspec.c.

Referenced by main().

## program_name

const char* program_name

Definition at line 2 of file rpmspec.c.

## queryformat

char* queryformat = NULL

Definition at line 22 of file rpmspec.c.

Referenced by main().

## source

int source = RPMQV_SPECRPMS

static

Definition at line 20 of file rpmspec.c.

Referenced by main().

## specOptsTable

struct poptOption specOptsTable[]

static

Initial value:
= {
{ "parse", 'P', POPT_ARG_VAL, &mode, MODE_PARSE,
"parse spec file(s) to stdout" , NULL },
{ "query", 'q', POPT_ARG_VAL, &mode, MODE_QUERY,
"query spec file(s)" , NULL },
{ "rpms", 0, POPT_ARG_VAL, &source, RPMQV_SPECRPMS,
"operate on binary rpms generated by spec (default)" , NULL },
{ "srpm", 0, POPT_ARG_VAL, &source, RPMQV_SPECSRPM,
"operate on source rpm generated by spec" , NULL },
{ "target", 0, POPT_ARG_STRING, &target, 0,
"override target platform" , NULL },
{ "queryformat", 0, POPT_ARG_STRING, &queryformat, 0,
"use the following query format" , "QUERYFORMAT" },
{ "qf", 0, (POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN), &queryformat, 0,
NULL, NULL },
POPT_TABLEEND
}
RPMQV_SPECRPMS
Definition: rpmcli.h:90
source
static int source
Definition: rpmspec.c:20
MODE_QUERY
Definition: rpmspec.c:15
target
const char * target
Definition: rpmspec.c:21
queryformat
char * queryformat
Definition: rpmspec.c:22
mode
static int mode
Definition: rpmspec.c:19
MODE_PARSE
Definition: rpmspec.c:16
RPMQV_SPECSRPM
Definition: rpmcli.h:95

Definition at line 24 of file rpmspec.c.

## target

const char* target = NULL

Definition at line 21 of file rpmspec.c.

Referenced by build(), and main().