diff options
author | tpaul <tpaul@pkgsrc.org> | 2018-06-20 11:50:56 +0000 |
---|---|---|
committer | tpaul <tpaul@pkgsrc.org> | 2018-06-20 11:50:56 +0000 |
commit | 9670941809a8e62efd7f5f5b35679f1f7b050eb5 (patch) | |
tree | 864d12217a61232fe45fdf955af28eb973301a57 | |
parent | 578011ebd5159b0b40bc9ae48e344a97d522bf64 (diff) | |
download | pkgsrc-9670941809a8e62efd7f5f5b35679f1f7b050eb5.tar.gz |
salt: don't crash if no swap is configured, apply pkgin module fixes
patches/patch-salt_grains_core.py:
- Reapply patch in a NetBSD/OpenBSD specific code block after package update
to 2018.3.1, from PR pkg/53278
- upstream pull #47600
patches/patch-salt_modules_pkgin.py:
- Apply patch in pkgin specific code block from PR pkg/53344
- upstream pull #47814
bump PKGREVISION
ok <leot>
-rw-r--r-- | sysutils/salt/Makefile | 3 | ||||
-rw-r--r-- | sysutils/salt/distinfo | 4 | ||||
-rw-r--r-- | sysutils/salt/patches/patch-salt_grains_core.py | 21 | ||||
-rw-r--r-- | sysutils/salt/patches/patch-salt_modules_pkgin.py | 39 |
4 files changed, 65 insertions, 2 deletions
diff --git a/sysutils/salt/Makefile b/sysutils/salt/Makefile index f2f96419458..0696e287507 100644 --- a/sysutils/salt/Makefile +++ b/sysutils/salt/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.62 2018/06/16 15:23:35 adam Exp $ +# $NetBSD: Makefile,v 1.63 2018/06/20 11:50:56 tpaul Exp $ DISTNAME= salt-2018.3.1 +PKGREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_PYPI:=s/salt/} diff --git a/sysutils/salt/distinfo b/sysutils/salt/distinfo index 2d22fe7de8b..1294ce8054c 100644 --- a/sysutils/salt/distinfo +++ b/sysutils/salt/distinfo @@ -1,7 +1,9 @@ -$NetBSD: distinfo,v 1.36 2018/06/16 15:23:35 adam Exp $ +$NetBSD: distinfo,v 1.37 2018/06/20 11:50:56 tpaul Exp $ SHA1 (salt-2018.3.1.tar.gz) = 683dc72a84cf3a19dc1a5734837cf5b2dc19ef2a RMD160 (salt-2018.3.1.tar.gz) = 8cc98668c98b89f9d244a665b5a9b76794754b32 SHA512 (salt-2018.3.1.tar.gz) = 38af8f1e8673f14e62d4a01bdb734efe8a7c8ca5cde83ce652ea0b1e260fbe7e3df04e27033c915b8d10c2ac49a88e26dae83b7f27798fb6ab53054a1329a840 Size (salt-2018.3.1.tar.gz) = 12939682 bytes +SHA1 (patch-salt_grains_core.py) = 44c23bbfb76f86027fefcafe83e657f46f5a4871 +SHA1 (patch-salt_modules_pkgin.py) = 7c51659f740508e5b305a31eb0ab6396f522f677 SHA1 (patch-salt_version.py) = 1827dac3609a938fae38ee5dfd2a873c9723dfbd diff --git a/sysutils/salt/patches/patch-salt_grains_core.py b/sysutils/salt/patches/patch-salt_grains_core.py new file mode 100644 index 00000000000..0adbc388175 --- /dev/null +++ b/sysutils/salt/patches/patch-salt_grains_core.py @@ -0,0 +1,21 @@ +$NetBSD: patch-salt_grains_core.py,v 1.5 2018/06/20 11:50:56 tpaul Exp $ + +Prevent crash on NetBSD and OpenBSD when no swap is configured. +https://github.com/saltstack/salt/pull/47600 +PR: pkg/53278 + +--- salt/grains/core.py.orig 2018-06-13 16:03:06.000000000 +0000 ++++ salt/grains/core.py +@@ -451,7 +451,11 @@ def _bsd_memdata(osdata): + + if osdata['kernel'] in ['OpenBSD', 'NetBSD']: + swapctl = salt.utils.path.which('swapctl') +- swap_total = __salt__['cmd.run']('{0} -sk'.format(swapctl)).split(' ')[1] ++ swap_total = __salt__['cmd.run']('{0} -sk'.format(swapctl)) ++ if swap_data == 'no swap devices configured': ++ swap_total = 0 ++ else: ++ swap_total = swap_data.split(' ')[1] + else: + swap_total = __salt__['cmd.run']('{0} -n vm.swap_total'.format(sysctl)) + grains['swap_total'] = int(swap_total) // 1024 // 1024 diff --git a/sysutils/salt/patches/patch-salt_modules_pkgin.py b/sysutils/salt/patches/patch-salt_modules_pkgin.py new file mode 100644 index 00000000000..3fe211dc984 --- /dev/null +++ b/sysutils/salt/patches/patch-salt_modules_pkgin.py @@ -0,0 +1,39 @@ +$NetBSD: patch-salt_modules_pkgin.py,v 1.1 2018/06/20 11:50:56 tpaul Exp $ + +Fixes 2 bugs in the pkgin module: +- pkg.latest_version doesn't return a version for an uninstalled package. +- pkg.file_dict crashes. +https://github.com/saltstack/salt/pull/47814 +PR: pkg/53344 + +--- salt/modules/pkgin.py.orig 2018-04-02 16:35:12.000000000 +0000 ++++ salt/modules/pkgin.py +@@ -181,7 +181,9 @@ def latest_version(*names, **kwargs): + + out = __salt__['cmd.run'](cmd, output_loglevel='trace') + for line in out.splitlines(): +- p = line.split(',' if _supports_parsing() else None) ++ if line.startswith('No results found for'): ++ return pkglist ++ p = line.split(';' if _supports_parsing() else None) + + if p and p[0] in ('=:', '<:', '>:', ''): + # These are explanation comments +@@ -190,7 +192,7 @@ def latest_version(*names, **kwargs): + s = _splitpkg(p[0]) + if s: + if not s[0] in pkglist: +- if len(p) > 1 and p[1] == '<': ++ if len(p) > 1 and p[1] in ('<', '', '='): + pkglist[s[0]] = s[1] + else: + pkglist[s[0]] = '' +@@ -681,7 +683,7 @@ def file_dict(*packages): + continue # unexpected string + + ret = {'errors': errors, 'files': files} +- for field in ret: ++ for field in list(ret): + if not ret[field] or ret[field] == '': + del ret[field] + return ret |