10000 Handle repo argument as described in documentation. · linuxadmin/salt@50dbc3a · GitHub
[go: up one dir, main page]

Skip to content

Commit 50dbc3a

Browse files
author
Denis Generalov
committed
Handle repo argument as described in documentation.
1 parent 9a98968 commit 50dbc3a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

salt/modules/freebsdpkg.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,17 @@ def install(name, *args, **kwargs):
127127
128128
salt '*' pkg.install <package name>
129129
'''
130+
env = ()
130131
if _check_pkgng():
131132
pkg_command = 'pkg install -y'
133+
if 'repo' in kwargs:
134+
env = (('PACKAGESITE', kwargs['repo']),)
132135
else:
133136
pkg_command = 'pkg_add -r'
137+
if 'repo' in kwargs:
138+
env = (('PACKAGEROOT', kwargs['repo']),)
134139
old = list_pkgs()
135-
__salt__['cmd.retcode']('%s {0}'.format(name) % pkg_command)
140+
__salt__['cmd.retcode']('%s {0}'.format(name) % pkg_command, env=env)
136141
new = list_pkgs()
137142
pkgs = {}
138143
for npkg in new:

0 commit comments

Comments
 (0)
0