diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-04 16:42:50 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-04 16:42:50 +0200 |
| commit | c24de9d51b0d3a5e8953dfc2b59aef85cafd34f1 (patch) | |
| tree | df97cd2d44ef44b7938d29ba3598bee7c637477a | |
| parent | 822ebea49fadca39591a566ad5ef7559d3adc26d (diff) | |
| parent | a2363f7e30c93599af6366413bad965846a12d83 (diff) | |
| download | python-apt-c24de9d51b0d3a5e8953dfc2b59aef85cafd34f1.tar.gz | |
- packages in marked_install state can also be auto-removable
* add concept of "ParentComponent" for e.g. ubuntu/multiverse
that needs universe enabled as well (plus add test)
* apt/progress/gtk2.py:
- update to the latest vte API for child-exited (LP: #865388)
| -rw-r--r-- | apt/package.py | 4 | ||||
| -rw-r--r-- | apt/progress/gtk2.py | 9 | ||||
| -rw-r--r-- | aptsources/distinfo.py | 13 | ||||
| -rw-r--r-- | aptsources/distro.py | 14 | ||||
| -rw-r--r-- | data/templates/Ubuntu.info.in | 5 | ||||
| -rw-r--r-- | debian/changelog | 5 | ||||
| -rw-r--r-- | po/python-apt.pot | 172 | ||||
| -rw-r--r-- | tests/test_all.py | 1 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 23 |
9 files changed, 150 insertions, 96 deletions
diff --git a/apt/package.py b/apt/package.py index dbc5b23e..4104f93e 100644 --- a/apt/package.py +++ b/apt/package.py @@ -973,8 +973,8 @@ class Package(object): another package, and if no packages depend on it anymore, the package is no longer required. """ - return self.is_installed and \ - self._pcache._depcache.is_garbage(self._pkg) + return ((self.is_installed or self.marked_install) and + self._pcache._depcache.is_garbage(self._pkg)) @property def is_auto_installed(self): diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index 9137ef76..b5794e92 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -34,6 +34,7 @@ except ImportError: import gobject as glib import gobject import pango +import time import vte import apt_pkg @@ -127,16 +128,15 @@ class GInstallProgress(gobject.GObject, base.InstallProgress): self.apt_status = -1 self.time_last_update = time.time() self.term = term - reaper = vte.reaper_get() - reaper.connect("child-exited", self.child_exited) + self.term.connect("child-exited", self.child_exited) self.env = ["VTE_PTY_KEEP_FD=%s" % self.writefd, "DEBIAN_FRONTEND=gnome", "APT_LISTCHANGES_FRONTEND=gtk"] self._context = glib.main_context_default() - def child_exited(self, term, pid, status): + def child_exited(self, term): """Called when a child process exits""" - self.apt_status = os.WEXITSTATUS(status) + self.apt_status = term.get_child_exit_status() self.finished = True def error(self, pkg, errormsg): @@ -204,6 +204,7 @@ class GInstallProgress(gobject.GObject, base.InstallProgress): """Wait for the child process to exit.""" while not self.finished: self.update_interface() + time.sleep(0.02) return self.apt_status if apt_pkg._COMPAT_0_7: diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 48a72719..b21e95b3 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -69,10 +69,17 @@ class Template(object): class Component(object): - def __init__(self, name, desc=None, long_desc=None): + def __init__(self, name, desc=None, long_desc=None, parent_component=None): self.name = name self.description = desc self.description_long = long_desc + self.parent_component = parent_component + + def get_parent_component(self): + return self.parent_component + + def set_parent_component(self, parent): + self.parent_component = parent def get_description(self): if self.description_long is not None: @@ -158,7 +165,7 @@ class DistInfo(object): location = None match_loc = re.compile(r"^#LOC:(.+)$") match_mirror_line = re.compile( - r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(https))://" + r"^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(mirror)|(https))://" r"[A-Za-z0-9/\.:\-_@]+)$") #match_mirror_line = re.compile(r".+") @@ -260,6 +267,8 @@ class DistInfo(object): component.set_description(_(value)) elif field == 'CompDescriptionLong': component.set_description_long(_(value)) + elif field == 'ParentComponent': + component.set_parent_component(value) self.finish_template(template, component) template=None component=None diff --git a/aptsources/distro.py b/aptsources/distro.py index 15806c5c..28d5b96f 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -290,6 +290,16 @@ class Distribution(object): comp: the component that should be enabled """ + comps = set([comp]) + # look for parent components that we may have to add + for source in self.main_sources: + for c in source.template.components: + if c.name == comp and c.parent_component: + comps.add(c.parent_component) + for c in comps: + self._enable_component(c) + + def _enable_component(self, comp): def add_component_only_once(source, comps_per_dist): """ @@ -297,12 +307,12 @@ class Distribution(object): a repository could be splitted into different apt lines. If not add the component """ - # if we don't that distro, just reutnr (can happen for e.g. + # if we don't have that distro, just return (can happen for e.g. # dapper-update only in deb-src if source.dist not in comps_per_dist: return # if we have seen this component already for this distro, - # return (nothing to do + # return (nothing to do) if comp in comps_per_dist[source.dist]: return # add it diff --git a/data/templates/Ubuntu.info.in b/data/templates/Ubuntu.info.in index a9b539af..c6d38910 100644 --- a/data/templates/Ubuntu.info.in +++ b/data/templates/Ubuntu.info.in @@ -21,6 +21,7 @@ Component: restricted _CompDescription: Non-free drivers _CompDescriptionLong: Proprietary drivers for devices Component: multiverse +ParentComponent: universe _CompDescription: Restricted software _CompDescriptionLong: Software restricted by copyright or legal issues @@ -102,6 +103,7 @@ Component: restricted _CompDescription: Non-free drivers _CompDescriptionLong: Proprietary drivers for devices Component: multiverse +ParentComponent: universe _CompDescription: Restricted software _CompDescriptionLong: Software restricted by copyright or legal issues @@ -163,6 +165,7 @@ Component: restricted _CompDescription: Non-free drivers _CompDescriptionLong: Proprietary drivers for devices Component: multiverse +ParentComponent: universe _CompDescription: Restricted software _CompDescriptionLong: Software restricted by copyright or legal issues @@ -285,6 +288,7 @@ Component: restricted _CompDescription: Non-free drivers _CompDescriptionLong: Proprietary drivers for devices Component: multiverse +ParentComponent: universe _CompDescription: Restricted software _CompDescriptionLong: Software restricted by copyright or legal issues @@ -347,6 +351,7 @@ Component: restricted _CompDescription: Non-free drivers _CompDescriptionLong: Proprietary drivers for devices Component: multiverse +ParentComponent: universe _CompDescription: Restricted software _CompDescriptionLong: Software restricted by copyright or legal issues diff --git a/debian/changelog b/debian/changelog index e8e7f096..39876538 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,11 @@ python-apt (0.8.1) UNRELEASED; urgency=low * tests/test_all.py: - skip all tests if sources.list is not readable (as is the case on some builds) + - packages in marked_install state can also be auto-removable + * add concept of "ParentComponent" for e.g. ubuntu/multiverse + that needs universe enabled as well (plus add test) + * apt/progress/gtk2.py: + - update to the latest vte API for child-exited (LP: #865388) -- Michael Vogt <mvo@debian.org> Tue, 09 Aug 2011 09:16:40 +0200 diff --git a/po/python-apt.pot b/po/python-apt.pot index 682c133a..bd9198c9 100644 --- a/po/python-apt.pot +++ b/po/python-apt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-21 15:01+0100\n" +"POT-Creation-Date: 2011-09-28 16:23+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -29,292 +29,292 @@ msgid "Ubuntu 10.10 'Maverick Meerkat'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:31 +#: ../data/templates/Ubuntu.info.in:32 msgid "Cdrom with Ubuntu 10.10 'Maverick Meerkat'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:43 +#: ../data/templates/Ubuntu.info.in:44 msgid "Canonical Partners" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:45 +#: ../data/templates/Ubuntu.info.in:46 msgid "Software packaged by Canonical for their partners" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:46 +#: ../data/templates/Ubuntu.info.in:47 msgid "This software is not part of Ubuntu." msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:53 +#: ../data/templates/Ubuntu.info.in:54 msgid "Independent" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:55 +#: ../data/templates/Ubuntu.info.in:56 msgid "Provided by third-party software developers" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:56 +#: ../data/templates/Ubuntu.info.in:57 msgid "Software offered by third party developers." msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:94 +#: ../data/templates/Ubuntu.info.in:95 msgid "Ubuntu 10.04 'Lucid Lynx'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:112 +#: ../data/templates/Ubuntu.info.in:114 msgid "Cdrom with Ubuntu 10.04 'Lucid Lynx'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:155 +#: ../data/templates/Ubuntu.info.in:157 msgid "Ubuntu 9.10 'Karmic Koala'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:173 +#: ../data/templates/Ubuntu.info.in:176 msgid "Cdrom with Ubuntu 9.10 'Karmic Koala'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:216 +#: ../data/templates/Ubuntu.info.in:219 msgid "Ubuntu 9.04 'Jaunty Jackalope'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:234 +#: ../data/templates/Ubuntu.info.in:237 msgid "Cdrom with Ubuntu 9.04 'Jaunty Jackalope'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:277 +#: ../data/templates/Ubuntu.info.in:280 msgid "Ubuntu 8.10 'Intrepid Ibex'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:295 +#: ../data/templates/Ubuntu.info.in:299 msgid "Cdrom with Ubuntu 8.10 'Intrepid Ibex'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:339 +#: ../data/templates/Ubuntu.info.in:343 msgid "Ubuntu 8.04 'Hardy Heron'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:357 +#: ../data/templates/Ubuntu.info.in:362 msgid "Cdrom with Ubuntu 8.04 'Hardy Heron'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:402 +#: ../data/templates/Ubuntu.info.in:407 msgid "Ubuntu 7.10 'Gutsy Gibbon'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:420 +#: ../data/templates/Ubuntu.info.in:425 msgid "Cdrom with Ubuntu 7.10 'Gutsy Gibbon'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:465 +#: ../data/templates/Ubuntu.info.in:470 msgid "Ubuntu 7.04 'Feisty Fawn'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:483 +#: ../data/templates/Ubuntu.info.in:488 msgid "Cdrom with Ubuntu 7.04 'Feisty Fawn'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:525 +#: ../data/templates/Ubuntu.info.in:530 msgid "Ubuntu 6.10 'Edgy Eft'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:530 +#: ../data/templates/Ubuntu.info.in:535 msgid "Community-maintained" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:536 +#: ../data/templates/Ubuntu.info.in:541 msgid "Restricted software" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:543 +#: ../data/templates/Ubuntu.info.in:548 msgid "Cdrom with Ubuntu 6.10 'Edgy Eft'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:585 +#: ../data/templates/Ubuntu.info.in:590 msgid "Ubuntu 6.06 LTS 'Dapper Drake'" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:588 +#: ../data/templates/Ubuntu.info.in:593 msgid "Canonical-supported Open Source software" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:590 +#: ../data/templates/Ubuntu.info.in:595 msgid "Community-maintained (universe)" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:591 +#: ../data/templates/Ubuntu.info.in:596 msgid "Community-maintained Open Source software" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:593 +#: ../data/templates/Ubuntu.info.in:598 msgid "Non-free drivers" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:594 +#: ../data/templates/Ubuntu.info.in:599 msgid "Proprietary drivers for devices" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:596 +#: ../data/templates/Ubuntu.info.in:601 msgid "Restricted software (Multiverse)" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:597 +#: ../data/templates/Ubuntu.info.in:602 msgid "Software restricted by copyright or legal issues" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:603 +#: ../data/templates/Ubuntu.info.in:608 msgid "Cdrom with Ubuntu 6.06 LTS 'Dapper Drake'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:619 +#: ../data/templates/Ubuntu.info.in:624 msgid "Important security updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:624 +#: ../data/templates/Ubuntu.info.in:629 msgid "Recommended updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:629 +#: ../data/templates/Ubuntu.info.in:634 msgid "Pre-released updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:634 +#: ../data/templates/Ubuntu.info.in:639 msgid "Unsupported updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:645 +#: ../data/templates/Ubuntu.info.in:650 msgid "Ubuntu 5.10 'Breezy Badger'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:659 +#: ../data/templates/Ubuntu.info.in:664 msgid "Cdrom with Ubuntu 5.10 'Breezy Badger'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:675 +#: ../data/templates/Ubuntu.info.in:680 msgid "Ubuntu 5.10 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:680 +#: ../data/templates/Ubuntu.info.in:685 msgid "Ubuntu 5.10 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:685 +#: ../data/templates/Ubuntu.info.in:690 msgid "Ubuntu 5.10 Backports" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:696 +#: ../data/templates/Ubuntu.info.in:701 msgid "Ubuntu 5.04 'Hoary Hedgehog'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:710 +#: ../data/templates/Ubuntu.info.in:715 msgid "Cdrom with Ubuntu 5.04 'Hoary Hedgehog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:713 ../data/templates/Debian.info.in:149 +#: ../data/templates/Ubuntu.info.in:718 ../data/templates/Debian.info.in:149 msgid "Officially supported" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:726 +#: ../data/templates/Ubuntu.info.in:731 msgid "Ubuntu 5.04 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:731 +#: ../data/templates/Ubuntu.info.in:736 msgid "Ubuntu 5.04 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:736 +#: ../data/templates/Ubuntu.info.in:741 msgid "Ubuntu 5.04 Backports" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:742 +#: ../data/templates/Ubuntu.info.in:747 msgid "Ubuntu 4.10 'Warty Warthog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:748 +#: ../data/templates/Ubuntu.info.in:753 msgid "Community-maintained (Universe)" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:750 +#: ../data/templates/Ubuntu.info.in:755 msgid "Non-free (Multiverse)" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:756 +#: ../data/templates/Ubuntu.info.in:761 msgid "Cdrom with Ubuntu 4.10 'Warty Warthog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:759 +#: ../data/templates/Ubuntu.info.in:764 msgid "No longer officially supported" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:761 +#: ../data/templates/Ubuntu.info.in:766 msgid "Restricted copyright" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:768 +#: ../data/templates/Ubuntu.info.in:773 msgid "Ubuntu 4.10 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:773 +#: ../data/templates/Ubuntu.info.in:778 msgid "Ubuntu 4.10 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:778 +#: ../data/templates/Ubuntu.info.in:783 msgid "Ubuntu 4.10 Backports" msgstr "" @@ -380,7 +380,7 @@ msgid "Non-DFSG-compatible Software" msgstr "" #. TRANSLATORS: %s is a country -#: ../aptsources/distro.py:209 ../aptsources/distro.py:424 +#: ../aptsources/distro.py:209 ../aptsources/distro.py:437 #, python-format msgid "Server for %s" msgstr "" @@ -420,16 +420,16 @@ msgstr "" msgid "Complete" msgstr "" -#: ../apt/package.py:342 +#: ../apt/package.py:358 #, python-format msgid "Invalid unicode in description for '%s' (%s). Please report." msgstr "" -#: ../apt/package.py:1012 ../apt/package.py:1117 +#: ../apt/package.py:1065 ../apt/package.py:1171 msgid "The list of changes is not available" msgstr "" -#: ../apt/package.py:1123 +#: ../apt/package.py:1177 #, python-format msgid "" "The list of changes is not available yet.\n" @@ -438,29 +438,29 @@ msgid "" "until the changes become available or try again later." msgstr "" -#: ../apt/package.py:1130 +#: ../apt/package.py:1184 msgid "" "Failed to download the list of changes. \n" "Please check your Internet connection." msgstr "" -#: ../apt/debfile.py:81 +#: ../apt/debfile.py:82 #, python-format msgid "List of files for '%s' could not be read" msgstr "" -#: ../apt/debfile.py:166 +#: ../apt/debfile.py:167 #, python-format msgid "Dependency is not satisfiable: %s\n" msgstr "" -#: ../apt/debfile.py:187 +#: ../apt/debfile.py:188 #, python-format msgid "Conflicts with the installed package '%s'" msgstr "" #. TRANSLATORS: the first '%s' is the package that breaks, the second the dependency that makes it break, the third the relation (e.g. >=) and the latest the version for the releation -#: ../apt/debfile.py:326 +#: ../apt/debfile.py:327 #, python-format msgid "" "Breaks existing package '%(pkgname)s' dependency %(depname)s " @@ -468,63 +468,63 @@ msgid "" msgstr "" #. TRANSLATORS: the first '%s' is the package that conflicts, the second the packagename that it conflicts with (so the name of the deb the user tries to install), the third is the relation (e.g. >=) and the last is the version for the relation -#: ../apt/debfile.py:342 +#: ../apt/debfile.py:343 #, python-format msgid "" "Breaks existing package '%(pkgname)s' conflict: %(targetpkg)s (%(comptype)s " "%(targetver)s)" msgstr "" -#: ../apt/debfile.py:352 +#: ../apt/debfile.py:353 #, python-format msgid "" "Breaks existing package '%(pkgname)s' that conflict: '%(targetpkg)s'. But " "the '%(debfile)s' provides it via: '%(provides)s'" msgstr "" -#: ../apt/debfile.py:398 +#: ../apt/debfile.py:399 msgid "No Architecture field in the package" msgstr "" -#: ../apt/debfile.py:403 +#: ../apt/debfile.py:404 #, python-format msgid "Wrong architecture '%s'" msgstr "" #. the deb is older than the installed -#: ../apt/debfile.py:410 +#: ../apt/debfile.py:411 msgid "A later version is already installed" msgstr "" -#: ../apt/debfile.py:435 +#: ../apt/debfile.py:436 msgid "Failed to satisfy all dependencies (broken cache)" msgstr "" -#: ../apt/debfile.py:465 +#: ../apt/debfile.py:466 #, python-format msgid "Cannot install '%s'" msgstr "" -#: ../apt/debfile.py:507 +#: ../apt/debfile.py:508 msgid "Python-debian module not available" msgstr "" -#: ../apt/debfile.py:541 +#: ../apt/debfile.py:542 msgid "" "Automatically decompressed:\n" "\n" msgstr "" -#: ../apt/debfile.py:547 +#: ../apt/debfile.py:548 msgid "Automatically converted to printable ascii:\n" msgstr "" -#: ../apt/debfile.py:637 +#: ../apt/debfile.py:638 #, python-format msgid "Install Build-Dependencies for source package '%s' that builds %s\n" msgstr "" -#: ../apt/debfile.py:647 +#: ../apt/debfile.py:648 msgid "An essential package would be removed" msgstr "" @@ -549,11 +549,11 @@ msgstr "" msgid "Get:" msgstr "" -#: ../apt/progress/text.py:204 +#: ../apt/progress/text.py:203 msgid " [Working]" msgstr "" -#: ../apt/progress/text.py:215 +#: ../apt/progress/text.py:214 #, python-format msgid "" "Media change: please insert the disc labeled\n" @@ -562,19 +562,19 @@ msgid "" msgstr "" #. Trick for getting a translation from apt -#: ../apt/progress/text.py:224 +#: ../apt/progress/text.py:223 #, python-format msgid "Fetched %sB in %s (%sB/s)\n" msgstr "" -#: ../apt/progress/text.py:240 +#: ../apt/progress/text.py:239 msgid "Please provide a name for this Disc, such as 'Debian 2.1r1 Disk 1'" msgstr "" -#: ../apt/progress/text.py:256 +#: ../apt/progress/text.py:255 msgid "Please insert a Disc in the drive and press enter" msgstr "" -#: ../apt/cache.py:135 +#: ../apt/cache.py:149 msgid "Building data structures" msgstr "" diff --git a/tests/test_all.py b/tests/test_all.py index f7b9dc8c..0f548781 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -43,6 +43,7 @@ if __name__ == '__main__': if dirname: os.chdir(dirname) library_dir = get_library_dir() + sys.stderr.write("Using library_dir: '%s'" % library_dir) if library_dir: sys.path.insert(0, os.path.abspath(library_dir)) diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 193d3806..dcfb0682 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -160,6 +160,29 @@ class TestAptSources(unittest.TestCase): assert sources.list[8].comps == ["main"] assert sources.list[8].line.strip() == str(sources.list[8]) + def test_enable_component(self): + from subprocess import Popen, PIPE + target = "./data/aptsources/sources.list.enable_comps" + line = "deb http://archive.ubuntu.com/ubuntu lucid main\n" + open(target, "w").write(line) + apt_pkg.config.set("Dir::Etc::sourcelist", target) + sources = aptsources.sourceslist.SourcesList(True, self.templates) + distro = aptsources.distro.get_distro(id="Ubuntu") + # make sure we are using the right distro + distro.codename = "lucid" + distro.id = "Ubuntu" + distro.release = "10.04" + # and get the sources + distro.get_sources(sources) + # test enable_component + comp = "multiverse" + distro.enable_component(comp) + comps = set() + for entry in sources: + comps = comps.union(set(entry.comps)) + self.assertTrue("multiverse" in comps) + self.assertTrue("universe" in comps) + def testDistribution(self): """aptsources: Test distribution detection.""" apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" |
