From c7d5ba2950b5402d0a89c79fb98cb72b80985bf1 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 26 Dec 2005 10:35:43 +0000 Subject: [PATCH] ppc64 can use ppc32 binaries. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/injector/injector@601 9f8c893c-44ee-0310-b757-c8ca8341c71e --- zeroinstall/injector/arch.py | 1 + zeroinstall/injector/policy.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/zeroinstall/injector/arch.py b/zeroinstall/injector/arch.py index 526a196..25a62ea 100644 --- a/zeroinstall/injector/arch.py +++ b/zeroinstall/injector/arch.py @@ -23,6 +23,7 @@ def _get_machine_ranks(): 'i486': ['i386'], 'i586': ['i486', 'i386'], 'i686': ['i586', 'i486', 'i386'], + 'ppc64': ['ppc32'], } for supported in _machine_matrix.get(this_machine, []): machine_ranks[supported] = len(machine_ranks) diff --git a/zeroinstall/injector/policy.py b/zeroinstall/injector/policy.py index 30cafe6..aaa9d1b 100644 --- a/zeroinstall/injector/policy.py +++ b/zeroinstall/injector/policy.py @@ -16,7 +16,7 @@ from zeroinstall import NeedDownload class Policy(object): __slots__ = ['root', 'implementation', 'watchers', 'help_with_testing', 'network_use', - 'freshness', 'ready', 'handler'] + 'freshness', 'ready', 'handler', 'warned_offline'] def __init__(self, root, handler = None): self.watchers = [] @@ -25,6 +25,10 @@ class Policy(object): self.freshness = 60 * 60 * 24 * 7 # Seconds allowed since last update self.ready = False + # If we need to download something but can't because we are offline, + # warn the user. But only the first time. + self.warned_offline = False + # (allow self for backwards compat) self.handler = handler or self @@ -214,7 +218,12 @@ class Policy(object): debug("Interface not cached and not off-line. Downloading...") self.begin_iface_download(iface) else: - debug("Nothing known about interface, but we are off-line.") + if self.warned_offline: + debug("Nothing known about interface, but we are off-line.") + else: + warn("Nothing known about interface '%s', but we are in off-line mode " + "(so not fetching)." % uri) + self.warned_offline = True elif not uri.startswith('/'): staleness = time.time() - (iface.last_checked or 0) debug("Staleness for %s is %.2f hours", iface, staleness / 3600.0) @@ -311,6 +320,9 @@ class Policy(object): This is used by --feed. If there are no interfaces, raises SafeException.""" feed_iface = self.get_interface(feed_iface_uri) if not feed_iface.feed_for: + if not feed_iface.name: + raise SafeException("Can't get feed targets for '%s'; failed to load interface." % + feed_iface_uri) raise SafeException("Missing element in '%s'; " "this interface can't be used as a feed." % feed_iface_uri) feed_targets = feed_iface.feed_for -- 2.11.4.GIT