#include <string.h>
#include <fnmatch.h>
#include <stdio.h>
#include <stdlib.h>
#include "repo.h"
#include "pool.h"
#include "poolid_private.h"
#include "util.h"
Go to the source code of this file.
Classes | |
struct | matchdata |
Defines | |
#define | _GNU_SOURCE |
#define | IDARRAY_BLOCK 4095 |
#define | REPO_SIDEDATA_BLOCK 63 |
Functions | |
Repo * | repo_create (Pool *pool, const char *name) |
static void | repo_freedata (Repo *repo) |
void | repo_empty (Repo *repo, int reuseids) |
void | repo_free (Repo *repo, int reuseids) |
void | repo_freeallrepos (Pool *pool, int reuseids) |
void | repo_free_solvable_block (Repo *repo, Id start, int count, int reuseids) |
void * | repo_sidedata_create (Repo *repo, size_t size) |
void * | repo_sidedata_extend (Repo *repo, void *b, size_t size, Id p, int count) |
Offset | repo_addid (Repo *repo, Offset olddeps, Id id) |
Offset | repo_addid_dep (Repo *repo, Offset olddeps, Id id, Id marker) |
Offset | repo_reserve_ids (Repo *repo, Offset olddeps, int num) |
Offset | repo_fix_supplements (Repo *repo, Offset provides, Offset supplements, Offset freshens) |
Offset | repo_fix_conflicts (Repo *repo, Offset conflicts) |
int | repo_matchvalue (void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv) |
static void | domatch_idarray (Solvable *s, Id keyname, struct matchdata *md, Id *ida) |
static void | repo_search_md (Repo *repo, Id p, Id keyname, struct matchdata *md) |
void | repo_search (Repo *repo, Id p, Id keyname, const char *match, int flags, int(*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv), void *cbdata) |
const char * | repo_lookup_str (Repo *repo, Id entry, Id keyname) |
unsigned int | repo_lookup_num (Repo *repo, Id entry, Id keyname, unsigned int notfound) |
Id | repo_lookup_id (Repo *repo, Id entry, Id keyname) |
const unsigned char * | repo_lookup_bin_checksum (Repo *repo, Id entry, Id keyname, Id *typep) |
int | repo_lookup_void (Repo *repo, Id entry, Id keyname) |
Repodata * | repo_add_repodata (Repo *repo, int flags) |
Repodata * | repo_last_repodata (Repo *repo) |
void | repo_set_id (Repo *repo, Id p, Id keyname, Id id) |
void | repo_set_num (Repo *repo, Id p, Id keyname, Id num) |
void | repo_set_str (Repo *repo, Id p, Id keyname, const char *str) |
void | repo_set_poolstr (Repo *repo, Id p, Id keyname, const char *str) |
void | repo_add_poolstr_array (Repo *repo, Id p, Id keyname, const char *str) |
void | repo_internalize (Repo *repo) |
void | repo_disable_paging (Repo *repo) |
Variables | |
static Repokey | solvablekeys [RPM_RPMDBID-SOLVABLE_NAME+1] |
#define IDARRAY_BLOCK 4095 |
Definition at line 32 of file repo.c.
Referenced by repo_addid(), and repo_reserve_ids().
#define REPO_SIDEDATA_BLOCK 63 |
Definition at line 177 of file repo.c.
Referenced by repo_sidedata_create(), and repo_sidedata_extend().
Definition at line 41 of file repo.c.
References _Repo::end, _Repo::name, _Pool::nrepos, _Repo::nsolvables, _Pool::nsolvables, _Repo::pool, pool_freewhatprovides(), _Repo::repoid, _Pool::repos, sat_calloc(), sat_realloc2(), and _Repo::start.
static void repo_freedata | ( | Repo * | repo | ) | [static] |
Definition at line 59 of file repo.c.
References _Repo::idarraydata, _Repo::name, _Repo::nrepodata, _Repo::repodata, repodata_freedata(), _Repo::rpmdbid, and sat_free().
Referenced by repo_free(), and repo_freeallrepos().
void repo_empty | ( | Repo * | repo, | |
int | reuseids | |||
) |
Definition at line 74 of file repo.c.
References _Repo::end, _Repo::idarraydata, _Repo::idarraysize, _Pool::installed, _Repo::lastoff, _Repo::nrepodata, _Repo::nsolvables, _Pool::nsolvables, _Repo::pool, pool_free_solvable_block(), pool_freewhatprovides(), _Solvable::repo, _Repo::repodata, repodata_freedata(), _Repo::rpmdbid, sat_free(), _Pool::solvables, and _Repo::start.
Referenced by repo_free().
void repo_free | ( | Repo * | repo, | |
int | reuseids | |||
) |
Definition at line 117 of file repo.c.
References _Pool::nrepos, _Repo::pool, repo_empty(), repo_freedata(), _Repo::repoid, and _Pool::repos.
void repo_freeallrepos | ( | Pool * | pool, | |
int | reuseids | |||
) |
Definition at line 140 of file repo.c.
References _Pool::nrepos, _Pool::nsolvables, pool_free_solvable_block(), pool_freewhatprovides(), repo_freedata(), _Pool::repos, and sat_free().
Referenced by pool_free().
Definition at line 153 of file repo.c.
References _Repodata::end, _Repo::end, _Repo::nsolvables, _Repo::pool, pool_free_solvable_block(), _Solvable::repo, _Repo::repodata, repodata_shrink(), and _Pool::solvables.
Referenced by repo_add_solv_flags().
void* repo_sidedata_create | ( | Repo * | repo, | |
size_t | size | |||
) |
Definition at line 180 of file repo.c.
References _Repo::end, REPO_SIDEDATA_BLOCK, sat_calloc_block(), and _Repo::start.
Referenced by repo_add_solv_flags().
Definition at line 186 of file repo.c.
References _Repo::end, REPO_SIDEDATA_BLOCK, sat_extend(), and _Repo::start.
Referenced by repo_add_solvable(), and repo_add_solvable_block().
Definition at line 213 of file repo.c.
References IDARRAY_BLOCK, _Repo::idarraydata, _Repo::idarraysize, _Repo::lastoff, sat_extend(), and sat_extend_resize().
Referenced by repo_addid_dep().
Definition at line 270 of file repo.c.
References _Repo::idarraydata, and repo_addid().
Referenced by addfileprovides_cb(), pool_add_fileconflicts_deps(), and repo_fix_supplements().
Definition at line 355 of file repo.c.
References IDARRAY_BLOCK, _Repo::idarraydata, _Repo::idarraysize, _Repo::lastoff, sat_extend(), and sat_extend_resize().
Referenced by repo_add_solv_flags().
Definition at line 406 of file repo.c.
References id2str(), _Repo::idarraydata, ISRELDEP, _Repo::pool, rel2id(), REL_AND, REL_NAMESPACE, REL_OR, REL_WITH, repo_addid_dep(), and str2id().
Definition at line 598 of file repo.c.
References id2str(), _Repo::idarraydata, ISRELDEP, _Repo::pool, rel2id(), REL_NAMESPACE, and str2id().
Definition at line 637 of file repo.c.
References matchdata::callback, matchdata::callback_data, datamatcher_match(), matchdata::flags, _Datamatcher::match, matchdata::matcher, matchdata::pool, repodata_stringify(), matchdata::stop, and _KeyValue::str.
Referenced by domatch_idarray(), and repo_search_md().
Definition at line 670 of file repo.c.
References _KeyValue::entry, _KeyValue::eof, _KeyValue::id, _KeyValue::parent, repo_matchvalue(), and matchdata::stop.
Referenced by repo_search_md().
Definition at line 685 of file repo.c.
References _Solvable::arch, _Solvable::conflicts, domatch_idarray(), _Repodata::end, _Solvable::enhances, _Solvable::evr, matchdata::flags, _KeyValue::id, _Repo::idarraydata, _Repodata::keys, _Repodata::loadcallback, _Repokey::name, _Solvable::name, _Repodata::nkeys, _KeyValue::num, _Solvable::obsoletes, _KeyValue::parent, _Repo::pool, matchdata::pool, _Solvable::provides, _Solvable::recommends, _Solvable::repo, repo_matchvalue(), _Repo::repodata, REPODATA_AVAILABLE, REPODATA_ERROR, repodata_precheck_keyname(), repodata_search(), REPODATA_STUB, _Solvable::requires, _Repo::rpmdbid, SEARCH_COMPLETE_FILELIST, SEARCH_NEXT_KEY, SEARCH_NEXT_SOLVABLE, SEARCH_NO_STORAGE_SOLVABLE, _Pool::solvables, _Repo::start, _Repodata::state, matchdata::stop, _Solvable::suggests, _Solvable::supplements, and _Solvable::vendor.
Referenced by repo_search().
void repo_search | ( | Repo * | repo, | |
Id | p, | |||
Id | keyname, | |||
const char * | match, | |||
int | flags, | |||
int(*)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv) | callback, | |||
void * | cbdata | |||
) |
Definition at line 845 of file repo.c.
References matchdata::callback, matchdata::callback_data, datamatcher_free(), datamatcher_init(), _Repo::disabled, matchdata::flags, matchdata::matcher, _Repo::pool, matchdata::pool, repo_search_md(), and SEARCH_DISABLED_REPOS.
Referenced by pool_calc_duchanges(), and pool_search().
Definition at line 864 of file repo.c.
References _Solvable::arch, _Repodata::end, _Solvable::evr, id2str(), _Repodata::keys, _Repokey::name, _Solvable::name, _Repodata::nkeys, _Repo::pool, matchdata::pool, _Repo::repodata, repodata_lookup_str(), repodata_precheck_keyname(), _Pool::solvables, SOLVID_META, _Repokey::type, and _Solvable::vendor.
Referenced by solvable_lookup_str().
Definition at line 898 of file repo.c.
References _Repodata::end, _Repodata::keys, _Repokey::name, _Repodata::nkeys, _Repo::repodata, repodata_lookup_num(), repodata_precheck_keyname(), _Repo::rpmdbid, SOLVID_META, _Repo::start, and _Repokey::type.
Referenced by solvable_lookup_num().
Definition at line 932 of file repo.c.
References _Solvable::arch, _Repodata::end, _Solvable::evr, _Repodata::keys, _Repodata::localpool, _Repokey::name, _Solvable::name, _Repodata::nkeys, _Repo::pool, _Repo::repodata, repodata_globalize_id(), repodata_lookup_id(), repodata_precheck_keyname(), _Pool::solvables, SOLVID_META, _Repokey::type, and _Solvable::vendor.
Referenced by solvable_lookup_id().
Definition at line 968 of file repo.c.
References _Repodata::end, _Repodata::keys, _Repokey::name, _Repodata::nkeys, _Repo::repodata, repodata_lookup_bin_checksum(), repodata_precheck_keyname(), and SOLVID_META.
Referenced by solvable_lookup_bin_checksum().
Definition at line 993 of file repo.c.
References _Repodata::end, _Repodata::keys, _Repokey::name, _Repodata::nkeys, _Repo::repodata, repodata_lookup_void(), repodata_precheck_keyname(), SOLVID_META, and _Repokey::type.
Referenced by solvable_lookup_void().
Definition at line 1019 of file repo.c.
References _Repo::nrepodata, REPO_LOCALPOOL, REPO_REUSE_REPODATA, REPO_USE_LOADING, _Repo::repodata, repodata_create(), repodata_freedata(), repodata_initdata(), REPODATA_LOADING, REPODATA_STUB, and _Repodata::state.
Referenced by repo_add_solv_flags(), repo_last_repodata(), and repodata_create_stubs().
Definition at line 1049 of file repo.c.
References _Repo::nrepodata, repo_add_repodata(), _Repo::repodata, REPODATA_STUB, and _Repodata::state.
Referenced by repo_add_poolstr_array(), repo_set_id(), repo_set_num(), repo_set_poolstr(), and repo_set_str().
Definition at line 1059 of file repo.c.
References repo_last_repodata(), and repodata_set_id().
Definition at line 1066 of file repo.c.
References repo_last_repodata(), and repodata_set_num().
Definition at line 1073 of file repo.c.
References repo_last_repodata(), and repodata_set_str().
Definition at line 1080 of file repo.c.
References repo_last_repodata(), and repodata_set_poolstr().
Definition at line 1087 of file repo.c.
References repo_last_repodata(), and repodata_add_poolstr_array().
void repo_internalize | ( | Repo * | repo | ) |
Definition at line 1094 of file repo.c.
References _Repodata::attrs, _Repo::repodata, repodata_internalize(), and _Repodata::xattrs.
void repo_disable_paging | ( | Repo * | repo | ) |
Definition at line 1105 of file repo.c.
References _Repo::repodata, and repodata_disable_paging().
Repokey solvablekeys[RPM_RPMDBID-SOLVABLE_NAME+1] [static] |
{ { SOLVABLE_NAME, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_ARCH, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_EVR, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_VENDOR, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_PROVIDES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_OBSOLETES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_CONFLICTS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_REQUIRES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_RECOMMENDS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_SUGGESTS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_SUPPLEMENTS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_ENHANCES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, { RPM_RPMDBID, REPOKEY_TYPE_U32, 0, KEY_STORAGE_SOLVABLE }, }