Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Sep 2023 00:56:57 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: aebb0cb4a827 - main - devel/py-invoke: Change default shell from bash to sh
Message-ID:  <202309300056.38U0uvDK040838@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=aebb0cb4a8273d786504dc28027200ebd71a42ac

commit aebb0cb4a8273d786504dc28027200ebd71a42ac
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-30 00:33:29 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-30 00:46:34 +0000

    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>
---
 devel/py-invoke/Makefile         |  6 +++++
 devel/py-invoke/files/patch-bash | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)

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):



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309300056.38U0uvDK040838>