Last active
April 5, 2016 18:40
-
-
Save amontalban/ca617b5f944144b0ad0a1116e6e7ce4a to your computer and use it in GitHub Desktop.
Patch for Saltstack #28262
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/salt/modules/pkgng.py | |
+++ b/salt/modules/pkgng.py | |
@@ -277,15 +277,19 @@ def latest_version(*names, **kwargs): | |
quiet = False | |
for name in names: | |
- cmd = [_pkg(jail, chroot), 'search'] | |
+ cmd = [_pkg(jail, chroot), 'search', '-S', 'name', '-Q', 'version', '-e'] | |
if quiet: | |
cmd.append('-q') | |
cmd.append(name) | |
pkgver = _get_version( | |
name, | |
- __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='trace') | |
+ sorted( | |
+ __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='trace').splitlines(), | |
+ reverse=True | |
+ ).pop(0) | |
) | |
+ | |
if pkgver is not None: | |
installed = pkgs.get(name, []) | |
if not installed: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment