rpm  5.4.15
Macros | Functions | Variables
rpmgit.c File Reference
#include "system.h"
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmlog.h>
#include <rpmmacro.h>
#include <rpmurl.h>
#include <ugid.h>
#include <poptIO.h>
#include <rpmgit.h>
#include "debug.h"
Include dependency graph for rpmgit.c:

Go to the source code of this file.

Macros

#define _RPMGIT_INTERNAL
 
#define SPEW(_t, _rc, _git)
 
#define ARGMINMAX(_min, _max)   (int)(((_min) << 8) | ((_max) & 0xff))
 

Functions

int rpmgitInit (rpmgit git, void *initopts)
 
int rpmgitAddFile (rpmgit git, const char *fn)
 
int rpmgitCommit (rpmgit git, const char *msg)
 
int rpmgitConfig (rpmgit git)
 
const char * rpmgitOid (rpmgit git, const void *_oid)
 
int rpmgitClose (rpmgit git)
 
int rpmgitOpen (rpmgit git, const char *repodir)
 
int rpmgitTree (rpmgit git)
 
int rpmgitWalk (rpmgit git)
 
int rpmgitInfo (rpmgit git)
 
int rpmgitRead (rpmgit git)
 
int rpmgitWrite (rpmgit git)
 
static int rpmgitPopt (rpmgit git, int argc, char *argv[], poptOption opts)
 
rpmRC rpmgitCmdInit (int argc, char *argv[])
 
rpmRC rpmgitCmdAdd (int argc, char *argv[])
 
rpmRC rpmgitCmdCommit (int argc, char *argv[])
 
rpmRC rpmgitCmdDiff (int argc, char *argv[])
 
rpmRC rpmgitCmdStatus (int argc, char *argv[])
 
static void rpmgitFini (void *_git)
 
static rpmgit rpmgitGetPool (rpmioPool pool)
 
static rpmgit rpmgitI (void)
 
rpmgit rpmgitNew (char **av, uint32_t flags, void *_opts)
 Create and load a git wrapper. More...
 
rpmRC rpmgitRun (rpmgit git, const char *str, const char **resultp)
 Execute git string. More...
 

Variables

int _rpmgit_debug
 
const char * _rpmgit_dir
 
const char * _rpmgit_tree
 
static int _rpmgit_threads
 
static struct poptOption rpmgitCmds []
 
static const char * exec_path
 
static const char * html_path
 
static const char * man_path
 
static const char * info_path
 
static int paginate
 
static int no_replace_objects
 
static int bare
 
static struct poptOption rpmgitOpts []
 
rpmioPool _rpmgitPool
 
rpmgit _rpmgitI
 

Macro Definition Documentation

#define _RPMGIT_INTERNAL

Definition at line 15 of file rpmgit.c.

#define ARGMINMAX (   _min,
  _max 
)    (int)(((_min) << 8) | ((_max) & 0xff))

Definition at line 2362 of file rpmgit.c.

#define SPEW (   _t,
  _rc,
  _git 
)
Value:
{ if ((_t) || _rpmgit_debug ) \
fprintf(stderr, "<-- %s(%p) rc %d\n", __FUNCTION__, (_git), \
(_rc)); \
}
int _rpmgit_debug
Definition: rpmgit.c:21

Definition at line 30 of file rpmgit.c.

Referenced by rpmgitAddFile(), rpmgitClose(), rpmgitCmdAdd(), rpmgitCmdCommit(), rpmgitCmdDiff(), rpmgitCmdInit(), rpmgitCmdStatus(), rpmgitCommit(), rpmgitConfig(), rpmgitInfo(), rpmgitInit(), rpmgitOpen(), rpmgitRead(), rpmgitTree(), rpmgitWalk(), and rpmgitWrite().

Function Documentation

int rpmgitAddFile ( rpmgit  git,
const char *  fn 
)

Definition at line 505 of file rpmgit.c.

References ns, and SPEW.

Referenced by rpmgitCmdInit().

int rpmgitClose ( rpmgit  git)

Definition at line 688 of file rpmgit.c.

References _free(), and SPEW.

rpmRC rpmgitCmdAdd ( int  argc,
char *  argv[] 
)

Definition at line 1300 of file rpmgit.c.

References _rpmgit_debug, N_, rpmgitFree(), rpmgitNew(), rpmgitPrintIndex(), RPMRC_FAIL, RPMRC_OK, and SPEW.

rpmRC rpmgitCmdCommit ( int  argc,
char *  argv[] 
)
rpmRC rpmgitCmdDiff ( int  argc,
char *  argv[] 
)

Definition at line 1653 of file rpmgit.c.

References b, i, N_, opts, rpmgitFree(), rpmgitNew(), RPMRC_FAIL, RPMRC_OK, and SPEW.

rpmRC rpmgitCmdInit ( int  argc,
char *  argv[] 
)
rpmRC rpmgitCmdStatus ( int  argc,
char *  argv[] 
)

Definition at line 2214 of file rpmgit.c.

References _free(), N_, rpmgitFree(), rpmgitNew(), RPMRC_FAIL, RPMRC_OK, SPEW, xstrdup(), and ZERO.

int rpmgitCommit ( rpmgit  git,
const char *  msg 
)

Definition at line 535 of file rpmgit.c.

References _rpmgit_debug, rpmgitPrintOid(), rpmgitPrintTree(), and SPEW.

Referenced by rpmgitCmdCommit(), and rpmgitCmdInit().

int rpmgitConfig ( rpmgit  git)

Definition at line 653 of file rpmgit.c.

References SPEW.

Referenced by rpmgitCmdInit().

static void rpmgitFini ( void *  _git)
static

Definition at line 2640 of file rpmgit.c.

References _free(), _rpmgit_threads, and argvFree().

Referenced by rpmgitGetPool().

static rpmgit rpmgitGetPool ( rpmioPool  pool)
static

Definition at line 2719 of file rpmgit.c.

References _rpmgit_debug, _rpmgitPool, rpmgitFini(), rpmioGetPool(), and rpmioNewPool().

Referenced by rpmgitNew().

static rpmgit rpmgitI ( void  )
static

Definition at line 2741 of file rpmgit.c.

References _rpmgitI, and rpmgitNew().

Referenced by rpmgitNew(), and rpmgitRun().

int rpmgitInfo ( rpmgit  git)

Definition at line 789 of file rpmgit.c.

References alloca(), gidToGname(), i, oid, SPEW, and uidToUname().

int rpmgitInit ( rpmgit  git,
void *  initopts 
)

Definition at line 473 of file rpmgit.c.

References _rpmgit_debug, opts, rpmgitPrintRepo(), and SPEW.

Referenced by rpmgitCmdInit().

rpmgit rpmgitNew ( char **  argv,
uint32_t  flags,
void *  _opts 
)

Create and load a git wrapper.

Parameters
argvgit args
flagsgit flags
_optspoptOption table
Returns
new git wrapper

Definition at line 2750 of file rpmgit.c.

References _free(), _rpmgit_debug, _rpmgit_dir, _rpmgit_threads, arg, argvCount(), argvFree(), argvSplit(), flags, i, opts, rpmExpand(), rpmgitGetPool(), rpmgitI(), rpmgitLink(), rpmgitOpen(), rpmgitOpts, rpmgitPopt(), rpmgitRun(), Stat(), and xstrdup().

Referenced by expandMacro(), rpmgitCmdAdd(), rpmgitCmdCommit(), rpmgitCmdDiff(), rpmgitCmdInit(), rpmgitCmdStatus(), and rpmgitI().

const char* rpmgitOid ( rpmgit  git,
const void *  _oid 
)

Definition at line 675 of file rpmgit.c.

References oid.

int rpmgitOpen ( rpmgit  git,
const char *  repodir 
)

Definition at line 705 of file rpmgit.c.

References _free(), Realpath(), and SPEW.

Referenced by rpmgitNew().

static int rpmgitPopt ( rpmgit  git,
int  argc,
char *  argv[],
poptOption  opts 
)
static

Definition at line 900 of file rpmgit.c.

References _free(), _rpmgit_debug, arg, argvAppend(), argvCount(), argvFree(), argvPrint(), and rpmgitPrintRepo().

Referenced by rpmgitNew().

int rpmgitRead ( rpmgit  git)

Definition at line 850 of file rpmgit.c.

References data, obj, oid, and SPEW.

rpmRC rpmgitRun ( rpmgit  git,
const char *  str,
const char **  resultp 
)

Execute git string.

Parameters
gitgit interpreter (NULL uses global interpreter)
strgit string to execute (NULL returns RPMRC_FAIL)
*resultpgit exec result
Returns
RPMRC_OK on success

Definition at line 2825 of file rpmgit.c.

References _rpmgit_debug, cmd, rpmgitI(), and RPMRC_FAIL.

Referenced by expandMacro(), and rpmgitNew().

int rpmgitTree ( rpmgit  git)

Definition at line 730 of file rpmgit.c.

References SPEW.

int rpmgitWalk ( rpmgit  git)

Definition at line 744 of file rpmgit.c.

References oid, rpmgitPrintOid(), rpmgitPrintTime(), and SPEW.

int rpmgitWrite ( rpmgit  git)

Definition at line 877 of file rpmgit.c.

References alloca(), b, oid, and SPEW.

Variable Documentation

int _rpmgit_debug
const char* _rpmgit_dir

Definition at line 23 of file rpmgit.c.

Referenced by rpmgitNew().

int _rpmgit_threads
static

Definition at line 28 of file rpmgit.c.

Referenced by rpmgitFini(), and rpmgitNew().

const char* _rpmgit_tree

Definition at line 25 of file rpmgit.c.

rpmgit _rpmgitI

Definition at line 2717 of file rpmgit.c.

Referenced by rpmgitI(), and rpmioClean().

rpmioPool _rpmgitPool

Definition at line 2714 of file rpmgit.c.

Referenced by rpmgitGetPool(), and rpmioClean().

int bare
static

Definition at line 2562 of file rpmgit.c.

const char* exec_path
static

Definition at line 2556 of file rpmgit.c.

const char* html_path
static

Definition at line 2557 of file rpmgit.c.

const char* info_path
static

Definition at line 2559 of file rpmgit.c.

const char* man_path
static

Definition at line 2558 of file rpmgit.c.

int no_replace_objects
static

Definition at line 2561 of file rpmgit.c.

int paginate
static

Definition at line 2560 of file rpmgit.c.

struct poptOption rpmgitCmds[]
static

Definition at line 2364 of file rpmgit.c.

struct poptOption rpmgitOpts[]
static

Definition at line 2564 of file rpmgit.c.

Referenced by rpmgitNew().