Fix ProviderIndex.update(), which didn't remove stale providers.
This commit is contained in:
parent
e097696390
commit
19123b4c48
@ -81,7 +81,16 @@ def update(self, spec):
|
|||||||
provider_map[provided_spec] = set()
|
provider_map[provided_spec] = set()
|
||||||
|
|
||||||
if self.restrict:
|
if self.restrict:
|
||||||
provider_map[provided_spec].add(spec)
|
provider_set = provider_map[provided_spec]
|
||||||
|
|
||||||
|
# If this package existed in the index before,
|
||||||
|
# need to take the old versions out, as they're
|
||||||
|
# now more constrained.
|
||||||
|
old = set([s for s in provider_set if s.name == spec.name])
|
||||||
|
provider_set.difference_update(old)
|
||||||
|
|
||||||
|
# Now add the new version.
|
||||||
|
provider_set.add(spec)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Before putting the spec in the map, constrain it so that
|
# Before putting the spec in the map, constrain it so that
|
||||||
|
Loading…
Reference in New Issue
Block a user