|
Packit Service |
ff689b |
/*
|
|
Packit Service |
ff689b |
* Copyright (c) 2007, Novell Inc.
|
|
Packit Service |
ff689b |
*
|
|
Packit Service |
ff689b |
* This program is licensed under the BSD license, read LICENSE.BSD
|
|
Packit Service |
ff689b |
* for further information
|
|
Packit Service |
ff689b |
*/
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/*
|
|
Packit Service |
ff689b |
* solver.h
|
|
Packit Service |
ff689b |
*
|
|
Packit Service |
ff689b |
*/
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifndef LIBSOLV_SOLVER_H
|
|
Packit Service |
ff689b |
#define LIBSOLV_SOLVER_H
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#include "pooltypes.h"
|
|
Packit Service |
ff689b |
#include "pool.h"
|
|
Packit Service |
ff689b |
#include "repo.h"
|
|
Packit Service |
ff689b |
#include "queue.h"
|
|
Packit Service |
ff689b |
#include "bitmap.h"
|
|
Packit Service |
ff689b |
#include "transaction.h"
|
|
Packit Service |
ff689b |
#include "rules.h"
|
|
Packit Service |
ff689b |
#include "problems.h"
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifdef __cplusplus
|
|
Packit Service |
ff689b |
extern "C" {
|
|
Packit Service |
ff689b |
#endif
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
struct s_Solver {
|
|
Packit Service |
ff689b |
Pool *pool; /* back pointer to pool */
|
|
Packit Service |
ff689b |
Queue job; /* copy of the job we're solving */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
int (*solution_callback)(struct s_Solver *solv, void *data);
|
|
Packit Service |
ff689b |
void *solution_callback_data;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
int pooljobcnt; /* number of pooljob entries in job queue */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifdef LIBSOLV_INTERNAL
|
|
Packit Service |
ff689b |
Repo *installed; /* copy of pool->installed */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* list of rules, ordered
|
|
Packit Service |
ff689b |
* pkg rules first, then features, updates, jobs, learnt
|
|
Packit Service |
ff689b |
* see start/end offsets below
|
|
Packit Service |
ff689b |
*/
|
|
Packit Service |
ff689b |
Rule *rules; /* all rules */
|
|
Packit Service |
ff689b |
Id nrules; /* [Offset] index of the last rule */
|
|
Packit Service |
ff689b |
Id lastpkgrule; /* last package rule we added */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue ruleassertions; /* Queue of all assertion rules */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* start/end offset for rule 'areas' */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id pkgrules_end; /* [Offset] dep rules end */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id featurerules; /* feature rules start/end */
|
|
Packit Service |
ff689b |
Id featurerules_end;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id updaterules; /* policy rules, e.g. keep packages installed or update. All literals > 0 */
|
|
Packit Service |
ff689b |
Id updaterules_end;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id jobrules; /* user rules */
|
|
Packit Service |
ff689b |
Id jobrules_end;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id infarchrules; /* inferior arch rules */
|
|
Packit Service |
ff689b |
Id infarchrules_end;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id duprules; /* dist upgrade rules */
|
|
Packit Service |
ff689b |
Id duprules_end;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id bestrules; /* rules from SOLVER_FORCEBEST */
|
|
Packit Service |
ff689b |
Id bestrules_up; /* update rule part starts here*/
|
|
Packit Service |
ff689b |
Id bestrules_end;
|
|
Packit Service |
ff689b |
Id *bestrules_info; /* < 0 : install rule, > 0 : pkg that needs to be updated */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id yumobsrules; /* rules from yum obsoletes handling */
|
|
Packit Service |
ff689b |
Id yumobsrules_end;
|
|
Packit Service |
ff689b |
Id *yumobsrules_info; /* the dependency for each rule */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id blackrules; /* rules from blacklisted packages */
|
|
Packit Service |
ff689b |
Id blackrules_end;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id choicerules; /* choice rules (always weak) */
|
|
Packit Service |
ff689b |
Id choicerules_end;
|
|
Packit Service |
ff689b |
Id *choicerules_info; /* the rule we used to generate the choice rule */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id recommendsrules; /* rules from recommends pkg rules with disfavored literals */
|
|
Packit Service |
ff689b |
Id recommendsrules_end;
|
|
Packit Service |
ff689b |
Id *recommendsrules_info; /* the original pkg rule rule */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id learntrules; /* learnt rules, (end == nrules) */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map noupdate; /* don't try to update these
|
|
Packit Service |
ff689b |
installed solvables */
|
|
Packit Service |
ff689b |
Map multiversion; /* ignore obsoletes for these (multiinstall) */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map updatemap; /* bring these installed packages to the newest version */
|
|
Packit Service |
ff689b |
int updatemap_all; /* bring all packages to the newest version */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map bestupdatemap; /* create best rule for those packages */
|
|
Packit Service |
ff689b |
int bestupdatemap_all; /* bring all packages to the newest version */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map fixmap; /* fix these packages */
|
|
Packit Service |
ff689b |
int fixmap_all; /* fix all packages */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue weakruleq; /* index into 'rules' for weak ones */
|
|
Packit Service |
ff689b |
Map weakrulemap; /* map rule# to '1' for weak rules, 1..learntrules */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id *watches; /* Array of rule offsets
|
|
Packit Service |
ff689b |
* watches has nsolvables*2 entries and is addressed from the middle
|
|
Packit Service |
ff689b |
* middle-solvable : decision to conflict, offset point to linked-list of rules
|
|
Packit Service |
ff689b |
* middle+solvable : decision to install: offset point to linked-list of rules
|
|
Packit Service |
ff689b |
*/
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue ruletojob; /* index into job queue: jobs for which a rule exits */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* our decisions: */
|
|
Packit Service |
ff689b |
Queue decisionq; /* >0:install, <0:remove/conflict */
|
|
Packit Service |
ff689b |
Queue decisionq_why; /* index of rule, Offset into rules */
|
|
Packit Service |
ff689b |
Queue decisionq_reason; /* reason for decision, indexed by level */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id *decisionmap; /* map for all available solvables,
|
|
Packit Service |
ff689b |
* = 0: undecided
|
|
Packit Service |
ff689b |
* > 0: level of decision when installed,
|
|
Packit Service |
ff689b |
* < 0: level of decision when conflict */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* learnt rule history */
|
|
Packit Service |
ff689b |
Queue learnt_why;
|
|
Packit Service |
ff689b |
Queue learnt_pool;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue branches;
|
|
Packit Service |
ff689b |
int propagate_index; /* index into decisionq for non-propagated decisions */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue problems; /* list of lists of conflicting rules, < 0 for job rules */
|
|
Packit Service |
ff689b |
Queue solutions; /* refined problem storage space */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue orphaned; /* orphaned packages (to be removed?) */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
int stats_learned; /* statistic */
|
|
Packit Service |
ff689b |
int stats_unsolvable; /* statistic */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map recommendsmap; /* recommended packages from decisionmap */
|
|
Packit Service |
ff689b |
Map suggestsmap; /* suggested packages from decisionmap */
|
|
Packit Service |
ff689b |
int recommends_index; /* recommendsmap/suggestsmap is created up to this level */
|
|
Packit Service |
ff689b |
Queue *recommendscplxq;
|
|
Packit Service |
ff689b |
Queue *suggestscplxq;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id *obsoletes; /* obsoletes for each installed solvable */
|
|
Packit Service |
ff689b |
Id *obsoletes_data; /* data area for obsoletes */
|
|
Packit Service |
ff689b |
Id *specialupdaters; /* updaters for packages with a limited update rule */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/*-------------------------------------------------------------------------------------------------------------
|
|
Packit Service |
ff689b |
* Solver configuration
|
|
Packit Service |
ff689b |
*-------------------------------------------------------------------------------------------------------------*/
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
int allowdowngrade; /* allow to downgrade installed solvable */
|
|
Packit Service |
ff689b |
int allownamechange; /* allow to change name of installed solvables */
|
|
Packit Service |
ff689b |
int allowarchchange; /* allow to change architecture of installed solvables */
|
|
Packit Service |
ff689b |
int allowvendorchange; /* allow to change vendor of installed solvables */
|
|
Packit Service |
ff689b |
int allowuninstall; /* allow removal of installed solvables */
|
|
Packit Service |
ff689b |
int noupdateprovide; /* true: update packages needs not to provide old package */
|
|
Packit Service |
ff689b |
int needupdateprovide; /* true: update packages must provide old package */
|
|
Packit Service |
ff689b |
int dosplitprovides; /* true: consider legacy split provides */
|
|
Packit Service |
ff689b |
int dontinstallrecommended; /* true: do not install recommended packages */
|
|
Packit Service |
ff689b |
int addalreadyrecommended; /* true: also install recommended packages that were already recommended by the installed packages */
|
|
Packit Service |
ff689b |
int dontshowinstalledrecommended; /* true: do not show recommended packages that are already installed */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
int noinfarchcheck; /* true: do not forbid inferior architectures */
|
|
Packit Service |
ff689b |
int keepexplicitobsoletes; /* true: honor obsoletes during multiinstall */
|
|
Packit Service |
ff689b |
int bestobeypolicy; /* true: stay in policy with the best rules */
|
|
Packit Service |
ff689b |
int noautotarget; /* true: do not assume targeted for up/dup jobs that contain no installed solvable */
|
|
Packit Service |
ff689b |
int focus_installed; /* true: resolve update rules first */
|
|
Packit Service |
ff689b |
int focus_best; /* true: resolve job dependencies first */
|
|
Packit Service |
ff689b |
int do_yum_obsoletes; /* true: add special yumobs rules */
|
|
Packit Service |
ff689b |
int urpmreorder; /* true: do special urpm package reordering */
|
|
Packit Service |
ff689b |
int strongrecommends; /* true: create weak rules for recommends */
|
|
Packit Service |
ff689b |
int install_also_updates; /* true: do not prune install job rules to installed packages */
|
|
Packit Service |
ff689b |
int only_namespace_recommended; /* true: only install packages recommended by namespace */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
int process_orphans; /* true: do special orphan processing */
|
|
Packit Service |
ff689b |
Map dupmap; /* dup to those packages */
|
|
Packit Service |
ff689b |
Map dupinvolvedmap; /* packages involved in dup process */
|
|
Packit Service |
ff689b |
int dupinvolvedmap_all; /* all packages are involved */
|
|
Packit Service |
ff689b |
int dup_allowdowngrade; /* dup mode: allow to downgrade installed solvable */
|
|
Packit Service |
ff689b |
int dup_allownamechange; /* dup mode: allow to change name of installed solvable */
|
|
Packit Service |
ff689b |
int dup_allowarchchange; /* dup mode: allow to change architecture of installed solvables */
|
|
Packit Service |
ff689b |
int dup_allowvendorchange; /* dup mode: allow to change vendor of installed solvables */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map droporphanedmap; /* packages to drop in dup mode */
|
|
Packit Service |
ff689b |
int droporphanedmap_all;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map cleandepsmap; /* try to drop these packages as of cleandeps erases */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue *ruleinfoq; /* tmp space for solver_ruleinfo() */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue *cleandeps_updatepkgs; /* packages we update in cleandeps mode */
|
|
Packit Service |
ff689b |
Queue *cleandeps_mistakes; /* mistakes we made */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue *update_targets; /* update to specific packages */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue *installsuppdepq; /* deps from the install namespace provides hack */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue addedmap_deduceq; /* deduce addedmap from pkg rules */
|
|
Packit Service |
ff689b |
Id *instbuddy; /* buddies of installed packages */
|
|
Packit Service |
ff689b |
int keep_orphans; /* how to treat orphans */
|
|
Packit Service |
ff689b |
int break_orphans; /* how to treat orphans */
|
|
Packit Service |
ff689b |
Queue *brokenorphanrules; /* broken rules of orphaned packages */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Map allowuninstallmap; /* ok to uninstall those */
|
|
Packit Service |
ff689b |
int allowuninstall_all;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Id *favormap; /* favor job index, > 0: favored, < 0: disfavored */
|
|
Packit Service |
ff689b |
int havedisfavored; /* do we have disfavored packages? */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
int installedpos; /* for resolve_installed */
|
|
Packit Service |
ff689b |
int do_extra_reordering; /* reorder for future installed packages */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue *recommendsruleq; /* pkg rules comming from recommends */
|
|
Packit Service |
ff689b |
#endif /* LIBSOLV_INTERNAL */
|
|
Packit Service |
ff689b |
};
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
typedef struct s_Solver Solver;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/*
|
|
Packit Service |
ff689b |
* queue commands
|
|
Packit Service |
ff689b |
*/
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_SOLVABLE 0x01
|
|
Packit Service |
ff689b |
#define SOLVER_SOLVABLE_NAME 0x02
|
|
Packit Service |
ff689b |
#define SOLVER_SOLVABLE_PROVIDES 0x03
|
|
Packit Service |
ff689b |
#define SOLVER_SOLVABLE_ONE_OF 0x04
|
|
Packit Service |
ff689b |
#define SOLVER_SOLVABLE_REPO 0x05
|
|
Packit Service |
ff689b |
#define SOLVER_SOLVABLE_ALL 0x06
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_SELECTMASK 0xff
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_NOOP 0x0000
|
|
Packit Service |
ff689b |
#define SOLVER_INSTALL 0x0100
|
|
Packit Service |
ff689b |
#define SOLVER_ERASE 0x0200
|
|
Packit Service |
ff689b |
#define SOLVER_UPDATE 0x0300
|
|
Packit Service |
ff689b |
#define SOLVER_WEAKENDEPS 0x0400
|
|
Packit Service |
ff689b |
#define SOLVER_MULTIVERSION 0x0500
|
|
Packit Service |
ff689b |
#define SOLVER_LOCK 0x0600
|
|
Packit Service |
ff689b |
#define SOLVER_DISTUPGRADE 0x0700
|
|
Packit Service |
ff689b |
#define SOLVER_VERIFY 0x0800
|
|
Packit Service |
ff689b |
#define SOLVER_DROP_ORPHANED 0x0900
|
|
Packit Service |
ff689b |
#define SOLVER_USERINSTALLED 0x0a00
|
|
Packit Service |
ff689b |
#define SOLVER_ALLOWUNINSTALL 0x0b00
|
|
Packit Service |
ff689b |
#define SOLVER_FAVOR 0x0c00
|
|
Packit Service |
ff689b |
#define SOLVER_DISFAVOR 0x0d00
|
|
Packit Service |
ff689b |
#define SOLVER_BLACKLIST 0x0e00
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_JOBMASK 0xff00
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_WEAK 0x010000
|
|
Packit Service |
ff689b |
#define SOLVER_ESSENTIAL 0x020000
|
|
Packit Service |
ff689b |
#define SOLVER_CLEANDEPS 0x040000
|
|
Packit Service |
ff689b |
/* ORUPDATE makes SOLVER_INSTALL not prune to installed
|
|
Packit Service |
ff689b |
* packages, thus updating installed packages */
|
|
Packit Service |
ff689b |
#define SOLVER_ORUPDATE 0x080000
|
|
Packit Service |
ff689b |
/* FORCEBEST makes the solver insist on best packages, so
|
|
Packit Service |
ff689b |
* you will get problem reported if the best package is
|
|
Packit Service |
ff689b |
* not installable. This can be used with INSTALL, UPDATE
|
|
Packit Service |
ff689b |
* and DISTUPGRADE */
|
|
Packit Service |
ff689b |
#define SOLVER_FORCEBEST 0x100000
|
|
Packit Service |
ff689b |
/* TARGETED is used in up/dup jobs to make the solver
|
|
Packit Service |
ff689b |
* treat the specified selection as target packages.
|
|
Packit Service |
ff689b |
* It is automatically assumed if the selection does not
|
|
Packit Service |
ff689b |
* contain an "installed" package unless the
|
|
Packit Service |
ff689b |
* NO_AUTOTARGET solver flag is set */
|
|
Packit Service |
ff689b |
#define SOLVER_TARGETED 0x200000
|
|
Packit Service |
ff689b |
/* This (SOLVER_INSTALL) job was automatically added
|
|
Packit Service |
ff689b |
* and thus does not the add to the userinstalled packages */
|
|
Packit Service |
ff689b |
#define SOLVER_NOTBYUSER 0x400000
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_SETEV 0x01000000
|
|
Packit Service |
ff689b |
#define SOLVER_SETEVR 0x02000000
|
|
Packit Service |
ff689b |
#define SOLVER_SETARCH 0x04000000
|
|
Packit Service |
ff689b |
#define SOLVER_SETVENDOR 0x08000000
|
|
Packit Service |
ff689b |
#define SOLVER_SETREPO 0x10000000
|
|
Packit Service |
ff689b |
#define SOLVER_NOAUTOSET 0x20000000
|
|
Packit Service |
ff689b |
#define SOLVER_SETNAME 0x40000000
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_SETMASK 0x7f000000
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* legacy */
|
|
Packit Service |
ff689b |
#define SOLVER_NOOBSOLETES SOLVER_MULTIVERSION
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_UNRELATED 0
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_UNIT_RULE 1
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_KEEP_INSTALLED 2
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_RESOLVE_JOB 3
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_UPDATE_INSTALLED 4
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_CLEANDEPS_ERASE 5
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_RESOLVE 6
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_WEAKDEP 7
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_RESOLVE_ORPHAN 8
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_RECOMMENDED 16
|
|
Packit Service |
ff689b |
#define SOLVER_REASON_SUPPLEMENTED 17
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_ALLOW_DOWNGRADE 1
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_ALLOW_ARCHCHANGE 2
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_ALLOW_VENDORCHANGE 3
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_ALLOW_UNINSTALL 4
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_NO_UPDATEPROVIDE 5
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_SPLITPROVIDES 6
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_IGNORE_RECOMMENDED 7
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_ADD_ALREADY_RECOMMENDED 8
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_NO_INFARCHCHECK 9
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_ALLOW_NAMECHANGE 10
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES 11
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_BEST_OBEY_POLICY 12
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_NO_AUTOTARGET 13
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_DUP_ALLOW_DOWNGRADE 14
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE 15
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE 16
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_DUP_ALLOW_NAMECHANGE 17
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_KEEP_ORPHANS 18
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_BREAK_ORPHANS 19
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_FOCUS_INSTALLED 20
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_YUM_OBSOLETES 21
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_NEED_UPDATEPROVIDE 22
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_URPM_REORDER 23
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_FOCUS_BEST 24
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_STRONG_RECOMMENDS 25
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_INSTALL_ALSO_UPDATES 26
|
|
Packit Service |
ff689b |
#define SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED 27
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define GET_USERINSTALLED_NAMES (1 << 0) /* package names instead of ids */
|
|
Packit Service |
ff689b |
#define GET_USERINSTALLED_INVERTED (1 << 1) /* autoinstalled */
|
|
Packit Service |
ff689b |
#define GET_USERINSTALLED_NAMEARCH (1 << 2) /* package/arch tuples instead of ids */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_ALTERNATIVE_TYPE_RULE 1
|
|
Packit Service |
ff689b |
#define SOLVER_ALTERNATIVE_TYPE_RECOMMENDS 2
|
|
Packit Service |
ff689b |
#define SOLVER_ALTERNATIVE_TYPE_SUGGESTS 3
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern Solver *solver_create(Pool *pool);
|
|
Packit Service |
ff689b |
extern void solver_free(Solver *solv);
|
|
Packit Service |
ff689b |
extern int solver_solve(Solver *solv, Queue *job);
|
|
Packit Service |
ff689b |
extern Transaction *solver_create_transaction(Solver *solv);
|
|
Packit Service |
ff689b |
extern int solver_set_flag(Solver *solv, int flag, int value);
|
|
Packit Service |
ff689b |
extern int solver_get_flag(Solver *solv, int flag);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern int solver_get_decisionlevel(Solver *solv, Id p);
|
|
Packit Service |
ff689b |
extern void solver_get_decisionqueue(Solver *solv, Queue *decisionq);
|
|
Packit Service |
ff689b |
extern int solver_get_lastdecisionblocklevel(Solver *solv);
|
|
Packit Service |
ff689b |
extern void solver_get_decisionblock(Solver *solv, int level, Queue *decisionq);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern void solver_get_orphaned(Solver *solv, Queue *orphanedq);
|
|
Packit Service |
ff689b |
extern void solver_get_recommendations(Solver *solv, Queue *recommendationsq, Queue *suggestionsq, int noselected);
|
|
Packit Service |
ff689b |
extern void solver_get_unneeded(Solver *solv, Queue *unneededq, int filtered);
|
|
Packit Service |
ff689b |
extern void solver_get_userinstalled(Solver *solv, Queue *q, int flags);
|
|
Packit Service |
ff689b |
extern void pool_add_userinstalled_jobs(Pool *pool, Queue *q, Queue *job, int flags);
|
|
Packit Service |
ff689b |
extern void solver_get_cleandeps(Solver *solv, Queue *cleandepsq);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern int solver_describe_decision(Solver *solv, Id p, Id *infop);
|
|
Packit Service |
ff689b |
extern void solver_describe_weakdep_decision(Solver *solv, Id p, Queue *whyq);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern int solver_alternatives_count(Solver *solv);
|
|
Packit Service |
ff689b |
extern int solver_get_alternative(Solver *solv, Id alternative, Id *idp, Id *fromp, Id *chosenp, Queue *choices, int *levelp);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern void solver_calculate_multiversionmap(Pool *pool, Queue *job, Map *multiversionmap);
|
|
Packit Service |
ff689b |
extern void solver_calculate_noobsmap(Pool *pool, Queue *job, Map *multiversionmap); /* obsolete */
|
|
Packit Service |
ff689b |
extern void solver_create_state_maps(Solver *solv, Map *installedmap, Map *conflictsmap);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern void solver_calc_duchanges(Solver *solv, DUChanges *mps, int nmps);
|
|
Packit Service |
ff689b |
extern int solver_calc_installsizechange(Solver *solv);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern void pool_job2solvables(Pool *pool, Queue *pkgs, Id how, Id what);
|
|
Packit Service |
ff689b |
extern int pool_isemptyupdatejob(Pool *pool, Id how, Id what);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern const char *solver_select2str(Pool *pool, Id select, Id what);
|
|
Packit Service |
ff689b |
extern const char *pool_job2str(Pool *pool, Id how, Id what, Id flagmask);
|
|
Packit Service |
ff689b |
extern const char *solver_alternative2str(Solver *solv, int type, Id id, Id from);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* iterate over all literals of a rule */
|
|
Packit Service |
ff689b |
#define FOR_RULELITERALS(l, pp, r) \
|
|
Packit Service |
ff689b |
for (pp = r->d < 0 ? -r->d - 1 : r->d, \
|
|
Packit Service |
ff689b |
l = r->p; l; l = (pp <= 0 ? (pp-- ? 0 : r->w2) : \
|
|
Packit Service |
ff689b |
pool->whatprovidesdata[pp++]))
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* XXX: this currently doesn't work correctly for SOLVER_SOLVABLE_REPO and
|
|
Packit Service |
ff689b |
SOLVER_SOLVABLE_ALL */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* iterate over all packages selected by a job */
|
|
Packit Service |
ff689b |
#define FOR_JOB_SELECT(p, pp, select, what) \
|
|
Packit Service |
ff689b |
if (select == SOLVER_SOLVABLE_REPO || select == SOLVER_SOLVABLE_ALL) \
|
|
Packit Service |
ff689b |
p = pp = 0; \
|
|
Packit Service |
ff689b |
else for (pp = (select == SOLVER_SOLVABLE ? 0 : \
|
|
Packit Service |
ff689b |
select == SOLVER_SOLVABLE_ONE_OF ? what : \
|
|
Packit Service |
ff689b |
pool_whatprovides(pool, what)), \
|
|
Packit Service |
ff689b |
p = (select == SOLVER_SOLVABLE ? what : pool->whatprovidesdata[pp++]); \
|
|
Packit Service |
ff689b |
p ; p = pool->whatprovidesdata[pp++]) \
|
|
Packit Service |
ff689b |
if (select == SOLVER_SOLVABLE_NAME && \
|
|
Packit Service |
ff689b |
pool_match_nevr(pool, pool->solvables + p, what) == 0) \
|
|
Packit Service |
ff689b |
continue; \
|
|
Packit Service |
ff689b |
else
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* weird suse stuff */
|
|
Packit Service |
ff689b |
extern void solver_trivial_installable(Solver *solv, Queue *pkgs, Queue *res);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifdef __cplusplus
|
|
Packit Service |
ff689b |
}
|
|
Packit Service |
ff689b |
#endif
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#endif /* LIBSOLV_SOLVER_H */
|