Better checking of available package updates

This commit is contained in:
Ivan Kravets
2016-09-13 18:53:17 +03:00
parent 33b5e18582
commit 8199272328
2 changed files with 12 additions and 2 deletions

View File

@ -14,7 +14,7 @@
import sys
VERSION = (3, 0, "2a2")
VERSION = (3, 0, "2a3")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -544,9 +544,19 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin):
if not latest_version:
click.echo("[%s]" % (click.style("Unknown", fg="yellow")))
return
if manifest['version'] == latest_version:
up_to_date = False
try:
up_to_date = (
semantic_version.Version.coerce(manifest['version']) >=
semantic_version.Version.coerce(latest_version))
except ValueError:
up_to_date = latest_version == manifest['version']
if up_to_date:
click.echo("[%s]" % (click.style("Up-to-date", fg="green")))
return
click.echo("[%s]" % (click.style("Out-of-date", fg="red")))
if only_check:
return