Permalink
Browse files

dd the abaility to pacman for gt, lt and eq kwargs for package versions

  • Loading branch information...
thatch45 committed Apr 6, 2012
1 parent c8f16ab commit c053672084edf1575a48a7d6268291c8677095d1
Showing with 10 additions and 2 deletions.
  1. +10 −2 salt/modules/pacman.py
View
@@ -141,10 +141,18 @@ def install(name, refresh=False, **kwargs):
salt '*' pkg.install <package name>
'''
+ fname = name
+ if 'gt' in kwargs:
+ fname = '"{0}>{1}"'.format(name, kwargs['gt'])
+ if 'lt' in kwargs:
+ fname = '"{0}<{1}"'.format(name, kwargs['lt'])
+ if 'eq' in kwargs:
+ fname = '"{0}={1}"'.format(name, kwargs['eq'])
old = list_pkgs()
- cmd = 'pacman -S --noprogressbar --noconfirm {0}'.format(name)
+ cmd = 'pacman -S --noprogressbar --noconfirm {0}'.format(fname)
if refresh:
- cmd = 'pacman -Syu --noprogressbar --noconfirm {0}'.format(name)
+ cmd = 'pacman -Syu --noprogressbar --noconfirm {0}'.format(fname)
+
__salt__['cmd.retcode'](cmd)
new = list_pkgs()
pkgs = {}

0 comments on commit c053672

Please sign in to comment.