tools/rpmcache.c File Reference

#include "system.h"
#include <fnmatch.h>
#include <fts.h>
#include <rpmcli.h>
#include "rpmps.h"
#include "rpmdb.h"
#include "rpmds.h"
#include "rpmts.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  ftsglob_s
struct  Item_s

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 int archOkay (const char *pkgArch)
static int osOkay (const char *pkgOs)
static int ftsStashLatest (FTSENT *fts, rpmts ts)
static const char * ftsInfoStr (int fts_info)
static int ftsPrint (FTS *ftsp, FTSENT *fts, rpmts ts)
static void initGlobs (rpmts ts, const char **argv)
 Initialize fts and glob structures.
int main (int argc, char *const argv[])

Variables

const char * program_name
static int _debug = 0
static int noCache = 0
static char ** 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 = 0
static struct poptOption optionsTable []


Detailed Description

Definition in file rpmcache.c.


Typedef Documentation

typedef struct Item_s * Item


Function Documentation

static int archOkay ( const char *  pkgArch  )  [static]

Definition at line 165 of file rpmcache.c.

References RPM_MACHTABLE_INSTARCH, and rpmMachineScore().

static int cmpItem ( const void *  a,
const void *  b 
) [static]

Definition at line 67 of file rpmcache.c.

References rpmdsN(), and Item_s::this.

Referenced by ftsStashLatest().

static Item freeItem ( Item  item  )  [inline, static]

Definition at line 52 of file rpmcache.c.

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

Referenced by freeItems(), and ftsStashLatest().

static void freeItems ( void   )  [static]

Definition at line 74 of file rpmcache.c.

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

Referenced by main().

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

Definition at line 82 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 308 of file rpmcache.c.

References ftsInfoStrings.

static int ftsPrint ( FTS ftsp,
FTSENT fts,
rpmts  ts 
) [static]

static int ftsStashLatest ( FTSENT fts,
rpmts  ts 
) [static]

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

Initialize fts and glob structures.

Parameters:
ts transaction set
argv package names to match

Definition at line 441 of file rpmcache.c.

References _free(), bhpath, bhpathlen, ftsglob_s::fnflags, ftsSet, Glob_pattern_p(), nbhglobs, ftsglob_s::patterns, rpmExpand(), RPMMESS_DEBUG, rpmMessage, stpcpy(), and xcalloc().

Referenced by main().

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

static Item newItem ( void   )  [inline, static]

Definition at line 62 of file rpmcache.c.

References xcalloc().

Referenced by ftsStashLatest().

static int osOkay ( const char *  pkgOs  )  [static]

Definition at line 174 of file rpmcache.c.

References RPM_MACHTABLE_INSTOS, and rpmMachineScore().


Variable Documentation

int _debug = 0 [static]

Definition at line 20 of file rpmcache.c.

struct ftsglob_s* bhglobs [static]

Definition at line 36 of file rpmcache.c.

int bhlvl = -1

Definition at line 29 of file rpmcache.c.

Referenced by ftsPrint().

const char* bhpath

Definition at line 27 of file rpmcache.c.

Referenced by ftsPrint(), and initGlobs().

int bhpathlen = 0

Definition at line 28 of file rpmcache.c.

Referenced by ftsPrint(), 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 290 of file rpmcache.c.

char** ftsSet [static]

Definition at line 25 of file rpmcache.c.

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

int indent = 2 [static]

Definition at line 39 of file rpmcache.c.

Item* items = NULL [static]

Definition at line 49 of file rpmcache.c.

Referenced by rpmsxParse().

int nbhglobs = 5 [static]

Definition at line 37 of file rpmcache.c.

Referenced by ftsPrint(), and initGlobs().

int nitems = 0 [static]

Definition at line 50 of file rpmcache.c.

Referenced by freeItems(), fts_build(), Fts_open(), ftsCachePrint(), ftsCacheUpdate(), and ftsStashLatest().

int noCache = 0 [static]

Definition at line 23 of file rpmcache.c.

Referenced by main().

struct poptOption optionsTable[] [static]

Initial value:

 {
 { "nolegacy", '\0', POPT_BIT_SET,      &vsflags, RPMVSF_NEEDPAYLOAD,
         "don't verify header+payload signature" , NULL },

 { "nocache", '\0', POPT_ARG_VAL,   &noCache, -1,
         "don't update cache database, only print package paths" , NULL },

 { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliFtsPoptTable, 0,
         "File tree walk 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
}

Definition at line 513 of file rpmcache.c.

const char* program_name

Definition at line 6 of file rpmcache.c.

rpmVSFlags vsflags = 0 [static]


Generated on Fri Dec 12 13:02:12 2008 for rpm by  doxygen 1.5.6