From 33de11b21ea16d78fd1b8d817e1110b25c51c7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Thu, 30 Jun 2022 13:05:44 +0200 Subject: [PATCH 1/3] New package: python3-straight.plugin-1.5.0 --- srcpkgs/python3-straight.plugin/template | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 srcpkgs/python3-straight.plugin/template diff --git a/srcpkgs/python3-straight.plugin/template b/srcpkgs/python3-straight.plugin/template new file mode 100644 index 000000000000..97d226d31133 --- /dev/null +++ b/srcpkgs/python3-straight.plugin/template @@ -0,0 +1,18 @@ +# Template file for 'python3-straight.plugin' +pkgname=python3-straight.plugin +version=1.5.0 +revision=1 +wrksrc="${pkgname/python3-/}-${version}" +build_style=python3-module +hostmakedepends="python3-setuptools" +depends="python3" +short_desc="Python plugin loading facility" +maintainer="Jan Christian Grünhage " +license="MIT" +homepage="https://straightplugin.readthedocs.io/" +distfiles="${PYPI_SITE}/s/${pkgname/python3-/}/${pkgname/python3-/}-${version}.tar.gz" +checksum=818a7641068932ed6436d0af0a3bb77bbbde29df0a7142c8bd1a249e7c2f0d38 + +post_install() { + vlicense LICENSE +} From 14eb8d3e4cd2e52edbf548709d9dc5ea15094700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Thu, 30 Jun 2022 13:06:18 +0200 Subject: [PATCH 2/3] ansible-core: update to 2.13.1. --- ...mmand-v-instead-of-which-in-Makefile.patch | 32 +++++++++++++++ ...et_bin_path-should-only-look-at-PATH.patch | 39 +++++++++++++++++++ srcpkgs/ansible-core/template | 29 ++++++++------ 3 files changed, 89 insertions(+), 11 deletions(-) create mode 100644 srcpkgs/ansible-core/patches/0001-use-command-v-instead-of-which-in-Makefile.patch create mode 100644 srcpkgs/ansible-core/patches/0002-fix-get_bin_path-should-only-look-at-PATH.patch diff --git a/srcpkgs/ansible-core/patches/0001-use-command-v-instead-of-which-in-Makefile.patch b/srcpkgs/ansible-core/patches/0001-use-command-v-instead-of-which-in-Makefile.patch new file mode 100644 index 000000000000..93cb25f91237 --- /dev/null +++ b/srcpkgs/ansible-core/patches/0001-use-command-v-instead-of-which-in-Makefile.patch @@ -0,0 +1,32 @@ +From ebb46e78c763836d45cbc82b963946a7cf59b3f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Thu, 30 Jun 2022 15:33:46 +0200 +Subject: [PATCH 1/2] use 'command -v' instead of 'which' in Makefile + +'which' is not standardized and can even be considered problematic [1] + +[1] https://lwn.net/Articles/874049/ +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 7641344968..45421e88e0 100644 +--- a/Makefile ++++ b/Makefile +@@ -18,9 +18,9 @@ SDIST_DIR ?= 'dist' + # This doesn't evaluate until it's called. The -D argument is the + # directory of the target file ($@), kinda like `dirname`. + MANPAGES ?= $(patsubst %.rst.in,%,$(wildcard ./docs/man/man1/ansible*.1.rst.in)) +-ifneq ($(shell which rst2man 2>/dev/null),) ++ifneq ($(shell command -v rst2man 2>/dev/null),) + ASCII2MAN = rst2man $< $@ +-else ifneq ($(shell which rst2man.py 2>/dev/null),) ++else ifneq ($(shell command -v rst2man.py 2>/dev/null),) + ASCII2MAN = rst2man.py $< $@ + else + ASCII2MAN = @echo "ERROR: rst2man from docutils command is not installed but is required to build $(MANPAGES)" && exit 1 +-- +2.36.1 + diff --git a/srcpkgs/ansible-core/patches/0002-fix-get_bin_path-should-only-look-at-PATH.patch b/srcpkgs/ansible-core/patches/0002-fix-get_bin_path-should-only-look-at-PATH.patch new file mode 100644 index 000000000000..7c2f0c1d597b --- /dev/null +++ b/srcpkgs/ansible-core/patches/0002-fix-get_bin_path-should-only-look-at-PATH.patch @@ -0,0 +1,39 @@ +From 9e273f9d1151d1c43b7b0206e902905140d15c6c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Thu, 30 Jun 2022 15:37:16 +0200 +Subject: [PATCH 2/2] fix: get_bin_path should only look at $PATH + +get_bin_path, according to it's documentation, is looking for a binary +in the $PATH. It actually also checks in /sbin, /usr/sbin and +/usr/local/sbin, which breaks stuff if you explicitly need to not look +in those directories either +--- + lib/ansible/module_utils/common/process.py | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/lib/ansible/module_utils/common/process.py b/lib/ansible/module_utils/common/process.py +index f128cd9800..970dd99852 100644 +--- a/lib/ansible/module_utils/common/process.py ++++ b/lib/ansible/module_utils/common/process.py +@@ -20,17 +20,12 @@ def get_bin_path(arg, opt_dirs=None, required=None): + ''' + opt_dirs = [] if opt_dirs is None else opt_dirs + +- sbin_paths = ['/sbin', '/usr/sbin', '/usr/local/sbin'] + paths = [] + for d in opt_dirs: + if d is not None and os.path.exists(d): + paths.append(d) + paths += os.environ.get('PATH', '').split(os.pathsep) + bin_path = None +- # mangle PATH to include /sbin dirs +- for p in sbin_paths: +- if p not in paths and os.path.exists(p): +- paths.append(p) + for d in paths: + if not d: + continue +-- +2.36.1 + diff --git a/srcpkgs/ansible-core/template b/srcpkgs/ansible-core/template index ef59b9b653a5..bca229a5460b 100644 --- a/srcpkgs/ansible-core/template +++ b/srcpkgs/ansible-core/template @@ -1,27 +1,34 @@ # Template file for 'ansible-core' pkgname=ansible-core -version=2.12.6 +version=2.13.1 revision=1 -build_style=python3-module -hostmakedepends="python3-setuptools" -depends="${hostmakedepends} python3-cryptography python3-Jinja2 python3-paramiko - python3-yaml python3-packaging python3-resolvelib" +hostmakedepends="python3-setuptools python3-wheel python3-packaging python3-straight.plugin python3-docutils" +depends="python3-cryptography python3-Jinja2 python3-paramiko python3-yaml + python3-packaging python3-resolvelib python3-pytz git" +checkdepends="${depends} python3-pytest python3-pytest-xdist python3-pytest-forked unzip openssh python3-pytest-mock libselinux" short_desc="Simple deployment, configuration management and execution framework" maintainer="Jan Christian Grünhage " license="GPL-3.0-or-later" homepage="https://www.ansible.com/" distfiles="${PYPI_SITE}/a/ansible-core/ansible-core-${version}.tar.gz" -checksum=5f366e851159d8f72ce68d32b8c0edda56ee537c01e9f68eca382bd1510af65d +checksum=abd478ceff1a0aba95e94ceab8dc820f407bcc0f0033dc546840cddc29a36958 conflicts="ansible<2.10.1_1" replaces="ansible-base<2.11.0_1" -# Tests are currently broken for ansible on python 3.10 -# See https://github.com/ansible/ansible/issues/74658 -# and https://github.com/ansible/ansible/issues/74660 -make_check=no -post_install() { +do_build() { + python setup.py build +} + +do_check() { + TEST_FLAGS="${make_check_args}" make tests-py3 +} + +do_install() { + python setup.py install --root="${DESTDIR}" vsconf examples/ansible.cfg vsconf examples/hosts + make docs + for m in docs/man/man1/*.1; do vman ${m} done From 60f7ab619928900beebe31e85d16ff4ac4188ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Thu, 30 Jun 2022 13:06:20 +0200 Subject: [PATCH 3/3] ansible: update to 6.0.0. --- srcpkgs/ansible/template | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/srcpkgs/ansible/template b/srcpkgs/ansible/template index 4d694f2107c9..2bce297348fd 100644 --- a/srcpkgs/ansible/template +++ b/srcpkgs/ansible/template @@ -1,17 +1,15 @@ # Template file for 'ansible' pkgname=ansible -version=5.9.0 +version=6.0.0 revision=1 -build_style=python3-module -hostmakedepends="python3-setuptools" +build_style="python3-pep517" +hostmakedepends="python3-setuptools python3-wheel" depends="ansible-core" short_desc="Simple deployment, configuration management and execution framework" maintainer="Jan Christian Grünhage " license="GPL-3.0-or-later" homepage="https://www.ansible.com/" distfiles="${PYPI_SITE}/a/ansible/ansible-${version}.tar.gz" -checksum=6f2f762fca6cff0401a6d2119b8ba3b2f111ea1a93fd203c86df09bc75570f18 -# Tests are currently broken for ansible on python 3.10 -# See https://github.com/ansible/ansible/issues/74658 -# and https://github.com/ansible/ansible/issues/74660 +checksum=641a2c27bc5768f9a8ad14880f1f6e571c1f2af1d45e76f271d76e3f74754c53 +# Relevant tests happen in ansible-core make_check=no