From 1319bd8709d0dc7b3161c0c346eb935e03496f59 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Wed, 26 Oct 2022 05:33:22 +0200 Subject: dev-python/k5test: Patch out the dep on which(1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- dev-python/k5test/files/k5test-0.10.1-which.patch | 41 +++++++++++++++++++++++ dev-python/k5test/k5test-0.10.1-r1.ebuild | 24 ------------- dev-python/k5test/k5test-0.10.1-r2.ebuild | 24 +++++++++++++ 3 files changed, 65 insertions(+), 24 deletions(-) create mode 100644 dev-python/k5test/files/k5test-0.10.1-which.patch delete mode 100644 dev-python/k5test/k5test-0.10.1-r1.ebuild create mode 100644 dev-python/k5test/k5test-0.10.1-r2.ebuild (limited to 'dev-python/k5test') diff --git a/dev-python/k5test/files/k5test-0.10.1-which.patch b/dev-python/k5test/files/k5test-0.10.1-which.patch new file mode 100644 index 000000000000..c5a72b5dc091 --- /dev/null +++ b/dev-python/k5test/files/k5test-0.10.1-which.patch @@ -0,0 +1,41 @@ +From cff2138124cb7461fe2b1a270d0c0132e6f66f6b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Wed, 26 Oct 2022 05:31:22 +0200 +Subject: [PATCH] Use built-in shutil.which() instead of which(1) tool + +Use the built-in shutil.which() function that is available since Python +3.3 instead of the external which(1) program. The latter is not part +of POSIX and may be missing entirely (Gentoo is activately working +towards removing it)> +--- + k5test/realm.py | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/k5test/realm.py b/k5test/realm.py +index 8b24141..2260258 100644 +--- a/k5test/realm.py ++++ b/k5test/realm.py +@@ -68,16 +68,13 @@ def _cfg_merge(cfg1, cfg2): + + + def _discover_path(name, default, paths): +- stderr_out = subprocess.DEVNULL +- try: +- path = subprocess.check_output(["which", name], stderr=stderr_out).strip() +- path = path.decode(sys.getfilesystemencoding() or sys.getdefaultencoding()) ++ path = shutil.which(name) ++ if path is not None: + _LOG.debug(f"Using discovered path for {name} ({path})") +- return path +- except subprocess.CalledProcessError as e: ++ else: + path = paths.get(name, default) + _LOG.debug(f"Using default path for {name} ({path}): {e}") +- return path ++ return path + + + class K5Realm(metaclass=abc.ABCMeta): +-- +2.38.1 + diff --git a/dev-python/k5test/k5test-0.10.1-r1.ebuild b/dev-python/k5test/k5test-0.10.1-r1.ebuild deleted file mode 100644 index ea7af94b2982..000000000000 --- a/dev-python/k5test/k5test-0.10.1-r1.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2021-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..11} ) - -inherit distutils-r1 - -DESCRIPTION="Library for testing Python applications in Kerberos 5 environments" -HOMEPAGE=" - https://github.com/pythongssapi/k5test/ - https://pypi.org/project/k5test/ -" -SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="amd64 ~arm arm64 ~riscv x86" - -RDEPEND=" - sys-apps/which -" diff --git a/dev-python/k5test/k5test-0.10.1-r2.ebuild b/dev-python/k5test/k5test-0.10.1-r2.ebuild new file mode 100644 index 000000000000..aa48a24cd102 --- /dev/null +++ b/dev-python/k5test/k5test-0.10.1-r2.ebuild @@ -0,0 +1,24 @@ +# Copyright 2021-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..11} ) + +inherit distutils-r1 + +DESCRIPTION="Library for testing Python applications in Kerberos 5 environments" +HOMEPAGE=" + https://github.com/pythongssapi/k5test/ + https://pypi.org/project/k5test/ +" +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 ~arm arm64 ~riscv x86" + +PATCHES=( + "${FILESDIR}"/${P}-which.patch +) -- cgit v1.2.3-65-gdbad