From d0fc61ea2d15e0d0415651c461975ab75ecb48a7 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 17 Jan 2012 20:18:02 +0000 Subject: [PATCH] Notify the user about newer unselected versions in "0install update" If a newer version is available, tell them that it exists. Suggest turning on help_with_testing if that might help. --- zeroinstall/cmd/update.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/zeroinstall/cmd/update.py b/zeroinstall/cmd/update.py index 553f9c0..0da0be6 100644 --- a/zeroinstall/cmd/update.py +++ b/zeroinstall/cmd/update.py @@ -70,5 +70,16 @@ def handle(config, options, args): print(_("%s: new -> %s") % (iface, new_sel.version)) changes = True - if not changes: - print(_("No updates found.")) + root_sel = sels[iface_uri] + root_iface = config.iface_cache.get_interface(iface_uri) + latest = max((impl.version, impl) for impl in root_iface.implementations.values())[1] + if latest.version > model.parse_version(sels[iface_uri].version): + print(_("A later version ({name} {latest}) exists but was not selected. Using {version} instead.").format( + latest = latest.get_version(), + name = root_iface.get_name(), + version = root_sel.version)) + if not config.help_with_testing and latest.get_stability() < model.stable: + print(_('To select "testing" versions, use:\n0install config help_with_testing True')) + else: + if not changes: + print(_("No updates found. Continuing with version {version}.").format(version = root_sel.version)) -- 2.11.4.GIT