aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-09-30 00:33:29 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-09-30 00:46:34 +0000
commitaebb0cb4a8273d786504dc28027200ebd71a42ac (patch)
tree82cb131512764a92efdd63b4ee122b3f9e84b3d6
parentdc16c9a9a5abf38e8d5f44d5352d1df520673411 (diff)
downloadports-aebb0cb4a8273d786504dc28027200ebd71a42ac.tar.gz
ports-aebb0cb4a8273d786504dc28027200ebd71a42ac.zip
devel/py-invoke: Change default shell from bash to sh
- Add SUDO option - Bump PORTREVISION for package change PR: 273666 Reported by: Jesus Daniel Colmenares Oviedo <DtxdF@disroot.org>
-rw-r--r--devel/py-invoke/Makefile6
-rw-r--r--devel/py-invoke/files/patch-bash55
2 files changed, 61 insertions, 0 deletions
diff --git a/devel/py-invoke/Makefile b/devel/py-invoke/Makefile
index 75bb7cf7cc8c..f41270c056b5 100644
--- a/devel/py-invoke/Makefile
+++ b/devel/py-invoke/Makefile
@@ -1,5 +1,6 @@
PORTNAME= invoke
PORTVERSION= 2.2.0
+PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -17,4 +18,9 @@ USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
+OPTIONS_DEFINE= SUDO
+SUDO_DESC= Run shell commands via sudo
+
+SUDO_RUN_DEPENDS= sudo:security/sudo
+
.include <bsd.port.mk>
diff --git a/devel/py-invoke/files/patch-bash b/devel/py-invoke/files/patch-bash
new file mode 100644
index 000000000000..28f539d0b49f
--- /dev/null
+++ b/devel/py-invoke/files/patch-bash
@@ -0,0 +1,55 @@
+--- invoke/config.py.orig 2023-07-12 18:04:20 UTC
++++ invoke/config.py
+@@ -440,16 +440,16 @@ class Config(DataProxy):
+
+ .. versionadded:: 1.0
+ """
+- # On Windows, which won't have /bin/bash, check for a set COMSPEC env
++ # On Windows, which won't have /bin/sh, check for a set COMSPEC env
+ # var (https://en.wikipedia.org/wiki/COMSPEC) or fallback to an
+ # unqualified cmd.exe otherwise.
+ if WINDOWS:
+ shell = os.environ.get("COMSPEC", "cmd.exe")
+- # Else, assume Unix, most distros of which have /bin/bash available.
++ # Else, assume Unix, most distros of which have /bin/sh available.
+ # TODO: consider an automatic fallback to /bin/sh for systems lacking
+ # /bin/bash; however users may configure run.shell quite easily, so...
+ else:
+- shell = "/bin/bash"
++ shell = "/bin/sh"
+
+ return {
+ # TODO: we document 'debug' but it's not truly implemented outside
+--- invoke/runners.py.orig 2023-05-23 15:52:36 UTC
++++ invoke/runners.py
+@@ -335,7 +335,7 @@ class Runner:
+ Default: ``False``.
+
+ :param str shell:
+- Which shell binary to use. Default: ``/bin/bash`` (on Unix;
++ Which shell binary to use. Default: ``/bin/sh`` (on Unix;
+ ``COMSPEC`` or ``cmd.exe`` on Windows.)
+
+ :param timeout:
+--- tests/config.py.orig 2023-07-12 18:04:20 UTC
++++ tests/config.py
+@@ -107,7 +107,7 @@ class Config_:
+ "out_stream": None,
+ "pty": False,
+ "replace_env": False,
+- "shell": "/bin/bash",
++ "shell": "/bin/sh",
+ "warn": False,
+ "watchers": [],
+ },
+--- tests/runners.py.orig 2023-05-02 02:12:54 UTC
++++ tests/runners.py
+@@ -81,7 +81,7 @@ def _expect_platform_shell(shell):
+ if WINDOWS:
+ assert shell.endswith("cmd.exe")
+ else:
+- assert shell == "/bin/bash"
++ assert shell == "/bin/sh"
+
+
+ def _make_tcattrs(cc_is_ints=True, echo=False):