extern int pool_evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode);
extern int pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release);
-/* obsolete, do not use in new code */
-#ifdef OBSOLETE_INTERFACE
-static inline int vercmp(const char *s1, const char *q1, const char *s2, const char *q2)
-{
- return sat_vercmp(s1, q1, s2, q2);
-}
-static inline int evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode)
-{
- return pool_evrcmp_str(pool, evr1, evr2, mode);
-}
-static inline int evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode)
-{
- return pool_evrcmp(pool, evr1id, evr2id, mode);
-}
-static inline int evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release)
-{
- return pool_evrmatch(pool, evrid, epoch, version, release);
-}
-#endif
-
#ifdef __cplusplus
}
#endif
policy_illegal_vendorchange;
policy_is_illegal;
pool_add_fileconflicts_deps;
- pool_add_solvable;
- pool_add_solvable_block;
pool_addfileprovides;
pool_addfileprovides_ids;
pool_addrelproviders;
pool_evrcmp_str;
pool_evrmatch;
pool_free;
- pool_free_solvable_block;
pool_freeidhashes;
pool_freetmpspace;
pool_freewhatprovides;
solver_printtrivial;
solver_printwatches;
solver_problem_count;
- solver_problemruleinfo;
solver_problemruleinfo2str;
solver_ruleinfo;
solver_samerule;
return pool_solvable2str(pool, pool->solvables + p);
}
-/* obsolete, do not use anymore */
-#ifdef OBSOLETE_INTERFACE
-static inline const char *solvable2str(Pool *pool, Solvable *s)
-{
- return pool_solvable2str(pool, s);
-}
-static inline const char *solvid2str(Pool *pool, Id p)
-{
- return pool_solvable2str(pool, pool->solvables + p);
-}
-#endif
-
void pool_set_languages(Pool *pool, const char **languages, int nlanguages);
Id pool_id2langid(Pool *pool, Id id, const char *lang, int create);
extern void pool_shrink_rels(Pool *pool);
extern void pool_freeidhashes(Pool *pool);
-
-/* deprecated names, do not use in new code */
-#ifdef OBSOLETE_INTERFACE
-static inline Id str2id(Pool *pool, const char *str, int create)
-{
- return pool_str2id(pool, str, create);
-}
-static inline Id strn2id(Pool *pool, const char *str, unsigned int len, int create)
-{
- return pool_strn2id(pool, str, len, create);
-}
-static inline Id rel2id(Pool *pool, Id name, Id evr, int flags, int create)
-{
- return pool_rel2id(pool, name, evr, flags, create);
-}
-static inline const char *id2str(const Pool *pool, Id id)
-{
- return pool_id2str(pool, id);
-}
-static inline const char *id2rel(const Pool *pool, Id id)
-{
- return pool_id2rel(pool, id);
-}
-static inline const char *id2evr(const Pool *pool, Id id)
-{
- return pool_id2evr(pool, id);
-}
-static inline const char *dep2str(Pool *pool, Id id)
-{
- return pool_dep2str(pool, id);
-}
-#endif
-
#endif /* LIBSOLV_POOLID_H */
findallproblemrules_internal(solv, solv->problems.elements[2 * problem - 2], rules);
}
-/* obsolete function */
-SolverRuleinfo
-solver_problemruleinfo(Solver *solv, Queue *job, Id rid, Id *depp, Id *sourcep, Id *targetp)
-{
- return solver_ruleinfo(solv, rid, sourcep, targetp, depp);
-}
-
/* EOF */
{
if (analyze_unsolvable(solv, r, disablerules))
continue;
- queue_free(&dq);
- queue_free(&dqs);
- return;
+ level = 0;
+ break; /* unsolvable */
}
}
olevel = level;
level = selectandinstall(solv, level, &dq, disablerules, i);
if (level == 0)
- {
- queue_free(&dq);
- queue_free(&dqs);
- return;
- }
+ break;
if (level <= olevel)
break;
}
+ if (level == 0)
+ break; /* unsolvable */
systemlevel = level + 1;
if (i < solv->jobrules_end)
continue;
level = setpropagatelearn(solv, level, i, disablerules, r - solv->rules);
}
if (level == 0)
- {
- queue_free(&dq);
- queue_free(&dqs);
- return;
- }
+ break;
if (level <= olevel)
{
if (level == 1 || level < passlevel)
n = installed->start; /* redo all */
i--;
n--;
- continue; /* retry with learnt rule */
+ continue; /* retry with learnt rule */
}
}
}
}
installedpos = installed->start; /* reset installedpos */
}
+ if (level == 0)
+ break; /* unsolvable */
systemlevel = level + 1;
if (pass < 2)
continue; /* had trouble, retry */
olevel = level;
level = selectandinstall(solv, level, &dq, disablerules, r - solv->rules);
if (level == 0)
- {
- queue_free(&dq);
- queue_free(&dqs);
- return;
- }
+ break; /* unsolvable */
if (level < systemlevel || level == 1)
break; /* trouble */
/* something changed, so look at all rules again */
n = 0;
}
- if (n != solv->nrules) /* ran into trouble, restart */
- continue;
+ if (n != solv->nrules) /* ran into trouble? */
+ {
+ if (level == 0)
+ break; /* unsolvable */
+ continue; /* start over */
+ }
/* at this point we have a consistent system. now do the extras... */
+ solv->decisioncnt_weak = solv->decisionq.count;
if (doweak)
{
int qcount;
POOL_DEBUG(SAT_DEBUG_POLICY, "installing recommended %s\n", pool_solvid2str(pool, p));
queue_push(&solv->recommendations, p);
level = setpropagatelearn(solv, level, p, 0, 0);
+ if (level == 0)
+ break;
continue; /* back to main loop */
}
if (i < dqs.count || solv->decisionq.count < decisioncount)
{
map_free(&dqmap);
+ if (level == 0)
+ break;
continue;
}
break; /* had a problem above, quit loop */
}
map_free(&dqmap);
-
+ if (level == 0)
+ break;
continue; /* back to main loop so that all deps are checked */
}
}
- if (solv->dupmap_all && solv->installed)
+ solv->decisioncnt_orphan = solv->decisionq.count;
+ if (solv->dupmap_all && solv->installed)
{
int installedone = 0;
if (level < olevel)
break;
}
+ if (level == 0)
+ break;
if (installedone || i < solv->orphaned.count)
- continue; /* back to main loop */
+ {
+ if (level == 0)
+ break;
+ continue; /* back to main loop */
+ }
for (i = 0; i < solv->orphaned.count; i++)
{
p = solv->orphaned.elements[i];
break;
}
if (i < solv->orphaned.count)
- continue; /* back to main loop */
+ {
+ if (level == 0)
+ break;
+ continue; /* back to main loop */
+ }
}
if (solv->solution_callback)
assert(why >= 0);
level = setpropagatelearn(solv, level, p, disablerules, why);
if (level == 0)
- {
- queue_free(&dq);
- queue_free(&dqs);
- return;
- }
+ break;
continue;
}
/* all branches done, we're finally finished */
break;
}
- /* minimization step */
+ /* auto-minimization step */
if (solv->branches.count)
{
int l = 0, lasti = -1, lastl = -1;
olevel = level;
level = setpropagatelearn(solv, level, p, disablerules, why);
if (level == 0)
- {
- queue_free(&dq);
- queue_free(&dqs);
- return;
- }
+ break;
continue; /* back to main loop */
}
}
POOL_DEBUG(SAT_DEBUG_STATS, "done solving.\n\n");
queue_free(&dq);
queue_free(&dqs);
+ if (level == 0)
+ {
+ /* unsolvable */
+ solv->decisioncnt_weak = solv->decisionq.count;
+ solv->decisioncnt_orphan = solv->decisionq.count;
+ }
#if 0
solver_printdecisionq(solv, SAT_DEBUG_RESULT);
#endif
* > 0: level of decision when installed,
* < 0: level of decision when conflict */
+ int decisioncnt_weak;
+ int decisioncnt_orphan;
+
/* learnt rule history */
Queue learnt_why;
Queue learnt_pool;
#define SOLVER_SETMASK 0x2f000000
-/* old API compatibility, do not use in new code */
-#ifdef OBSOLETE_INTERFACE
-
-#define SOLVER_INSTALL_SOLVABLE (SOLVER_INSTALL|SOLVER_SOLVABLE)
-#define SOLVER_ERASE_SOLVABLE (SOLVER_ERASE|SOLVER_SOLVABLE)
-#define SOLVER_INSTALL_SOLVABLE_NAME (SOLVER_INSTALL|SOLVER_SOLVABLE_NAME)
-#define SOLVER_ERASE_SOLVABLE_NAME (SOLVER_ERASE|SOLVER_SOLVABLE_NAME)
-#define SOLVER_INSTALL_SOLVABLE_PROVIDES (SOLVER_INSTALL|SOLVER_SOLVABLE_PROVIDES)
-#define SOLVER_ERASE_SOLVABLE_PROVIDES (SOLVER_ERASE|SOLVER_SOLVABLE_PROVIDES)
-#define SOLVER_INSTALL_SOLVABLE_UPDATE (SOLVER_UPDATE|SOLVER_SOLVABLE)
-#define SOLVER_INSTALL_SOLVABLE_ONE_OF (SOLVER_INSTALL|SOLVER_SOLVABLE_ONE_OF)
-#define SOLVER_WEAKEN_SOLVABLE_DEPS (SOLVER_WEAKENDEPS|SOLVER_SOLVABLE)
-#define SOLVER_NOOBSOLETES_SOLVABLE (SOLVER_NOOBSOLETES|SOLVER_SOLVABLE)
-#define SOLVER_NOOBSOLETES_SOLVABLE_NAME (SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME)
-#define SOLVER_NOOBSOLETES_SOLVABLE_PROVIDES (SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_PROVIDES)
-
-/* backward compatibility */
-#define SOLVER_PROBLEM_UPDATE_RULE SOLVER_RULE_UPDATE
-#define SOLVER_PROBLEM_JOB_RULE SOLVER_RULE_JOB
-#define SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP
-#define SOLVER_PROBLEM_NOT_INSTALLABLE SOLVER_RULE_RPM_NOT_INSTALLABLE
-#define SOLVER_PROBLEM_NOTHING_PROVIDES_DEP SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP
-#define SOLVER_PROBLEM_SAME_NAME SOLVER_RULE_RPM_SAME_NAME
-#define SOLVER_PROBLEM_PACKAGE_CONFLICT SOLVER_RULE_RPM_PACKAGE_CONFLICT
-#define SOLVER_PROBLEM_PACKAGE_OBSOLETES SOLVER_RULE_RPM_PACKAGE_OBSOLETES
-#define SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE SOLVER_RULE_RPM_PACKAGE_REQUIRES
-#define SOLVER_PROBLEM_SELF_CONFLICT SOLVER_RULE_RPM_SELF_CONFLICT
-#define SOLVER_PROBLEM_RPM_RULE SOLVER_RULE_RPM
-#define SOLVER_PROBLEM_DISTUPGRADE_RULE SOLVER_RULE_DISTUPGRADE
-#define SOLVER_PROBLEM_INFARCH_RULE SOLVER_RULE_INFARCH
-
-#endif
-
-
extern Solver *solver_create(Pool *pool);
extern void solver_free(Solver *solv);
extern int solver_solve(Solver *solv, Queue *job);
* > 0: level of decision when installed,
* < 0: level of decision when conflict */
+ int decisioncnt_weak;
+ int decisioncnt_orphan;
+
/* learnt rule history */
Queue learnt_why;
Queue learnt_pool;