rpm 5.3.12
Defines | Typedefs | Functions | Variables
rpmdb/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.

Defines

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

Variables

int _rpmrepo_debug

Define 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 _, rpmioExists(), and rpmrepoError().

Referenced by main().

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, Rename(), Rmdir(), rpmGetPath(), rpmioExists(), rpmrepoError(), and Unlink().

Referenced by main().

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(), Realpath(), repoWriteMetadataDocs(), rpmGetPath(), rpmrepoCloseMDFile(), rpmrepoGetFileList(), rpmrepoOpenMDFile(), and xstrdup().

Referenced by main().

int rpmrepoDoRepoMetadata ( rpmrepo  repo)

Write repository manifest.

Parameters:
reporepository
Returns:
0 on success.

Definition at line 1078 of file rpmrepo.c.

References _, _free(), algo2tagname(), Fopen(), Rename(), rpmExpand(), rpmGetPath(), rpmioExists(), rpmrepoError(), rpmrepoFclose(), rpmrepoGetPath(), rpmrepoMDExpand(), rpmrfileXMLWrite(), Unlink(), and xstrdup().

Referenced by main().

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, and EXIT_FAILURE.

Referenced by main(), 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

Referenced by main().

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(), and rpmrepoError().

Referenced by main(), and 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 rpmrepoGetPool(), rpmrepoInitPopt(), and rpmrepoLink().

Referenced by main().

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 MAXPATHLEN, Realpath(), and xstrdup().

Referenced by main(), 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(), rpmGetPath(), rpmioExists(), rpmrepoError(), rpmrepoGetPath(), rpmrepoMkdir(), and W_OK.

Referenced by main().

rpmrepo rpmrepoUnlink ( rpmrepo  repo)

Unreference a repo wrapper instance.

Parameters:
reporepo wrapper
Returns:
NULL on last dereference