satsolver  0.17.2
Classes | Macros | Functions
pool.c File Reference
#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
 

Macros

#define SOLVABLE_BLOCK   255
 
#define KNOWNID_INITIALIZE
 
#define EVRCMP_DEPCMP   EVRCMP_MATCH_RELEASE
 
#define SEARCHFILES_BLOCK   127
 
#define MPTREE_BLOCK   15
 

Functions

Poolpool_create (void)
 Creates a new pool. More...
 
void pool_free (Pool *pool)
 Delete a pool. More...
 
Id pool_add_solvable (Pool *pool)
 Solvable management. More...
 
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. More...
 
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)
 
static char * pool_alloctmpspace_free (Pool *pool, const char *space, int len)
 
void pool_freetmpspace (Pool *pool, const char *space)
 
char * pool_tmpjoin (Pool *pool, const char *str1, const char *str2, const char *str3)
 
char * pool_tmpappend (Pool *pool, const char *str1, const char *str2, const char *str3)
 
const char * pool_bin2hex (Pool *pool, const unsigned char *buf, int len)
 
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)
 

Macro Definition Documentation

#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 KNOWNID_INITIALIZE

Definition at line 32 of file pool.c.

#define EVRCMP_DEPCMP   EVRCMP_MATCH_RELEASE

Definition at line 441 of file pool.c.

Referenced by pool_match_flags_evr(), and pool_match_nevr_rel().

#define SEARCHFILES_BLOCK   127

Definition at line 805 of file pool.c.

Referenced by pool_addfileprovides_dep(), and pool_addfileprovides_ids().

#define MPTREE_BLOCK   15

Definition at line 1451 of file pool.c.

Referenced by pool_calc_duchanges().

Function Documentation

Pool* pool_create ( void  )
void pool_free ( Pool pool)
Id pool_add_solvable ( Pool pool)

Solvable management.

Definition at line 114 of file pool.c.

References _Pool::nsolvables, sat_extend(), SOLVABLE_BLOCK, and _Pool::solvables.

Referenced by repo_add_solvable().

Id pool_add_solvable_block ( Pool pool,
int  count 
)

Definition at line 122 of file pool.c.

References _Pool::nsolvables, sat_extend(), SOLVABLE_BLOCK, and _Pool::solvables.

Referenced by repo_add_solvable_block().

void pool_free_solvable_block ( Pool pool,
Id  start,
int  count,
int  reuseids 
)

Definition at line 134 of file pool.c.

References _Pool::nsolvables, and _Pool::solvables.

Referenced by repo_empty(), repo_free_solvable_block(), and repo_freeallrepos().

void pool_set_installed ( Pool pool,
Repo installed 
)

Definition at line 149 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 158 of file pool.c.

References _Pool::whatprovides, and _Pool::whatprovidesdata.

Referenced by pool_shrink_whatprovides().

static void pool_shrink_whatprovides ( Pool pool)
static
void pool_createwhatprovides ( Pool pool)
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 
)
inlinestatic

Definition at line 492 of file pool.c.

References evrcmp(), and EVRCMP_DEPCMP.

Referenced by pool_addrelproviders(), and pool_match_dep().

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
static int addfileprovides_cb ( void *  cbdata,
Solvable s,
Repodata data,
Repokey key,
KeyValue value 
)
static
static void pool_addfileprovides_search ( Pool pool,
struct addfileprovides_cbdata cbd,
struct searchfiles sf,
Repo repoonly 
)
static
void pool_addfileprovides_ids ( Pool pool,
Repo installed,
Id **  idp 
)
void pool_addfileprovides ( Pool pool)

Definition at line 1144 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 1150 of file pool.c.

References _Pool::nsolvables, _Solvable::repo, repo_search(), and _Pool::solvables.

void pool_clear_pos ( Pool pool)

Definition at line 1165 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 
)
Id pool_id2langid ( Pool pool,
Id  id,
const char *  lang,
int  create 
)

Definition at line 1193 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 
)
static char* pool_alloctmpspace_free ( Pool pool,
const char *  space,
int  len 
)
static
void pool_freetmpspace ( Pool pool,
const char *  space 
)

Definition at line 1256 of file pool.c.

References _Pool_tmpspace::buf, _Pool_tmpspace::n, POOL_TMPSPACEBUF, and _Pool::tmpspace.

Referenced by solver_select2str().

char* pool_tmpjoin ( Pool pool,
const char *  str1,
const char *  str2,
const char *  str3 
)
char* pool_tmpappend ( Pool pool,
const char *  str1,
const char *  str2,
const char *  str3 
)
const char* pool_bin2hex ( Pool pool,
const unsigned char *  buf,
int  len 
)

Definition at line 1330 of file pool.c.

References pool_alloctmpspace(), and sat_bin2hex().

Referenced by repo_lookup_checksum(), repodata_chk2str(), and solvable_lookup_checksum().

static int solver_fill_DU_cb ( void *  cbdata,
Solvable s,
Repodata data,
Repokey key,
KeyValue value 
)
static
static void propagate_mountpoints ( struct mptree mptree,
int  pos,
Id  mountpoint 
)
static

Definition at line 1440 of file pool.c.

References mptree::child, mptree::mountpoint, and mptree::sibling.

Referenced by pool_calc_duchanges().

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 
)
inlinestatic

Definition at line 1627 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 1637 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 
)
inlinestatic
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 
)

Definition at line 1829 of file pool.c.

References pool_trivial_installable_noobsoletesmap().

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 
)