rpm  5.4.10
Data Structures | Macros | Typedefs | Functions | Variables
rpmcache.c File Reference
#include "system.h"
#include <fnmatch.h>
#include <fts.h>
#include <rpmio.h>
#include <rpmiotypes.h>
#include <poptIO.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <rpmdb.h>
#include "rpmps.h"
#include "misc.h"
#include <rpmgi.h>
#include <rpmcli.h>
#include "debug.h"
Include dependency graph for rpmcache.c:

Go to the source code of this file.

Data Structures

struct  ftsglob_s
struct  Item_s

Macros

#define _RPMGI_INTERNAL
#define QVA_ISSET(_qvaflags, _FLAG)   ((_qvaflags) & (VERIFY_##_FLAG))
#define VSF_ISSET(_vsflags, _FLAG)   ((_vsflags) & (RPMVSF_##_FLAG))
#define VSF_SET(_vsflags, _FLAG)   (_vsflags) |= (RPMVSF_##_FLAG)
#define VSF_CLR(_vsflags, _FLAG)   (_vsflags) &= ~(RPMVSF_##_FLAG)

Typedefs

typedef struct Item_sItem

Functions

static Item freeItem (Item item)
static Item newItem (void)
static int cmpItem (const void *a, const void *b)
static void freeItems (void)
static int ftsCachePrint (rpmts ts, FILE *fp)
static int ftsCacheUpdate (rpmts ts)
static rpmRC cacheStashLatest (rpmgi gi, Header h)
static const char * ftsInfoStr (int fts_info)
static rpmRC cacheWalkPathFilter (rpmgi gi)
static void initGlobs (rpmts ts, const char **argv)
 Initialize fts and glob structures.
static void freeGlobs (void)
int main (int argc, char *argv[])

Variables

const char * __progname
static int _debug = 0
static int noCache = -1
static ARGV_t ftsSet
const char * bhpath
int bhpathlen = 0
int bhlvl = -1
static struct ftsglob_sbhglobs
static int nbhglobs = 5
static int indent = 2
static Itemitems = NULL
static int nitems = 0
static const char * ftsInfoStrings []
static rpmVSFlags vsflags = (rpmVSFlags) 0
static struct poptOption optionsTable []

Detailed Description

Definition in file rpmcache.c.

Macro Definition Documentation

#define _RPMGI_INTERNAL

Definition at line 23 of file rpmcache.c.

#define QVA_ISSET (   _qvaflags,
  _FLAG 
)    ((_qvaflags) & (VERIFY_##_FLAG))

Definition at line 43 of file rpmcache.c.

Referenced by main().

#define VSF_CLR (   _vsflags,
  _FLAG 
)    (_vsflags) &= ~(RPMVSF_##_FLAG)

Definition at line 47 of file rpmcache.c.

Referenced by main().

#define VSF_ISSET (   _vsflags,
  _FLAG 
)    ((_vsflags) & (RPMVSF_##_FLAG))

Definition at line 45 of file rpmcache.c.

#define VSF_SET (   _vsflags,
  _FLAG 
)    (_vsflags) |= (RPMVSF_##_FLAG)

Definition at line 46 of file rpmcache.c.

Referenced by main().

Typedef Documentation

typedef struct Item_s * Item

Function Documentation

static rpmRC cacheStashLatest ( rpmgi  gi,
Header  h 
)
static
static rpmRC cacheWalkPathFilter ( rpmgi  gi)
static
static int cmpItem ( const void *  a,
const void *  b 
)
static

Definition at line 100 of file rpmcache.c.

References rpmdsN(), and Item_s::this.

Referenced by cacheStashLatest().

static void freeGlobs ( void  )
static

Definition at line 535 of file rpmcache.c.

References _free(), ftsSet, nbhglobs, ftsglob_s::patterns, and patterns.

Referenced by main().

static Item freeItem ( Item  item)
inlinestatic

Definition at line 83 of file rpmcache.c.

References _free(), Item_s::h, headerFree(), Item_s::path, rpmdsFree(), and Item_s::this.

Referenced by cacheStashLatest(), and freeItems().

static void freeItems ( void  )
static

Definition at line 107 of file rpmcache.c.

References _free(), freeItem(), and nitems.

Referenced by main().

static int ftsCachePrint ( rpmts  ts,
FILE *  fp 
)
static

Definition at line 115 of file rpmcache.c.

References nitems, and Item_s::path.

Referenced by main().

static int ftsCacheUpdate ( rpmts  ts)
static
static const char* ftsInfoStr ( int  fts_info)
static

Definition at line 332 of file rpmcache.c.

References ftsInfoStrings.

Referenced by cacheWalkPathFilter().

static void initGlobs ( rpmts  ts,
const char **  argv 
)
static

Initialize fts and glob structures.

Parameters
tstransaction set
argvpackage names to match

Definition at line 465 of file rpmcache.c.

References _free(), bhpath, bhpathlen, ftsglob_s::fnflags, FNM_EXTMATCH, FNM_PATHNAME, FNM_PERIOD, ftsSet, Glob_pattern_p(), nbhglobs, ftsglob_s::patterns, patterns, rpmExpand(), rpmlog(), RPMLOG_DEBUG, stpcpy(), and xcalloc().

Referenced by main().

int main ( int  argc,
char *  argv[] 
)
static Item newItem ( void  )
inlinestatic

Definition at line 95 of file rpmcache.c.

References xcalloc().

Referenced by cacheStashLatest().

Variable Documentation

const char* __progname

Definition at line 6 of file rpmcache.c.

int _debug = 0
static

Definition at line 51 of file rpmcache.c.

Referenced by cacheWalkPathFilter().

struct ftsglob_s* bhglobs
static

Definition at line 67 of file rpmcache.c.

Referenced by cacheWalkPathFilter().

int bhlvl = -1

Definition at line 60 of file rpmcache.c.

Referenced by cacheWalkPathFilter().

const char* bhpath

Definition at line 58 of file rpmcache.c.

Referenced by cacheWalkPathFilter(), and initGlobs().

int bhpathlen = 0

Definition at line 59 of file rpmcache.c.

Referenced by cacheWalkPathFilter(), and initGlobs().

const char* ftsInfoStrings[]
static
Initial value:
{
"UNKNOWN",
"D",
"DC",
"DEFAULT",
"DNR",
"DOT",
"DP",
"ERR",
"F",
"INIT",
"NS",
"NSOK",
"SL",
"SLNONE",
"W",
}

Definition at line 314 of file rpmcache.c.

Referenced by ftsInfoStr().

ARGV_t ftsSet
static

Definition at line 56 of file rpmcache.c.

Referenced by freeGlobs(), initGlobs(), main(), and recurseDir().

int indent = 2
static

Definition at line 70 of file rpmcache.c.

Referenced by cacheStashLatest(), and cacheWalkPathFilter().

Item* items = NULL
static

Definition at line 80 of file rpmcache.c.

Referenced by cacheStashLatest().

int nbhglobs = 5
static

Definition at line 68 of file rpmcache.c.

Referenced by cacheWalkPathFilter(), freeGlobs(), and initGlobs().

int nitems = 0
static
int noCache = -1
static

Definition at line 54 of file rpmcache.c.

Referenced by main().

struct poptOption optionsTable[]
static
Initial value:
{
{ "nolegacy", '\0', POPT_BIT_SET, &vsflags, RPMVSF_NEEDPAYLOAD,
N_("don't verify header+payload signature"), NULL },
{ "cache", '\0', POPT_ARG_VAL, &noCache, 0,
N_("update cache database"), NULL },
{ "nocache", '\0', POPT_ARG_VAL, &noCache, -1,
N_("don't update cache database, only print package paths"), NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0,
N_("File tree walk options:"),
NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
N_("Common options for all rpm modes and executables:"),
NULL },
POPT_AUTOALIAS
POPT_AUTOHELP
POPT_TABLEEND
}

Definition at line 549 of file rpmcache.c.

Referenced by main().

rpmVSFlags vsflags = (rpmVSFlags) 0
static