From 6f466975986120f25bb50fbb03b9a27769e03d00 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 28 May 2007 16:16:57 +0000 Subject: [PATCH] Removed distribution argument from . Will re-add it later if needed, possibly with a different syntax. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/trunk/0launch@1790 9f8c893c-44ee-0310-b757-c8ca8341c71e --- tests/testreader.py | 8 ++++---- zeroinstall/injector/distro.py | 11 +++-------- zeroinstall/injector/reader.py | 5 +---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/testreader.py b/tests/testreader.py index d304b00..0feb707 100755 --- a/tests/testreader.py +++ b/tests/testreader.py @@ -204,8 +204,8 @@ class TestReader(BaseTest): Foo Foo Foo - - + + """) tmp.flush() @@ -214,8 +214,8 @@ class TestReader(BaseTest): assert len(iface.implementations) == 1 - impl = iface.implementations['package:debian:python-bittorrent:3.4.2-10'] - assert impl.id == 'package:debian:python-bittorrent:3.4.2-10' + impl = iface.implementations['package:deb:python-bittorrent:3.4.2-10'] + assert impl.id == 'package:deb:python-bittorrent:3.4.2-10' assert impl.upstream_stability == model.packaged assert impl.user_stability == None assert impl.requires == [] diff --git a/zeroinstall/injector/distro.py b/zeroinstall/injector/distro.py index 58deee1..75ffc6d 100644 --- a/zeroinstall/injector/distro.py +++ b/zeroinstall/injector/distro.py @@ -30,12 +30,10 @@ class Distribution(object): @since: 0.28 """ - def get_package_info(self, distribution, package, factory): + def get_package_info(self, package, factory): """Get information about the given package. Add zero or more implementations using the factory (typically at most two will be added; the currently installed version and the latest available). - @param distribution: distribution name (e.g. "Debian") - @type distribution: str @param package: package name (e.g. "gimp") @type package: str @param factory: function for creating new DistributionImplementation objects from IDs @@ -113,16 +111,13 @@ class DebianDistribution(Distribution): os.unlink(tmpname) raise - def get_package_info(self, distribution, package, factory): - if distribution != 'Debian': - return - + def get_package_info(self, package, factory): try: version = self.versions[package] except KeyError: return - impl = factory('package:debian:%s:%s' % (package, version)) + impl = factory('package:deb:%s:%s' % (package, version)) impl.version = model.parse_version(version) _dpkg_db_dir = '/var/lib/dpkg' diff --git a/zeroinstall/injector/reader.py b/zeroinstall/injector/reader.py index b5ae3a1..35b8d19 100644 --- a/zeroinstall/injector/reader.py +++ b/zeroinstall/injector/reader.py @@ -380,9 +380,6 @@ def update(interface, source, local = False): package = item_attrs.get('package', None) if package is None: raise InvalidInterface("Missing 'package' attribute on %s" % item) - distribution = item_attrs.get('distribution', None) - if distribution is None: - raise InvalidInterface("Missing 'distribution' attribute on %s" % item) def factory(id): assert id.startswith('package:') @@ -400,7 +397,7 @@ def update(interface, source, local = False): return impl - distro.host_distribution.get_package_info(distribution, package, factory) + distro.host_distribution.get_package_info(package, factory) process_group(root, -- 2.11.4.GIT