mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Handle repo argument as described in documentation.
This commit is contained in:
parent
9a9896858b
commit
50dbc3a3a1
@ -127,12 +127,17 @@ def install(name, *args, **kwargs):
|
||||
|
||||
salt '*' pkg.install <package name>
|
||||
'''
|
||||
env = ()
|
||||
if _check_pkgng():
|
||||
pkg_command = 'pkg install -y'
|
||||
if 'repo' in kwargs:
|
||||
env = (('PACKAGESITE', kwargs['repo']),)
|
||||
else:
|
||||
pkg_command = 'pkg_add -r'
|
||||
if 'repo' in kwargs:
|
||||
env = (('PACKAGEROOT', kwargs['repo']),)
|
||||
old = list_pkgs()
|
||||
__salt__['cmd.retcode']('%s {0}'.format(name) % pkg_command)
|
||||
__salt__['cmd.retcode']('%s {0}'.format(name) % pkg_command, env=env)
|
||||
new = list_pkgs()
|
||||
pkgs = {}
|
||||
for npkg in new:
|
||||
|
Loading…
Reference in New Issue
Block a user