mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
*) local.sqlite is better criteria for pkgng detection
*) available_version function if pkgng is used
This commit is contained in:
parent
cb9863e264
commit
b2f6c241d0
@ -9,7 +9,7 @@ def _check_pkgng():
|
||||
'''
|
||||
Looks to see if pkgng is being used by checking if database exists
|
||||
'''
|
||||
if os.path.isfile('/var/db/pkg/repo.sqlite'):
|
||||
if os.path.isfile('/var/db/pkg/local.sqlite'):
|
||||
return True
|
||||
return False
|
||||
|
||||
@ -54,7 +54,12 @@ def available_version(name):
|
||||
|
||||
salt '*' pkg.available_version <package name>
|
||||
'''
|
||||
pass
|
||||
if _check_pkgng():
|
||||
for line in __salt__['cmd.run']('pkg search -f {0}'.format(name).splitlines()):
|
||||
if line.startswith('Version'):
|
||||
fn, ver = line.split(':', 1)
|
||||
return ver.strip()
|
||||
return ''
|
||||
|
||||
|
||||
def version(name):
|
||||
|
Loading…
Reference in New Issue
Block a user