diff options
| -rw-r--r-- | SoftwareProperties/SoftwareProperties.py | 7 | ||||
| -rw-r--r-- | UpdateManager/Common/aptsources.py | 33 | ||||
| -rw-r--r-- | data/channels/Ubuntu.info | 34 | ||||
| -rw-r--r-- | data/channels/Ubuntu.info.in | 20 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 2 |
5 files changed, 67 insertions, 29 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 042a0c4c..a3dfdd06 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -241,7 +241,12 @@ class SoftwareProperties(SimpleGladeApp): for checkbutton in self.vbox_dist_comps.get_children(): self.vbox_dist_comps.remove(checkbutton) for comp in self.distro.source_template.components.keys(): - checkbox = gtk.CheckButton(label=self.distro.source_template.components[comp][2]) + # TRANSLATORS: Label for the components in the Internet section + # first %s is the description of the component + # second %s is the code name of the comp, eg main, universe + label = _("%s (%s)") % (self.distro.source_template.components[comp][2], + comp) + checkbox = gtk.CheckButton(label) # check if the comp is enabled # FIXME: use inconsistence if there are main sources with not all comps if comp in self.distro.download_comps: diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py index 8963fd15..09673376 100644 --- a/UpdateManager/Common/aptsources.py +++ b/UpdateManager/Common/aptsources.py @@ -1,10 +1,12 @@ # aptsource.py.in - parse sources.list # -# Copyright (c) 2004,2005 Canonical +# Copyright (c) 2004-2006 Canonical # 2004 Michiel Sikkes +# 2006 Sebastian Heinlein # # Author: Michiel Sikkes <michiel@eyesopened.nl> # Michael Vogt <mvo@debian.org> +# Sebastian Heinlein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -29,6 +31,7 @@ import glob import shutil import time import os.path +import sys #import pdb @@ -641,13 +644,27 @@ class Distribution: sourceslist: an aptsource.sources_list comp: the component that should be enabled """ - # FIXME: we can't just unconditionally add stuff to each line, - # otherwise we need up with multiple components for the - # same repository (see tests/test_aptsources.py for details) + def add_component_only_once(source, workpile): + """ + Check if we already added the component to the repository, since + a repository could be splitted into different apt lines. If not + add the component + """ + if not (workpile.has_key(source.uri) and\ + source.dist in workpile[source.uri]): + if comp not in source.comps: + source.comps.append(comp) + if workpile.has_key(source.uri): + workpile[source.uri].append(source.dist) + else: + workpile[source.uri] = [source.dist] + sources = [] sources.extend(self.main_sources) sources.extend(self.child_sources) sources.extend(self.source_code_sources) + # store repos to which the new component has been added + workpile = {} # check if there is a main source at all if len(self.main_sources) < 1: # create a new main source @@ -655,11 +672,13 @@ class Distribution: else: # add the comp to all main, child and source code sources for source in sources: - if comp not in source.comps: - source.comps.append(comp) + add_component_only_once(source, workpile) + if self.get_source_code == True: for source in self.source_code_sources: - if comp not in source.comps: source.comps.append(comp) + if comp not in source.comps: + add_component_only_once(source, workpile) + def disable_component(self, sourceslist, comp): """ diff --git a/data/channels/Ubuntu.info b/data/channels/Ubuntu.info index 99c202ba..2620a7da 100644 --- a/data/channels/Ubuntu.info +++ b/data/channels/Ubuntu.info @@ -8,19 +8,19 @@ Description: Ubuntu 6.10 'Edgy Eft' Component: main Enabled: 1 CompDescription: Officially supported -CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) +CompDescriptionLong: By Canonical supported Open Source software Component: universe Enabled: 0 -CompDescription: Community maintained (universe) -CompDescriptionLong: OpenSource software that is maintained by the community (universe) +CompDescription: Community maintained +CompDescriptionLong: Community maintained Open Source software Component: restricted Enabled: 1 CompDescription: Non-free drivers -CompDescriptionLong: Proprietary drivers for devices (restricted) +CompDescriptionLong: Proprietary drivers for devices Component: multiverse Enabled: 0 -CompDescription: Restricted software (Multiverse) -CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) +CompDescription: Restricted software +CompDescriptionLong: By copyright or legal issues restricted software Suite: edgy MatchName: .* @@ -48,6 +48,13 @@ BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ Description: Recommended updates +Suite: edgy-proposed +ParentSuite: edgy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Proposed updates + Suite: edgy-backports ParentSuite: edgy RepositoryType: deb @@ -63,19 +70,19 @@ Description: Ubuntu 6.06 LTS 'Dapper Drake' Component: main Enabled: 1 CompDescription: Officially supported -CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) +CompDescriptionLong: By Canonical supported Open Source software Component: universe Enabled: 0 CompDescription: Community maintained (universe) -CompDescriptionLong: OpenSource software that is maintained by the community (universe) +CompDescriptionLong: Community maintained Open Source software Component: restricted Enabled: 1 CompDescription: Non-free drivers -CompDescriptionLong: Proprietary drivers for devices (restricted) +CompDescriptionLong: Proprietary drivers for devices Component: multiverse Enabled: 0 CompDescription: Restricted software (Multiverse) -CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) +CompDescriptionLong: By copyright or legal issues restricted software Suite: dapper MatchName: .* @@ -103,6 +110,13 @@ BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ Description: Recommended updates +Suite: dapper-proposed +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Proposed updates + Suite: dapper-backports ParentSuite: dapper RepositoryType: deb diff --git a/data/channels/Ubuntu.info.in b/data/channels/Ubuntu.info.in index 4b6b2b19..ed7fd50c 100644 --- a/data/channels/Ubuntu.info.in +++ b/data/channels/Ubuntu.info.in @@ -8,19 +8,19 @@ _Description: Ubuntu 6.10 'Edgy Eft' Component: main Enabled: 1 _CompDescription: Officially supported -_CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) +_CompDescriptionLong: By Canonical supported Open Source software Component: universe Enabled: 0 -_CompDescription: Community maintained (universe) -_CompDescriptionLong: OpenSource software that is maintained by the community (universe) +_CompDescription: Community maintained +_CompDescriptionLong: Community maintained Open Source software Component: restricted Enabled: 1 _CompDescription: Non-free drivers -_CompDescriptionLong: Proprietary drivers for devices (restricted) +_CompDescriptionLong: Proprietary drivers for devices Component: multiverse Enabled: 0 -_CompDescription: Restricted software (Multiverse) -_CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) +_CompDescription: Restricted software +_CompDescriptionLong: By copyright or legal issues restricted software Suite: edgy MatchName: .* @@ -70,19 +70,19 @@ _Description: Ubuntu 6.06 LTS 'Dapper Drake' Component: main Enabled: 1 _CompDescription: Officially supported -_CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) +_CompDescriptionLong: By Canonical supported Open Source software Component: universe Enabled: 0 _CompDescription: Community maintained (universe) -_CompDescriptionLong: OpenSource software that is maintained by the community (universe) +_CompDescriptionLong: Community maintained Open Source software Component: restricted Enabled: 1 _CompDescription: Non-free drivers -_CompDescriptionLong: Proprietary drivers for devices (restricted) +_CompDescriptionLong: Proprietary drivers for devices Component: multiverse Enabled: 0 _CompDescription: Restricted software (Multiverse) -_CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) +_CompDescriptionLong: By copyright or legal issues restricted software Suite: dapper MatchName: .* diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 0479076c..d5b5ff9f 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -92,7 +92,7 @@ class TestAptSources(unittest.TestCase): if c == comp: found += 1 print "".join([s.str() for s in sources]) - assertEqual(found, 1) + self.assertEqual(found, 1) if __name__ == "__main__": |
