From bdd70a9800e9d77ffb7ecd5999530bc4cc5c6fc6 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 25 Feb 2007 11:42:08 +0000 Subject: [PATCH] Don't do a background check for updates if we're in off-line mode. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/trunk/0launch@1557 9f8c893c-44ee-0310-b757-c8ca8341c71e --- zeroinstall/injector/cli.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/zeroinstall/injector/cli.py b/zeroinstall/injector/cli.py index fe2fab0..bfe3f06 100755 --- a/zeroinstall/injector/cli.py +++ b/zeroinstall/injector/cli.py @@ -66,7 +66,6 @@ def main(command_args): if options.list: from zeroinstall.injector.iface_cache import iface_cache if len(args) == 0: - match = None matches = iface_cache.list_all_interfaces() elif len(args) == 1: match = args[0].lower() @@ -208,10 +207,13 @@ def main(command_args): if can_run_immediately: if policy.stale_feeds: - # There are feeds we should update, but we can run without them. - # Do the update in the background while the program is running. - import background - background.spawn_background_update(policy, options.verbose > 0) + if policy.network_use == model.network_offline: + logging.debug("No doing background update because we are in off-line mode.") + else: + # There are feeds we should update, but we can run without them. + # Do the update in the background while the program is running. + import background + background.spawn_background_update(policy, options.verbose > 0) policy.execute(args[1:], main = options.main) assert options.dry_run or options.download_only return -- 2.11.4.GIT