mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] --version now display stable/testing/unstable information
This commit is contained in:
parent
70e08ed40f
commit
e0edbeca35
1 changed files with 18 additions and 1 deletions
|
@ -422,7 +422,21 @@ def get_installed_version(*pkgnames, **kwargs):
|
||||||
if strict:
|
if strict:
|
||||||
raise UninstalledPackage(pkgname)
|
raise UninstalledPackage(pkgname)
|
||||||
version = None
|
version = None
|
||||||
versions[pkgname] = version
|
|
||||||
|
try:
|
||||||
|
# stable, testing, unstable
|
||||||
|
repo = pkg.installed.origins[0].component
|
||||||
|
except AttributeError:
|
||||||
|
if strict:
|
||||||
|
raise UninstalledPackage(pkgname)
|
||||||
|
repo = ""
|
||||||
|
|
||||||
|
versions[pkgname] = {
|
||||||
|
"version": version,
|
||||||
|
# when we don't have component it's because it's from a local
|
||||||
|
# install or from an image (like in vagrant)
|
||||||
|
"repo": repo if repo else "local",
|
||||||
|
}
|
||||||
|
|
||||||
if len(pkgnames) == 1 and not as_dict:
|
if len(pkgnames) == 1 and not as_dict:
|
||||||
return versions[pkgnames[0]]
|
return versions[pkgnames[0]]
|
||||||
|
@ -438,6 +452,9 @@ def meets_version_specifier(pkgname, specifier):
|
||||||
# YunoHost related methods ---------------------------------------------------
|
# YunoHost related methods ---------------------------------------------------
|
||||||
|
|
||||||
def ynh_packages_version(*args, **kwargs):
|
def ynh_packages_version(*args, **kwargs):
|
||||||
|
# from cli the received arguments are:
|
||||||
|
# (Namespace(_callbacks=deque([]), _tid='_global', _to_return={}), []) {}
|
||||||
|
# they don't seems to serve any purpose
|
||||||
"""Return the version of each YunoHost package"""
|
"""Return the version of each YunoHost package"""
|
||||||
return get_installed_version(
|
return get_installed_version(
|
||||||
'yunohost', 'yunohost-admin', 'moulinette', 'ssowat',
|
'yunohost', 'yunohost-admin', 'moulinette', 'ssowat',
|
||||||
|
|
Loading…
Add table
Reference in a new issue