summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rules.c9
-rw-r--r--src/solver.c24
-rw-r--r--src/solver.h4
3 files changed, 27 insertions, 10 deletions
diff --git a/src/rules.c b/src/rules.c
index 3ba5a0e..b86ad77 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1246,6 +1246,13 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all)
}
#endif
+ if (!allow_all && !p && solv->dupmap_all)
+ {
+ queue_push(&solv->orphaned, s - pool->solvables); /* an orphaned package */
+ if (solv->keep_orphans)
+ p = s - pool->solvables;
+ }
+
if (!allow_all && qs.count && solv->multiversion.size)
{
int i, j;
@@ -1286,7 +1293,7 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all)
}
if (j == 0 && p == -SYSTEMSOLVABLE && solv->dupmap_all)
{
- queue_push(&solv->orphaned, s - pool->solvables); /* treat as orphaned */
+ queue_push(&solv->orphaned, s - pool->solvables); /* also treat as orphaned */
j = qs.count;
}
qs.count = j;
diff --git a/src/solver.c b/src/solver.c
index f188e3d..054567e 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -1639,6 +1639,10 @@ solver_get_flag(Solver *solv, int flag)
return solv->dup_allowarchchange;
case SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE:
return solv->dup_allowvendorchange;
+ case SOLVER_FLAG_KEEP_ORPHANS:
+ return solv->keep_orphans;
+ case SOLVER_FLAG_BREAK_ORPHANS:
+ return solv->break_orphans;
default:
break;
}
@@ -1702,6 +1706,12 @@ solver_set_flag(Solver *solv, int flag, int value)
case SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE:
solv->dup_allowvendorchange = value;
break;
+ case SOLVER_FLAG_KEEP_ORPHANS:
+ solv->keep_orphans = value;
+ break;
+ case SOLVER_FLAG_BREAK_ORPHANS:
+ solv->break_orphans = value;
+ break;
default:
break;
}
@@ -3574,20 +3584,16 @@ solver_solve(Solver *solv, Queue *job)
* check for and remove duplicate
*/
r = solv->rules + solv->nrules - 1; /* r: update rule */
+ if (!r->p)
+ continue;
sr = r - (installed->end - installed->start); /* sr: feature rule */
- /* it's orphaned if there is no feature rule or the feature rule
- * consists just of the installed package */
- if (!sr->p || (sr->p == i && !sr->d && !sr->w2))
+ /* it's also orphaned if the feature rule consists just of the installed package */
+ if (!solv->dupmap_all && sr->p == i && !sr->d && !sr->w2)
queue_push(&solv->orphaned, i);
- if (!r->p)
- {
- /* assert(solv->dupmap_all && !sr->p); */
- continue;
- }
if (!solver_rulecmp(solv, r, sr))
memset(sr, 0, sizeof(*sr)); /* delete unneeded feature rule */
else
- solver_disablerule(solv, sr); /* disable feature rule */
+ solver_disablerule(solv, sr); /* disable feature rule for now */
}
/* consistency check: we added a rule for _every_ installed solvable */
assert(solv->nrules - solv->updaterules == installed->end - installed->start);
diff --git a/src/solver.h b/src/solver.h
index 81c5f2b..3316e76 100644
--- a/src/solver.h
+++ b/src/solver.h
@@ -185,6 +185,8 @@ struct _Solver {
Queue addedmap_deduceq; /* deduce addedmap from rpm rules */
Id *instbuddy; /* buddies of installed packages */
+ int keep_orphans; /* how to treat orphans */
+ int break_orphans; /* how to treat orphans */
#endif /* LIBSOLV_INTERNAL */
};
@@ -282,6 +284,8 @@ typedef struct _Solver Solver;
#define SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE 15
#define SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE 16
#define SOLVER_FLAG_DUP_ALLOW_NAMECHANGE 17
+#define SOLVER_FLAG_KEEP_ORPHANS 18
+#define SOLVER_FLAG_BREAK_ORPHANS 19
#define GET_USERINSTALLED_NAMES (1 << 0) /* package names instead if ids */
#define GET_USERINSTALLED_INVERTED (1 << 1) /* autoinstalled */