From 307fdff9e12f783b01d0275d92c22b4cf7dd020f Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 10 Aug 2009 14:37:04 +0000 Subject: use set_rejected_and_compute_diff_provides for package removal Patch by Anssi Hannula, fixes bug #52667 k1-1 provides k, but not k1-2 l-1 and l-2 requires k m-1 requires k but not m-2 n requires m User has l-1, m-1, n-1, k1-1. There is only one upgrade path: k1-1 -> k1-2 m-1 -> m-2 removal of l-1 When transaction is created with all of them (e.g. what --auto-select does first), the path is resolved correctly. However, when the upgrade is triggered with the upgrade of k1, and l is in RPM db before n, resolving proceeds as follows: 1. k1 selected and old version rejected 2. l is promoted 3. m is promoted 4. l-2 is therefore selected 5. no packages are found for k (as k1-1 was rejected in step 1) 6. backtrack_selected calls resolve_rejected to reject the chain 7. rejection process rejects l, m, n 8. m-2 is selected because of step 3 End result: n is wrongly removed. Therefore, when using --auto-select (with --split-length 1 --split-level 1 in this small case, to force splitting) to trigger the upgrade, the early resolve is done correctly, but the first splitted transaction ("rpms sorted by dependencies" has k1 and m separately, so split is tried) tries to remove n and URPM fallbacks to single big transaction. In reverse, when using "urpmi k1" to trigger the upgrade, urpmi asks user confirmation for n removal, but the transaction is created with both k1 and m ("rpms sorted by dependencies" has k1+m, so they are put in same transaction), thus triggering the correct behaviour and n is not really removed after all, even if user agreed to it. Attached patch fixes this by switching backtrack_selected() to use set_rejected_and_compute_diff_provides() for package removal instead of resolve_rejected_(). The code already contained a comment indicating that diff_provides code should be applied. The patch introduces no regression in the urpmi and perl-URPM testsuites. --- NEWS | 2 ++ 1 file changed, 2 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 50a827b..2bafaa6 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- backtrack_selected: use set_rejected_and_compute_diff_provides for package + removal (Anssi Hannula) - obey options (keep, nodeps) when unselecting current package in the case that was added in 3.31 (Anssi Hannula) -- cgit v1.2.1