#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <string.h>
#include "pool.h"
#include "repo.h"
#include "poolid.h"
#include "poolid_private.h"
#include "poolarch.h"
#include "util.h"
#include "bitmap.h"
#include "evr.h"
#include "knownid.h"
Go to the source code of this file.
Classes | |
struct | searchfiles |
struct | addfileprovides_cbdata |
struct | mptree |
struct | ducbdata |
Defines | |
#define | SOLVABLE_BLOCK 255 |
#define | KNOWNID_INITIALIZE |
#define | EVRCMP_DEPCMP EVRCMP_MATCH_RELEASE |
#define | SEARCHFILES_BLOCK 127 |
#define | MPTREE_BLOCK 15 |
Functions | |
Pool * | pool_create (void) |
Creates a new pool. | |
void | pool_free (Pool *pool) |
Delete a pool. | |
Id | pool_add_solvable (Pool *pool) |
Solvable management. | |
Id | pool_add_solvable_block (Pool *pool, int count) |
void | pool_free_solvable_block (Pool *pool, Id start, int count, int reuseids) |
void | pool_set_installed (Pool *pool, Repo *installed) |
static int | pool_shrink_whatprovides_sortcmp (const void *ap, const void *bp, void *dp) |
static void | pool_shrink_whatprovides (Pool *pool) |
void | pool_createwhatprovides (Pool *pool) |
Prepares a pool for solving. | |
void | pool_freewhatprovides (Pool *pool) |
Id | pool_queuetowhatprovides (Pool *pool, Queue *q) |
int | pool_match_nevr_rel (Pool *pool, Solvable *s, Id d) |
static int | pool_match_flags_evr (Pool *pool, int pflags, Id pevr, int flags, int evr) |
int | pool_match_dep (Pool *pool, Id d1, Id d2) |
Id | pool_addrelproviders (Pool *pool, Id d) |
void | pool_debug (Pool *pool, int type, const char *format,...) |
void | pool_setdebuglevel (Pool *pool, int level) |
static void | pool_addfileprovides_dep (Pool *pool, Id *ida, struct searchfiles *sf, struct searchfiles *isf) |
static int | addfileprovides_cb (void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *value) |
static void | pool_addfileprovides_search (Pool *pool, struct addfileprovides_cbdata *cbd, struct searchfiles *sf, Repo *repoonly) |
void | pool_addfileprovides_ids (Pool *pool, Repo *installed, Id **idp) |
void | pool_addfileprovides (Pool *pool) |
void | pool_search (Pool *pool, Id p, Id key, const char *match, int flags, int(*callback)(void *cbdata, Solvable *s, struct _Repodata *data, struct _Repokey *key, struct _KeyValue *kv), void *cbdata) |
void | pool_clear_pos (Pool *pool) |
void | pool_set_languages (Pool *pool, const char **languages, int nlanguages) |
Id | pool_id2langid (Pool *pool, Id id, const char *lang, int create) |
char * | pool_alloctmpspace (Pool *pool, int len) |
char * | pool_tmpjoin (Pool *pool, const char *str1, const char *str2, const char *str3) |
static int | solver_fill_DU_cb (void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *value) |
static void | propagate_mountpoints (struct mptree *mptree, int pos, Id mountpoint) |
void | pool_calc_duchanges (Pool *pool, Map *installedmap, DUChanges *mps, int nmps) |
int | pool_calc_installsizechange (Pool *pool, Map *installedmap) |
static Id | dep2name (Pool *pool, Id dep) |
static int | providedbyinstalled_multiversion (Pool *pool, unsigned char *map, Id n, Id con) |
static int | providedbyinstalled (Pool *pool, unsigned char *map, Id dep, int ispatch, Map *noobsoletesmap) |
void | pool_trivial_installable_noobsoletesmap (Pool *pool, Map *installedmap, Queue *pkgs, Queue *res, Map *noobsoletesmap) |
void | pool_trivial_installable (Pool *pool, Map *installedmap, Queue *pkgs, Queue *res) |
const char * | pool_lookup_str (Pool *pool, Id entry, Id keyname) |
Id | pool_lookup_id (Pool *pool, Id entry, Id keyname) |
unsigned int | pool_lookup_num (Pool *pool, Id entry, Id keyname, unsigned int notfound) |
int | pool_lookup_void (Pool *pool, Id entry, Id keyname) |
const unsigned char * | pool_lookup_bin_checksum (Pool *pool, Id entry, Id keyname, Id *typep) |
const char * | pool_lookup_checksum (Pool *pool, Id entry, Id keyname, Id *typep) |
void | pool_add_fileconflicts_deps (Pool *pool, Queue *conflicts) |
#define SOLVABLE_BLOCK 255 |
Definition at line 30 of file pool.c.
Referenced by pool_add_solvable(), pool_add_solvable_block(), and pool_create().
#define EVRCMP_DEPCMP EVRCMP_MATCH_RELEASE |
Definition at line 436 of file pool.c.
Referenced by pool_match_flags_evr(), and pool_match_nevr_rel().
#define SEARCHFILES_BLOCK 127 |
Definition at line 790 of file pool.c.
Referenced by pool_addfileprovides_dep(), and pool_addfileprovides_ids().
#define MPTREE_BLOCK 15 |
Definition at line 1354 of file pool.c.
Referenced by pool_calc_duchanges().
Pool* pool_create | ( | void | ) |
Creates a new pool.
Definition at line 38 of file pool.c.
References _Pool::allowselfconflicts, _Solvable::arch, _Pool::debugmask, _Solvable::evr, _Solvable::name, _Pool::nrels, _Pool::nsolvables, _Pool::obsoleteusescolors, queue_init(), REL_BLOCK, _Pool::rels, sat_calloc(), SAT_DEBUG_RESULT, sat_extend_resize(), SOLVABLE_BLOCK, _Pool::solvables, _Pool::ss, stringpool_init(), SYSTEMSOLVABLE, and _Pool::vendormap.
void pool_free | ( | Pool * | pool | ) |
Delete a pool.
Definition at line 79 of file pool.c.
References _Pool::id2arch, _Pool::languagecache, _Pool::languages, _Pool::nlanguages, pool_freeidhashes(), pool_freewhatprovides(), POOL_TMPSPACEBUF, queue_free(), _Pool::rels, repo_freeallrepos(), sat_free(), _Pool::solvables, _Pool::ss, stringpool_free(), _Pool::tmpspacebuf, and _Pool::vendormap.
Solvable management.
Definition at line 109 of file pool.c.
References _Pool::nsolvables, sat_extend(), SOLVABLE_BLOCK, and _Pool::solvables.
Referenced by repo_add_solvable().
Definition at line 117 of file pool.c.
References _Pool::nsolvables, sat_extend(), SOLVABLE_BLOCK, and _Pool::solvables.
Referenced by repo_add_solvable_block().
Definition at line 129 of file pool.c.
References _Pool::nsolvables, and _Pool::solvables.
Referenced by repo_empty(), repo_free_solvable_block(), and repo_freeallrepos().
Definition at line 144 of file pool.c.
References _Pool::installed, and pool_freewhatprovides().
static int pool_shrink_whatprovides_sortcmp | ( | const void * | ap, | |
const void * | bp, | |||
void * | dp | |||
) | [static] |
Definition at line 153 of file pool.c.
References _Pool::whatprovides, and _Pool::whatprovidesdata.
Referenced by pool_shrink_whatprovides().
static void pool_shrink_whatprovides | ( | Pool * | pool | ) | [static] |
Definition at line 183 of file pool.c.
References _Stringpool::nstrings, POOL_DEBUG, pool_shrink_whatprovides_sortcmp(), SAT_DEBUG_STATS, sat_free(), sat_malloc2(), sat_realloc(), sat_sort(), _Pool::ss, _Pool::whatprovides, _Pool::whatprovidesdata, _Pool::whatprovidesdataleft, and _Pool::whatprovidesdataoff.
Referenced by pool_createwhatprovides().
void pool_createwhatprovides | ( | Pool * | pool | ) |
Prepares a pool for solving.
Definition at line 268 of file pool.c.
References _Repo::disabled, GETRELDEP, _Repo::idarraydata, _Pool::installed, ISRELDEP, _Reldep::name, _Pool::nrels, _Pool::nsolvables, _Stringpool::nstrings, POOL_DEBUG, pool_freeidhashes(), pool_freewhatprovides(), pool_installable(), pool_shrink_whatprovides(), _Solvable::provides, _Solvable::repo, sat_calloc(), sat_calloc_block(), SAT_DEBUG_STATS, sat_timems(), _Pool::solvables, _Pool::ss, _Pool::whatprovides, WHATPROVIDES_BLOCK, _Pool::whatprovides_rel, _Pool::whatprovidesdata, _Pool::whatprovidesdataleft, and _Pool::whatprovidesdataoff.
Referenced by solver_solve().
void pool_freewhatprovides | ( | Pool * | pool | ) |
Definition at line 378 of file pool.c.
References sat_free(), _Pool::whatprovides, _Pool::whatprovides_rel, _Pool::whatprovidesdata, _Pool::whatprovidesdataleft, and _Pool::whatprovidesdataoff.
Referenced by pool_add_fileconflicts_deps(), pool_addfileprovides_ids(), pool_createwhatprovides(), pool_free(), pool_set_installed(), repo_create(), repo_empty(), and repo_freeallrepos().
Definition at line 400 of file pool.c.
References _Queue::count, _Queue::elements, POOL_DEBUG, SAT_DEBUG_STATS, sat_realloc(), _Pool::whatprovidesdata, _Pool::whatprovidesdataleft, and _Pool::whatprovidesdataoff.
Referenced by analyze(), makemultiversionconflict(), pool_addrelproviders(), solver_addchoicerules(), solver_addupdaterule(), and solver_solve().
Definition at line 442 of file pool.c.
References _Solvable::arch, _Solvable::evr, _Reldep::evr, evrcmp(), EVRCMP_DEPCMP, _Reldep::flags, GETRELDEP, _Reldep::name, pool_match_nevr(), REL_AND, REL_ARCH, REL_OR, and REL_WITH.
Referenced by pool_addrelproviders(), and pool_match_nevr().
static int pool_match_flags_evr | ( | Pool * | pool, | |
int | pflags, | |||
Id | pevr, | |||
int | flags, | |||
int | evr | |||
) | [inline, static] |
Definition at line 487 of file pool.c.
References evrcmp(), and EVRCMP_DEPCMP.
Referenced by pool_addrelproviders(), and pool_match_dep().
Definition at line 512 of file pool.c.
References _Reldep::evr, _Reldep::flags, GETRELDEP, ISRELDEP, _Reldep::name, pool_match_dep(), and pool_match_flags_evr().
Referenced by pool_match_dep().
Definition at line 547 of file pool.c.
References _Solvable::arch, _Queue::count, dep2str(), _Reldep::evr, _Reldep::flags, GETRELDEP, GETRELID, id2str(), _Repo::idarraydata, ISRELDEP, MAKERELDEP, _Solvable::name, _Reldep::name, _Pool::nscallback, _Pool::nscallbackdata, POOL_DEBUG, pool_match_flags_evr(), pool_match_nevr(), pool_match_nevr_rel(), pool_queuetowhatprovides(), pool_whatprovides(), pool_whatprovides_ptr(), _Solvable::provides, queue_free(), queue_init_buffer(), queue_push(), queue_pushunique(), REL_AND, REL_ARCH, REL_FILECONFLICT, REL_NAMESPACE, REL_OR, REL_WITH, _Solvable::repo, SAT_DEBUG_STATS, _Pool::solvables, SYSTEMSOLVABLE, _Pool::whatprovides_rel, and _Pool::whatprovidesdata.
Referenced by pool_whatprovides().
void pool_debug | ( | Pool * | pool, | |
int | type, | |||
const char * | format, | |||
... | ||||
) |
Definition at line 739 of file pool.c.
References _Pool::debugcallback, _Pool::debugcallbackdata, _Pool::debugmask, SAT_DEBUG_TO_STDERR, SAT_ERROR, and SAT_FATAL.
Referenced by data_read_id_max(), data_read_idarray(), data_read_rel_idarray(), incore_map_idarray(), read_id(), read_idarray(), read_u32(), read_u8(), repo_add_solv_flags(), repodata_internalize(), and repodata_serialize_key().
void pool_setdebuglevel | ( | Pool * | pool, | |
int | level | |||
) |
Definition at line 763 of file pool.c.
References _Pool::debugmask, SAT_DEBUG_ANALYZE, SAT_DEBUG_JOB, SAT_DEBUG_POLICY, SAT_DEBUG_PROPAGATE, SAT_DEBUG_RESULT, SAT_DEBUG_RULE_CREATION, SAT_DEBUG_SCHUBI, SAT_DEBUG_SOLUTIONS, SAT_DEBUG_SOLVER, SAT_DEBUG_STATS, SAT_DEBUG_TO_STDERR, SAT_DEBUG_TRANSACTION, and SAT_DEBUG_UNSOLVABLE.
static void pool_addfileprovides_dep | ( | Pool * | pool, | |
Id * | ida, | |||
struct searchfiles * | sf, | |||
struct searchfiles * | isf | |||
) | [static] |
Definition at line 793 of file pool.c.
References searchfiles::dirs, _Reldep::evr, _Reldep::flags, GETRELDEP, GETRELID, id2str(), searchfiles::ids, ISRELDEP, MAPSET, MAPTST, _Reldep::name, searchfiles::names, searchfiles::nfiles, _Stringpool::nstrings, REL_FILECONFLICT, REL_NAMESPACE, sat_extend(), sat_malloc(), SEARCHFILES_BLOCK, searchfiles::seen, and _Pool::ss.
Referenced by pool_addfileprovides_ids().
static int addfileprovides_cb | ( | void * | cbdata, | |
Solvable * | s, | |||
Repodata * | data, | |||
Repokey * | key, | |||
KeyValue * | value | |||
) | [static] |
Definition at line 879 of file pool.c.
References addfileprovides_cbdata::dids, _Repodata::dirpool, addfileprovides_cbdata::dirs, _KeyValue::id, addfileprovides_cbdata::ids, map_init(), MAPSET, MAPTST, addfileprovides_cbdata::names, _Dirpool::ndirs, addfileprovides_cbdata::nfiles, addfileprovides_cbdata::providedids, _Solvable::provides, _Solvable::repo, repo_addid_dep(), repodata_str2dir(), _Map::size, _KeyValue::str, and addfileprovides_cbdata::useddirs.
Referenced by pool_addfileprovides_search().
static void pool_addfileprovides_search | ( | Pool * | pool, | |
struct addfileprovides_cbdata * | cbd, | |||
struct searchfiles * | sf, | |||
Repo * | repoonly | |||
) | [static] |
Definition at line 917 of file pool.c.
References addfileprovides_cb(), _Queue::count, addfileprovides_cbdata::dids, searchfiles::dirs, addfileprovides_cbdata::dirs, _Repo::disabled, _Queue::elements, _Repodata::end, id2str(), searchfiles::ids, addfileprovides_cbdata::ids, _Repodata::keys, map_empty(), map_free(), map_init(), MAPSET, MAPTST, _Repokey::name, searchfiles::names, addfileprovides_cbdata::names, searchfiles::nfiles, addfileprovides_cbdata::nfiles, _Repodata::nkeys, _Pool::nrepos, _Repo::nsolvables, _Pool::nsolvables, _Stringpool::nstrings, addfileprovides_cbdata::providedids, queue_free(), queue_init(), _Solvable::repo, _Repo::repodata, REPODATA_AVAILABLE, repodata_filelistfilter_matches(), repodata_has_keyname(), repodata_lookup_idarray(), repodata_search(), _Pool::repos, sat_realloc2(), _Pool::solvables, SOLVID_META, _Pool::ss, _Repodata::start, _Repodata::state, and addfileprovides_cbdata::useddirs.
Referenced by pool_addfileprovides_ids().
Definition at line 1041 of file pool.c.
References _Solvable::conflicts, addfileprovides_cbdata::dids, searchfiles::dirs, _Solvable::enhances, id2str(), _Repo::idarraydata, searchfiles::ids, map_free(), map_init(), searchfiles::names, searchfiles::nfiles, _Pool::nrels, _Stringpool::nstrings, _Solvable::obsoletes, pool_addfileprovides_dep(), pool_addfileprovides_search(), POOL_DEBUG, pool_freewhatprovides(), _Solvable::recommends, _Solvable::repo, _Solvable::requires, SAT_DEBUG_STATS, sat_extend(), sat_free(), sat_timems(), SEARCHFILES_BLOCK, searchfiles::seen, _Pool::solvables, _Pool::ss, _Solvable::suggests, and _Solvable::supplements.
Referenced by pool_addfileprovides().
void pool_addfileprovides | ( | Pool * | pool | ) |
Definition at line 1129 of file pool.c.
References _Pool::installed, and pool_addfileprovides_ids().
void pool_search | ( | Pool * | pool, | |
Id | p, | |||
Id | key, | |||
const char * | match, | |||
int | flags, | |||
int(*)(void *cbdata, Solvable *s, struct _Repodata *data, struct _Repokey *key, struct _KeyValue *kv) | callback, | |||
void * | cbdata | |||
) |
Definition at line 1135 of file pool.c.
References _Pool::nsolvables, _Solvable::repo, repo_search(), and _Pool::solvables.
void pool_clear_pos | ( | Pool * | pool | ) |
Definition at line 1150 of file pool.c.
References _Pool::pos.
Referenced by dataiterator_setpos(), dataiterator_setpos_parent(), and repodata_setpos_kv().
void pool_set_languages | ( | Pool * | pool, | |
const char ** | languages, | |||
int | nlanguages | |||
) |
Definition at line 1157 of file pool.c.
References _Pool::languagecache, _Pool::languagecacheother, _Pool::languages, _Pool::nlanguages, sat_calloc(), and sat_free().
Definition at line 1178 of file pool.c.
References id2str(), sat_malloc(), and str2id().
Referenced by solvable_lookup_str_lang(), and solvable_lookup_str_poollang().
char* pool_alloctmpspace | ( | Pool * | pool, | |
int | len | |||
) |
Definition at line 1200 of file pool.c.
References POOL_TMPSPACEBUF, sat_realloc(), _Pool::tmpspacebuf, _Pool::tmpspacelen, and _Pool::tmpspacen.
Referenced by dep2str(), pool_tmpjoin(), repodata_chk2str(), repodata_dir2str(), solvable2str(), solvable_get_location(), and solver_select2str().
char* pool_tmpjoin | ( | Pool * | pool, | |
const char * | str1, | |||
const char * | str2, | |||
const char * | str3 | |||
) |
Definition at line 1215 of file pool.c.
References pool_alloctmpspace().
static int solver_fill_DU_cb | ( | void * | cbdata, | |
Solvable * | s, | |||
Repodata * | data, | |||
Repokey * | key, | |||
KeyValue * | value | |||
) | [static] |
Definition at line 1266 of file pool.c.
References ducbdata::addsub, mptree::child, ducbdata::dirmap, _Repodata::dirpool, _Dirpool::dirs, _DUChanges::files, ducbdata::hasdu, _KeyValue::id, id2str(), _DUChanges::kbytes, _Repodata::localpool, mptree::mountpoint, ducbdata::mps, ducbdata::mptree, _Dirpool::ndirs, ducbdata::nmap, _KeyValue::num, _KeyValue::num2, ducbdata::olddata, _Repo::pool, _Repodata::repo, sat_calloc(), sat_free(), mptree::sibling, _Repodata::spool, and stringpool_id2str().
Referenced by pool_calc_duchanges().
Definition at line 1343 of file pool.c.
References mptree::child, mptree::mountpoint, and mptree::sibling.
Referenced by pool_calc_duchanges().
Definition at line 1357 of file pool.c.
References ducbdata::addsub, mptree::child, mptree::comp, mptree::compl, ducbdata::dirmap, _Repo::end, _DUChanges::files, FOR_PROVIDES, FOR_REPO_SOLVABLES, ducbdata::hasdu, _Pool::installed, _DUChanges::kbytes, _Map::map, map_free(), map_init(), MAPSET, MAPTST, mptree::mountpoint, ducbdata::mps, ducbdata::mptree, MPTREE_BLOCK, _Solvable::name, ducbdata::nmap, ducbdata::olddata, _DUChanges::path, propagate_mountpoints(), repo_search(), sat_extend(), sat_extend_resize(), sat_free(), mptree::sibling, _Pool::solvables, solver_fill_DU_cb(), and _Repo::start.
Referenced by solver_calc_duchanges(), and transaction_calc_duchanges().
Definition at line 1496 of file pool.c.
References FOR_REPO_SOLVABLES, _Pool::installed, MAPTST, _Solvable::repo, solvable_lookup_num(), and _Pool::solvables.
Referenced by solver_calc_installsizechange(), and transaction_calc_installsizechange().
Definition at line 1530 of file pool.c.
References GETRELDEP, ISRELDEP, and _Reldep::name.
Referenced by pool_trivial_installable_noobsoletesmap().
static int providedbyinstalled_multiversion | ( | Pool * | pool, | |
unsigned char * | map, | |||
Id | n, | |||
Id | con | |||
) | [static] |
Definition at line 1540 of file pool.c.
References _Solvable::arch, FOR_PROVIDES, _Solvable::name, pool_match_nevr(), and _Pool::solvables.
Referenced by providedbyinstalled().
static int providedbyinstalled | ( | Pool * | pool, | |
unsigned char * | map, | |||
Id | dep, | |||
int | ispatch, | |||
Map * | noobsoletesmap | |||
) | [inline, static] |
Definition at line 1559 of file pool.c.
References FOR_PROVIDES, ISRELDEP, MAPTST, pool_match_nevr(), providedbyinstalled_multiversion(), _Map::size, _Pool::solvables, and SYSTEMSOLVABLE.
Referenced by pool_trivial_installable_noobsoletesmap().
void pool_trivial_installable_noobsoletesmap | ( | Pool * | pool, | |
Map * | installedmap, | |||
Queue * | pkgs, | |||
Queue * | res, | |||
Map * | noobsoletesmap | |||
) |
Definition at line 1591 of file pool.c.
References _Solvable::conflicts, _Queue::count, dep2name(), _Queue::elements, FOR_PROVIDES, id2str(), _Repo::idarraydata, ISRELDEP, MAPTST, _Solvable::name, _Pool::nsolvables, _Solvable::obsoletes, pool_whatprovides_ptr(), providedbyinstalled(), queue_free(), queue_init_clone(), _Solvable::repo, _Solvable::requires, sat_calloc(), and _Pool::solvables.
Referenced by pool_trivial_installable(), and solver_trivial_installable().
Definition at line 1732 of file pool.c.
References pool_trivial_installable_noobsoletesmap().
Definition at line 1738 of file pool.c.
References _Pool::pos, _Repopos::repo, _Repo::repodata, repodata_lookup_str(), _Repopos::repodataid, solvable_lookup_str(), _Pool::solvables, and SOLVID_POS.
Definition at line 1748 of file pool.c.
References _Repodata::localpool, _Pool::pos, _Repopos::repo, _Repo::repodata, repodata_globalize_id(), repodata_lookup_id(), _Repopos::repodataid, solvable_lookup_id(), _Pool::solvables, and SOLVID_POS.
Definition at line 1762 of file pool.c.
References _Pool::pos, _Repopos::repo, _Repo::repodata, repodata_lookup_num(), _Repopos::repodataid, solvable_lookup_num(), _Pool::solvables, and SOLVID_POS.
Definition at line 1777 of file pool.c.
References _Pool::pos, _Repopos::repo, _Repo::repodata, repodata_lookup_void(), _Repopos::repodataid, solvable_lookup_void(), _Pool::solvables, and SOLVID_POS.
Definition at line 1787 of file pool.c.
References _Pool::pos, _Repopos::repo, _Repo::repodata, repodata_lookup_bin_checksum(), _Repopos::repodataid, solvable_lookup_bin_checksum(), _Pool::solvables, and SOLVID_POS.
Definition at line 1797 of file pool.c.
References _Pool::pos, _Repopos::repo, _Repo::repodata, repodata_chk2str(), repodata_lookup_bin_checksum(), _Repopos::repodataid, solvable_lookup_checksum(), _Pool::solvables, and SOLVID_POS.
Definition at line 1810 of file pool.c.
References _Solvable::conflicts, _Queue::count, _Queue::elements, pool_freeidhashes(), pool_freewhatprovides(), _Solvable::provides, rel2id(), REL_FILECONFLICT, _Pool::relhashtbl, _Solvable::repo, repo_addid_dep(), and _Pool::solvables.