rpm  5.4.14
Macros | Typedefs | Functions | Variables
rpmrepo.h File Reference
#include <rpmiotypes.h>
#include <rpmio.h>
#include <argv.h>
#include <mire.h>
#include <popt.h>
Include dependency graph for rpmrepo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define rpmrepoUnlink(_repo)   ((rpmrepo)rpmioUnlinkPoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))
 
#define rpmrepoLink(_repo)   ((rpmrepo)rpmioLinkPoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))
 
#define rpmrepoFree(_repo)   ((rpmrepo)rpmioFreePoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))
 

Typedefs

typedef struct rpmrepo_s * rpmrepo
 
typedef struct rpmrfile_s * rpmrfile
 

Functions

rpmrepo rpmrepoUnlink (rpmrepo repo)
 Unreference a repo wrapper instance. More...
 
rpmrepo rpmrepoLink (rpmrepo repo)
 Reference a repo wrapper instance. More...
 
rpmrepo rpmrepoFree (rpmrepo repo)
 Destroy a repo wrapper. More...
 
rpmrepo rpmrepoNew (char **av, int flags)
 Create and load a repo wrapper. More...
 
void rpmrepoError (int lvl, const char *fmt,...)
 Print an error message and exit (if requested). More...
 
const char * rpmrepoRealpath (const char *lpath)
 Return realpath(3) canonicalized absolute path. More...
 
int rpmrepoTestSetupDirs (rpmrepo repo)
 Test for repository sanity. More...
 
const char ** rpmrepoGetFileList (rpmrepo repo, const char *roots[], const char *ext)
 Walk file/directory trees, looking for files with an extension. More...
 
int rpmrepoCheckTimeStamps (rpmrepo repo)
 Check that repository time stamp is newer than any contained package. More...
 
int rpmrepoDoPkgMetadata (rpmrepo repo)
 Write repository metadata files. More...
 
int rpmrepoDoRepoMetadata (rpmrepo repo)
 Write repository manifest. More...
 
int rpmrepoDoFinalMove (rpmrepo repo)
 Rename temporary repository to final paths. More...
 

Variables

int _rpmrepo_debug
 

Macro Definition Documentation

#define rpmrepoFree (   _repo)    ((rpmrepo)rpmioFreePoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))

Definition at line 209 of file rpmrepo.h.

#define rpmrepoLink (   _repo)    ((rpmrepo)rpmioLinkPoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))

Definition at line 197 of file rpmrepo.h.

#define rpmrepoUnlink (   _repo)    ((rpmrepo)rpmioUnlinkPoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))

Definition at line 186 of file rpmrepo.h.

Typedef Documentation

typedef struct rpmrfile_s* rpmrfile

Definition at line 17 of file rpmrepo.h.

Function Documentation

int rpmrepoCheckTimeStamps ( rpmrepo  repo)

Check that repository time stamp is newer than any contained package.

Parameters
reporepository
Returns
0 on success

Definition at line 681 of file rpmrepo.c.

References _, NULL, rc, rpmioExists(), rpmrepoError(), and st.

Referenced by if().

int rpmrepoDoFinalMove ( rpmrepo  repo)

Rename temporary repository to final paths.

Parameters
reporepository
Returns
0 always

Definition at line 1264 of file rpmrepo.c.

References _, _free(), errno, _ftsent::fts_accpath, Fts_close(), FTS_DP, FTS_F, _ftsent::fts_info, _ftsent::fts_level, _ftsent::fts_name, FTS_NOCHDIR, Fts_open(), _ftsent::fts_path, FTS_PHYSICAL, Fts_read(), FTS_SL, FTS_SLNONE, FTS_XDEV, int, NULL, p, Rename(), Rmdir(), rpmGetPath(), rpmioExists(), rpmrepoError(), st, t, Unlink(), and xx.

int rpmrepoDoPkgMetadata ( rpmrepo  repo)

Write repository metadata files.

Parameters
reporepository
Returns
0 on success

Definition at line 1569 of file rpmrepo.c.

References _free(), argvAdd(), argvCount(), argvFree(), fprintf(), NULL, path, rc, Realpath(), repoWriteMetadataDocs(), rpmGetPath(), rpmrepoCloseMDFile(), rpmrepoGetFileList(), rpmrepoOpenMDFile(), and xstrdup().

int rpmrepoDoRepoMetadata ( rpmrepo  repo)

Write repository manifest.

Parameters
reporepository
Returns
0 on success.

Definition at line 1078 of file rpmrepo.c.

References _, _free(), fn, Fopen(), NULL, rc, Rename(), rpmExpand(), rpmGetPath(), rpmioExists(), rpmrepoError(), rpmrepoFclose(), rpmrepoGetPath(), rpmrepoMDExpand(), rpmrfileXMLWrite(), st, strcmp(), Unlink(), void, and xstrdup().

void rpmrepoError ( int  lvl,
const char *  fmt,
  ... 
)

Print an error message and exit (if requested).

Parameters
lvlerror level (non-zero exits)
fmtmsg format

Definition at line 427 of file rpmrepo.c.

References __progname, exit, EXIT_FAILURE, fprintf(), NULL, and void.

Referenced by if(), repoWriteMetadataDocs(), rfileHeaderSprintf(), rpmrepoCheckTimeStamps(), rpmrepoCloseMDFile(), rpmrepoDoFinalMove(), rpmrepoDoRepoMetadata(), rpmrepoGetFileList(), rpmrepoInitPopt(), rpmrepoMkdir(), rpmrepoOpenMDFile(), rpmrepoTestSetupDirs(), and rpmrfileXMLWrite().

rpmrepo rpmrepoFree ( rpmrepo  repo)

Destroy a repo wrapper.

Parameters
reporepo wrapper
Returns
NULL on last dereference
const char** rpmrepoGetFileList ( rpmrepo  repo,
const char *  roots[],
const char *  ext 
)

Walk file/directory trees, looking for files with an extension.

Parameters
reporepository
rootsfile/directory trees to search
extfile extension to match (usually ".rpm")
Returns
list of files with the extension

Definition at line 622 of file rpmrepo.c.

References _, argvAdd(), argvPrint(), chkSuffix(), errno, Fts_close(), FTS_D, FTS_DP, FTS_F, _ftsent::fts_info, _ftsent::fts_level, _ftsent::fts_name, _ftsent::fts_namelen, Fts_open(), _ftsent::fts_path, Fts_read(), FTS_SL, mireApply(), NULL, p, rpmrepoError(), t, void, and xx.

Referenced by rpmrepoDoPkgMetadata().

rpmrepo rpmrepoLink ( rpmrepo  repo)

Reference a repo wrapper instance.

Parameters
reporepo wrapper
Returns
new repo wrapper reference

Referenced by rpmrepoNew().

rpmrepo rpmrepoNew ( char **  av,
int  flags 
)

Create and load a repo wrapper.

Parameters
avrepo argv
flagsrepo flags
Returns
new repo wrapper

Definition at line 1897 of file rpmrepo.c.

References repo, rpmrepoGetPool(), rpmrepoInitPopt(), rpmrepoLink(), and xx.

const char* rpmrepoRealpath ( const char *  lpath)

Return realpath(3) canonicalized absolute path.

Parameters
lpathfile path
Returns
canonicalized absolute path

Definition at line 515 of file rpmrepo.c.

References fullpath, MAXPATHLEN, NULL, Realpath(), and xstrdup().

Referenced by if(), and rpmrepoInitPopt().

int rpmrepoTestSetupDirs ( rpmrepo  repo)

Test for repository sanity.

Parameters
reporepository
Returns
0 on success

Definition at line 530 of file rpmrepo.c.

References _, _free(), Access(), fn, NULL, rc, rpmGetPath(), rpmioExists(), rpmrepoError(), rpmrepoGetPath(), rpmrepoMkdir(), st, strcmp(), and W_OK.

rpmrepo rpmrepoUnlink ( rpmrepo  repo)

Unreference a repo wrapper instance.

Parameters
reporepo wrapper
Returns
NULL on last dereference