From 3c8ec43e351832f0ca5f2e9dcc1580987c20c79a Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 1 Mar 2012 12:01:53 +0100 Subject: [PATCH] [entropy.client.interfaces.dep] SLOT intersection: alter dependency adding slot Scenario: dependency = dev-lang/python SLOT intersection = enabled available slots = 2.6, 2.7, 3.2 installed slot = 2.7 The SLOT intersection feature worked correctly but in the end dev-lang/python was added to the unsatisfied set because there was a dev-lang/python-2.7 update as well. This results in other dep calculation code to match dev-lang/python against 3.2 instead. The SLOT intersection feature has to reduce the dependency string scope by adding a SLOT suffix (in this case: ":2.7"). This way the correct dependency is eventually pulled in. --- lib/entropy/client/interfaces/dep.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/entropy/client/interfaces/dep.py b/lib/entropy/client/interfaces/dep.py index 0f67ab1cc..fba85f1b5 100644 --- a/lib/entropy/client/interfaces/dep.py +++ b/lib/entropy/client/interfaces/dep.py @@ -688,10 +688,18 @@ class CalculatorsMixin: if installed_slot in available_slots: # restrict my matching to installed_slot, rewrite # r_id r_repo + # NOTE: assume that dependency has no tag nor etp rev + # also, if we got multiple slots, it means that the + # same dep is expressed without slot. old_r_id = r_id old_r_repo = r_repo r_id, r_repo = self.atom_match( dependency, match_slot = installed_slot) + if r_id != -1: + # append slot to dependency + dependency += etpConst['entropyslotprefix'] \ + + installed_slot + if const_debug_enabled(): from_atom = self.open_repository( old_r_repo).retrieveAtom(old_r_id)