summaryrefslogtreecommitdiff
path: root/UpdateManager/Common
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-06 13:09:26 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-06 13:09:26 +0200
commiteafcfb0385b7183f8ad02b4d258549975ed5e350 (patch)
tree1fe3c8aff59a08b5136080e5a6e66996823548c5 /UpdateManager/Common
parent486cca122af72382388c7c194945bec783c04f07 (diff)
downloadpython-apt-eafcfb0385b7183f8ad02b4d258549975ed5e350.tar.gz
* UpdateManager/Common/aptsources.py, tests/test_aptsources.py:
- fix test-case-failure in aptsources.py when compents are added
Diffstat (limited to 'UpdateManager/Common')
-rw-r--r--UpdateManager/Common/aptsources.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py
index b5fa050d..f8ce474b 100644
--- a/UpdateManager/Common/aptsources.py
+++ b/UpdateManager/Common/aptsources.py
@@ -252,6 +252,18 @@ class SourcesList:
The method will search for existing matching repos and will try to
reuse them as far as possible
"""
+ # check if we have this source already in the sources.list
+ for source in self.list:
+ if source.disabled == False and source.invalid == False and \
+ source.type == type and uri == source.uri and \
+ source.dist == dist:
+ for new_comp in comps:
+ if new_comp in source.comps:
+ # we have this component already, delete it from the new_comps
+ # list
+ del comps[comps.index(new_comp)]
+ if len(comps) == 0:
+ return source
for source in self.list:
# if there is a repo with the same (type, uri, dist) just add the
# components