rpm  5.4.10
Macros | Functions | Variables
rpmrepo.c File Reference
#include "system.h"
#include <rpmio_internal.h>
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmlog.h>
#include <rpmurl.h>
#include <poptIO.h>
#include <rpmrepo.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <pkgio.h>
#include <rpmts.h>
#include "debug.h"
#include "yum_primary_xml"
#include "yum_filelists_xml"
#include "yum_other_xml"
#include "wnh_primary_yaml"
#include "wnh_filelists_yaml"
#include "wnh_other_yaml"
#include "deb_Packages"
#include "deb_Sources"
#include "yum_primary_sqlite"
#include "yum_filelists_sqlite"
#include "yum_other_sqlite"
Include dependency graph for rpmrepo.c:

Go to the source code of this file.

Macros

#define _RPMREPO_INTERNAL
 
#define REPODBG(_l)   if (_rpmrepo_debug) fprintf _l
 

Functions

static int rpmioExists (const char *fn, struct stat *st)
 Return stat(2) for a file. More...
 
static time_t rpmioCtime (const char *fn)
 Return stat(2) creation time of a file. More...
 
void rpmrepoError (int lvl, const char *fmt,...)
 Print an error message and exit (if requested). More...
 
static const char * rpmrepoGetPath (rpmrepo repo, const char *dir, const char *type, int compress)
 Return /repository/directory/component.markup.compression path. More...
 
static void rpmrepoProgress (rpmrepo repo, const char *item, int current, int total)
 Display progress. More...
 
static int rpmrepoMkdir (rpmrepo repo, const char *dn)
 Create directory path. More...
 
const char * rpmrepoRealpath (const char *lpath)
 Return realpath(3) canonicalized absolute path. More...
 
int rpmrepoTestSetupDirs (rpmrepo repo)
 Test for repository sanity. More...
 
static int chkSuffix (const char *fn, const char *suffix)
 Check file name for a suffix. 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...
 
static int rpmrfileXMLWrite (rpmrfile rfile, const char *spew)
 Write to a repository metadata file. More...
 
static int rpmrepoFclose (rpmrepo repo, FD_t fd)
 Close an I/O stream, accumulating uncompress/digest statistics. More...
 
static int rpmrepoOpenMDFile (const rpmrepo repo, rpmrfile rfile)
 Open a repository metadata file. More...
 
static int rpmrepoRfileDigest (const rpmrepo repo, rpmrfile rfile, const char **digestp)
 Compute digest of a file. More...
 
static int rpmrepoCloseMDFile (const rpmrepo repo, rpmrfile rfile)
 Close a repository metadata file. More...
 
static const char * algo2tagname (uint32_t algo)
 
static const char * rpmrepoMDExpand (rpmrepo repo, rpmrfile rfile)
 Return a repository metadata file item. More...
 
int rpmrepoDoRepoMetadata (rpmrepo repo)
 Write repository manifest. More...
 
int rpmrepoDoFinalMove (rpmrepo repo)
 Rename temporary repository to final paths. More...
 
static Header rpmrepoReadHeader (rpmrepo repo, const char *path)
 Read a header from a repository package file, computing package file digest. More...
 
static const char * rfileHeaderSprintf (Header h, const char *qfmt)
 Return header query. More...
 
static int rpmrepoWriteMDFile (rpmrepo repo, rpmrfile rfile, Header h)
 Export a single package's metadata to repository metadata file(s). More...
 
static int repoWriteMetadataDocs (rpmrepo repo)
 Export all package metadata to repository metadata file(s). More...
 
int rpmrepoDoPkgMetadata (rpmrepo repo)
 Write repository metadata files. More...
 
static int rpmrepoInitPopt (rpmrepo repo, char **av)
 
static void rpmrepoFini (void *_repo)
 
static rpmrepo rpmrepoGetPool (rpmioPool pool)
 
rpmrepo rpmrepoNew (char **av, int flags)
 Create and load a repo wrapper. More...
 

Variables

int _rpmrepo_debug = 0
 
static const char primary_xml_init []
 
static const char primary_xml_fini [] = "</metadata>\n"
 
static const char filelists_xml_init []
 
static const char filelists_xml_fini [] = "</filelists>\n"
 
static const char other_xml_init []
 
static const char other_xml_fini [] = "</otherdata>\n"
 
static const char repomd_xml_init []
 
static const char repomd_xml_fini [] = "</repomd>\n"
 
static const char primary_xml_qfmt [] =
 
static const char filelists_xml_qfmt [] =
 
static const char other_xml_qfmt [] =
 
static const char primary_yaml_qfmt [] =
 
static const char filelists_yaml_qfmt [] =
 
static const char other_yaml_qfmt [] =
 
static const char Packages_qfmt [] =
 
static const char Sources_qfmt [] =
 
static const char * primary_sql_init []
 
static const char * filelists_sql_init []
 
static const char * other_sql_init []
 
static const char primary_sql_qfmt [] =
 
static const char filelists_sql_qfmt [] =
 
static const char other_sql_qfmt [] =
 
static struct rpmrepo_s __repo
 
static rpmrepo _repo = &__repo
 
static int compression = -1
 
static struct poptOption repoCompressionPoptTable []
 
static struct poptOption _rpmrepoOptions []
 
static struct poptOption rpmrepoOptionsTable []
 
rpmioPool _rpmrepoPool = NULL
 

Macro Definition Documentation

§ _RPMREPO_INTERNAL

#define _RPMREPO_INTERNAL

Definition at line 55 of file rpmrepo.c.

§ REPODBG

#define REPODBG (   _l)    if (_rpmrepo_debug) fprintf _l

Definition at line 68 of file rpmrepo.c.

Function Documentation

§ algo2tagname()

static const char* algo2tagname ( uint32_t  algo)
static

§ chkSuffix()

static int chkSuffix ( const char *  fn,
const char *  suffix 
)
static

Check file name for a suffix.

Parameters
fnfile name
suffixsuffix
Returns
1 if file name ends with suffix

Definition at line 614 of file rpmrepo.c.

Referenced by rpmrepoGetFileList().

§ repoWriteMetadataDocs()

static int repoWriteMetadataDocs ( rpmrepo  repo)
static

Export all package metadata to repository metadata file(s).

Parameters
reporepository
Returns
0 on success

Definition at line 1522 of file rpmrepo.c.

References headerFree(), rpmGetPath(), rpmrepoError(), rpmrepoProgress(), rpmrepoReadHeader(), and rpmrepoWriteMDFile().

Referenced by rpmrepoDoPkgMetadata().

§ rfileHeaderSprintf()

static const char* rfileHeaderSprintf ( Header  h,
const char *  qfmt 
)
static

Return header query.

Parameters
hheader
qfmtquery format
Returns
query format result

Definition at line 1424 of file rpmrepo.c.

References _, _free(), headerGetInstance(), headerSprintf(), rpmrepoError(), snprintf(), stpcpy(), and xmalloc.

Referenced by rpmrepoWriteMDFile().

§ rpmioCtime()

static time_t rpmioCtime ( const char *  fn)
static

Return stat(2) creation time of a file.

Parameters
fnfile path
Returns
st_ctime

Definition at line 412 of file rpmrepo.c.

References rpmioExists().

Referenced by rpmrepoCloseMDFile().

§ rpmioExists()

static int rpmioExists ( const char *  fn,
struct stat *  st 
)
static

Return stat(2) for a file.

Return values
ststat(2) buffer
Returns
0 on success

Definition at line 400 of file rpmrepo.c.

References Stat().

Referenced by rpmioCtime(), rpmrepoCheckTimeStamps(), rpmrepoDoFinalMove(), rpmrepoDoRepoMetadata(), rpmrepoRfileDigest(), and rpmrepoTestSetupDirs().

§ rpmrepoCheckTimeStamps()

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().

§ rpmrepoCloseMDFile()

static int rpmrepoCloseMDFile ( const rpmrepo  repo,
rpmrfile  rfile 
)
static

Close a repository metadata file.

Parameters
reporepository
rfilerepository metadata file
Returns
0 on success

Definition at line 976 of file rpmrepo.c.

References _, _free(), fdFiniDigest(), fdGetOPath(), rpmGetPath(), rpmioCtime(), rpmrepoError(), rpmrepoFclose(), rpmrepoRfileDigest(), rpmrfileXMLWrite(), and xstrdup().

Referenced by rpmrepoDoPkgMetadata().

§ rpmrepoDoFinalMove()

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().

§ rpmrepoDoPkgMetadata()

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().

§ rpmrepoDoRepoMetadata()

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().

§ rpmrepoError()

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().

§ rpmrepoFclose()

static int rpmrepoFclose ( rpmrepo  repo,
FD_t  fd 
)
static

Close an I/O stream, accumulating uncompress/digest statistics.

Parameters
reporepository
fdI/O stream
Returns
0 on success

Definition at line 733 of file rpmrepo.c.

References Fclose(), FDSTAT_DIGEST, fdstat_op(), FDSTAT_READ, rpmswAdd(), RPMTS_OP_DIGEST, RPMTS_OP_UNCOMPRESS, and rpmtsOp().

Referenced by rpmrepoCloseMDFile(), rpmrepoDoRepoMetadata(), and rpmrepoRfileDigest().

§ rpmrepoFini()

static void rpmrepoFini ( void *  _repo)
static

Definition at line 1849 of file rpmrepo.c.

References _free(), _repo, argvFree(), and mireFreeAll().

Referenced by rpmrepoGetPool().

§ rpmrepoGetFileList()

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().

§ rpmrepoGetPath()

static const char* rpmrepoGetPath ( rpmrepo  repo,
const char *  dir,
const char *  type,
int  compress 
)
static

Return /repository/directory/component.markup.compression path.

Parameters
reporepository
dirdirectory
typefile
Returns
repository file path

Definition at line 448 of file rpmrepo.c.

References rpmGetPath().

Referenced by rpmrepoDoRepoMetadata(), rpmrepoOpenMDFile(), rpmrepoRfileDigest(), and rpmrepoTestSetupDirs().

§ rpmrepoGetPool()

static rpmrepo rpmrepoGetPool ( rpmioPool  pool)
static

Definition at line 1881 of file rpmrepo.c.

References _rpmrepoPool, rpmioGetPool(), rpmioNewPool(), and rpmrepoFini().

Referenced by rpmrepoNew().

§ rpmrepoInitPopt()

static int rpmrepoInitPopt ( rpmrepo  repo,
char **  av 
)
static

§ rpmrepoMDExpand()

static const char* rpmrepoMDExpand ( rpmrepo  repo,
rpmrfile  rfile 
)
static

Return a repository metadata file item.

Parameters
reporepository
Returns
repository metadata file item

Definition at line 1061 of file rpmrepo.c.

References algo2tagname(), rpmExpand(), and snprintf().

Referenced by rpmrepoDoRepoMetadata().

§ rpmrepoMkdir()

static int rpmrepoMkdir ( rpmrepo  repo,
const char *  dn 
)
static

Create directory path.

Parameters
reporepository
dndirectory path
Returns
0 on success

Definition at line 494 of file rpmrepo.c.

References _, _free(), errno, Mkdir(), rpmGetPath(), rpmioMkpath(), rpmrepoError(), URL_IS_UNKNOWN, and urlPath().

Referenced by rpmrepoTestSetupDirs().

§ 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().

§ rpmrepoOpenMDFile()

static int rpmrepoOpenMDFile ( const rpmrepo  repo,
rpmrfile  rfile 
)
static

Open a repository metadata file.

Parameters
reporepository
rfilerepository metadata file
Returns
0 on success

Definition at line 759 of file rpmrepo.c.

References _, _free(), fdInitDigest(), Fopen(), Fstrerror(), Fwrite(), PGPHASHALGO_NONE, rpmGetPath(), rpmrepoError(), rpmrepoGetPath(), and snprintf().

Referenced by rpmrepoDoPkgMetadata().

§ rpmrepoProgress()

static void rpmrepoProgress ( rpmrepo  repo,
const char *  item,
int  current,
int  total 
)
static

Display progress.

Parameters
reporepository
itemrepository item (usually a file path)
currentcurrent iteration index
totalmaximum iteration index

Definition at line 465 of file rpmrepo.c.

References __progname.

Referenced by repoWriteMetadataDocs().

§ rpmrepoReadHeader()

static Header rpmrepoReadHeader ( rpmrepo  repo,
const char *  path 
)
static

Read a header from a repository package file, computing package file digest.

Parameters
reporepository
pathpackage file path
Returns
header (NULL on error)

Definition at line 1360 of file rpmrepo.c.

References _, __progname, _free(), headerToken_s::baseurl, Fclose(), fdFiniDigest(), fdInitDigest(), Ferror(), Fopen(), Fread(), Fstrerror(), headerFree(), headerSetBaseURL(), headerSetDigest(), headerSetInstance(), PGPHASHALGO_NONE, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, and rpmReadPackageFile().

Referenced by repoWriteMetadataDocs().

§ rpmrepoRealpath()

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().

§ rpmrepoRfileDigest()

static int rpmrepoRfileDigest ( const rpmrepo  repo,
rpmrfile  rfile,
const char **  digestp 
)
static

§ rpmrepoTestSetupDirs()

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().

§ rpmrepoWriteMDFile()

static int rpmrepoWriteMDFile ( rpmrepo  repo,
rpmrfile  rfile,
Header  h 
)
static

Export a single package's metadata to repository metadata file(s).

Parameters
reporepository
rfilerepository metadata file
hheader
Returns
0 on success

Definition at line 1496 of file rpmrepo.c.

References rfileHeaderSprintf(), and rpmrfileXMLWrite().

Referenced by repoWriteMetadataDocs().

§ rpmrfileXMLWrite()

static int rpmrfileXMLWrite ( rpmrfile  rfile,
const char *  spew 
)
static

Write to a repository metadata file.

Parameters
rfilerepository metadata file
spewcontents
Returns
0 on success

Definition at line 709 of file rpmrepo.c.

References _, _free(), Fstrerror(), Fwrite(), and rpmrepoError().

Referenced by rpmrepoCloseMDFile(), rpmrepoDoRepoMetadata(), and rpmrepoWriteMDFile().

Variable Documentation

§ __repo

struct rpmrepo_s __repo
static

Definition at line 298 of file rpmrepo.c.

§ _repo

rpmrepo _repo = &__repo
static

Definition at line 391 of file rpmrepo.c.

Referenced by rpmrepoFini(), and rpmrepoInitPopt().

§ _rpmrepo_debug

int _rpmrepo_debug = 0

Definition at line 66 of file rpmrepo.c.

Referenced by main().

§ _rpmrepoOptions

struct poptOption _rpmrepoOptions[]
static

Definition at line 1665 of file rpmrepo.c.

§ _rpmrepoPool

rpmioPool _rpmrepoPool = NULL

Definition at line 1879 of file rpmrepo.c.

Referenced by rpmcliFini(), and rpmrepoGetPool().

§ compression

int compression = -1
static

Definition at line 1647 of file rpmrepo.c.

§ filelists_sql_init

const char* filelists_sql_init[]
static
Initial value:
= {
"PRAGMA synchronous = \"OFF\";",
"pragma locking_mode = \"EXCLUSIVE\";",
"CREATE TABLE db_info (dbversion INTEGER, checksum TEXT);",
"CREATE TABLE filelist ( pkgKey INTEGER, name TEXT, type TEXT );",
"CREATE TABLE packages ( pkgKey INTEGER PRIMARY KEY, pkgId TEXT);",
"CREATE INDEX filelistnames ON filelist (name);",
"CREATE INDEX keyfile ON filelist (pkgKey);",
"CREATE INDEX pkgId ON packages (pkgId);",
"CREATE TRIGGER remove_filelist AFTER DELETE ON packages\
\n BEGIN\
\n DELETE FROM filelist WHERE pkgKey = old.pkgKey;\
\n END;",
"INSERT into db_info values (9, 'direct_create');",
NULL
}

Definition at line 176 of file rpmrepo.c.

§ filelists_sql_qfmt

const char filelists_sql_qfmt[] =
static

Definition at line 279 of file rpmrepo.c.

§ filelists_xml_fini

const char filelists_xml_fini[] = "</filelists>\n"
static

Definition at line 84 of file rpmrepo.c.

§ filelists_xml_init

const char filelists_xml_init[]
static
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<filelists xmlns=\"http://linux.duke.edu/metadata/filelists\" packages=\"0\">\n"

Definition at line 80 of file rpmrepo.c.

§ filelists_xml_qfmt

const char filelists_xml_qfmt[] =
static

Definition at line 107 of file rpmrepo.c.

§ filelists_yaml_qfmt

const char filelists_yaml_qfmt[] =
static

Definition at line 122 of file rpmrepo.c.

§ other_sql_init

const char* other_sql_init[]
static
Initial value:
= {
"PRAGMA synchronous = \"OFF\";",
"pragma locking_mode = \"EXCLUSIVE\";",
"CREATE TABLE changelog ( pkgKey INTEGER, author TEXT, date INTEGER, changelog TEXT);",
"CREATE TABLE db_info (dbversion INTEGER, checksum TEXT);",
"CREATE TABLE packages ( pkgKey INTEGER PRIMARY KEY, pkgId TEXT);",
"CREATE INDEX keychange ON changelog (pkgKey);",
"CREATE INDEX pkgId ON packages (pkgId);",
"CREATE TRIGGER remove_changelogs AFTER DELETE ON packages\
\n BEGIN\
\n DELETE FROM changelog WHERE pkgKey = old.pkgKey;\
\n END;",
"INSERT into db_info values (9, 'direct_create');",
NULL
}

Definition at line 195 of file rpmrepo.c.

§ other_sql_qfmt

const char other_sql_qfmt[] =
static

Definition at line 291 of file rpmrepo.c.

§ other_xml_fini

const char other_xml_fini[] = "</otherdata>\n"
static

Definition at line 91 of file rpmrepo.c.

§ other_xml_init

const char other_xml_init[]
static
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<otherdata xmlns=\"http://linux.duke.edu/metadata/other\" packages=\"0\">\n"

Definition at line 87 of file rpmrepo.c.

§ other_xml_qfmt

const char other_xml_qfmt[] =
static

Definition at line 112 of file rpmrepo.c.

§ other_yaml_qfmt

const char other_yaml_qfmt[] =
static

Definition at line 127 of file rpmrepo.c.

§ Packages_qfmt

const char Packages_qfmt[] =
static

Definition at line 132 of file rpmrepo.c.

§ primary_sql_init

const char* primary_sql_init[]
static
Initial value:
= {
"PRAGMA synchronous = \"OFF\";",
"pragma locking_mode = \"EXCLUSIVE\";",
"CREATE TABLE conflicts ( pkgKey INTEGER, name TEXT, flags TEXT, epoch TEXT, version TEXT, release TEXT );",
"CREATE TABLE db_info (dbversion INTEGER, checksum TEXT);",
"CREATE TABLE files ( pkgKey INTEGER, name TEXT, type TEXT );",
"CREATE TABLE obsoletes ( pkgKey INTEGER, name TEXT, flags TEXT, epoch TEXT, version TEXT, release TEXT );",
"CREATE TABLE packages ( pkgKey INTEGER PRIMARY KEY, pkgId TEXT, name TEXT, arch TEXT, version TEXT, epoch TEXT, release TEXT, summary TEXT, description TEXT, url TEXT, time_file INTEGER, time_build INTEGER, rpm_license TEXT, rpm_vendor TEXT, rpm_group TEXT, rpm_buildhost TEXT, rpm_sourcerpm TEXT, rpm_header_start INTEGER, rpm_header_end INTEGER, rpm_packager TEXT, size_package INTEGER, size_installed INTEGER, size_archive INTEGER, location_href TEXT, location_base TEXT, checksum_type TEXT);",
"CREATE TABLE provides ( pkgKey INTEGER, name TEXT, flags TEXT, epoch TEXT, version TEXT, release TEXT );",
"CREATE TABLE requires ( pkgKey INTEGER, name TEXT, flags TEXT, epoch TEXT, version TEXT, release TEXT );",
"CREATE INDEX filenames ON files (name);",
"CREATE INDEX packageId ON packages (pkgId);",
"CREATE INDEX packagename ON packages (name);",
"CREATE INDEX pkgconflicts on conflicts (pkgKey);",
"CREATE INDEX pkgobsoletes on obsoletes (pkgKey);",
"CREATE INDEX pkgprovides on provides (pkgKey);",
"CREATE INDEX pkgrequires on requires (pkgKey);",
"CREATE INDEX providesname ON provides (name);",
"CREATE INDEX requiresname ON requires (name);",
"CREATE TRIGGER removals AFTER DELETE ON packages\
\n BEGIN\n\
\n DELETE FROM files WHERE pkgKey = old.pkgKey;\
\n DELETE FROM requires WHERE pkgKey = old.pkgKey;\
\n DELETE FROM provides WHERE pkgKey = old.pkgKey;\
\n DELETE FROM conflicts WHERE pkgKey = old.pkgKey;\
\n DELETE FROM obsoletes WHERE pkgKey = old.pkgKey;\
\n END;",
"INSERT into db_info values (9, 'direct_create');",
NULL
}

Definition at line 143 of file rpmrepo.c.

§ primary_sql_qfmt

const char primary_sql_qfmt[] =
static

Definition at line 268 of file rpmrepo.c.

§ primary_xml_fini

const char primary_xml_fini[] = "</metadata>\n"
static

Definition at line 77 of file rpmrepo.c.

§ primary_xml_init

const char primary_xml_init[]
static
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<metadata xmlns=\"http://linux.duke.edu/metadata/common\" xmlns:rpm=\"http://linux.duke.edu/metadata/rpm\" packages=\"0\">\n"

Definition at line 73 of file rpmrepo.c.

§ primary_xml_qfmt

const char primary_xml_qfmt[] =
static

Definition at line 102 of file rpmrepo.c.

§ primary_yaml_qfmt

const char primary_yaml_qfmt[] =
static

Definition at line 117 of file rpmrepo.c.

§ repoCompressionPoptTable

struct poptOption repoCompressionPoptTable[]
static
Initial value:
= {
{ "uncompressed", '\0', POPT_ARG_VAL, &compression, 0,
N_("don't compress"), NULL },
{ "gzip", 'Z', POPT_ARG_VAL, &compression, 1,
N_("use gzip compression"), NULL },
{ "bzip2", '\0', POPT_ARG_VAL, &compression, 2,
N_("use bzip2 compression"), NULL },
{ "lzma", '\0', POPT_ARG_VAL, &compression, 3,
N_("use lzma compression"), NULL },
{ "xz", '\0', POPT_ARG_VAL, &compression, 4,
N_("use xz compression"), NULL },
POPT_TABLEEND
}
#define N_(Text)
Definition: system.h:490
static int compression
Definition: rpmrepo.c:1647

Definition at line 1650 of file rpmrepo.c.

§ repomd_xml_fini

const char repomd_xml_fini[] = "</repomd>\n"
static

Definition at line 98 of file rpmrepo.c.

§ repomd_xml_init

const char repomd_xml_init[]
static
Initial value:
= "\
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
<repomd xmlns=\"http://linux.duke.edu/metadata/repo\">\n"

Definition at line 94 of file rpmrepo.c.

§ rpmrepoOptionsTable

struct poptOption rpmrepoOptionsTable[]
static
Initial value:
= {
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, _rpmrepoOptions, 0,
N_("Repository options:"), NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0,
N_("Fts(3) traversal options:"), NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, repoCompressionPoptTable, 0,
N_("Available compressions:"), NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioDigestPoptTable, 0,
N_("Available digests:"), NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0,
N_("Common options for all rpmio executables:"),
NULL },
POPT_AUTOALIAS
POPT_AUTOHELP
POPT_TABLEEND
}
struct poptOption rpmioDigestPoptTable[]
Digest options using popt.
Definition: poptIO.c:151
struct poptOption rpmioFtsPoptTable[]
Definition: poptIO.c:529
static struct poptOption repoCompressionPoptTable[]
Definition: rpmrepo.c:1650
#define N_(Text)
Definition: system.h:490
struct poptOption rpmioAllPoptTable[]
Definition: poptIO.c:551
static struct poptOption _rpmrepoOptions[]
Definition: rpmrepo.c:1665

Definition at line 1707 of file rpmrepo.c.

§ Sources_qfmt

const char Sources_qfmt[] =
static

Definition at line 137 of file rpmrepo.c.