From nobody Sun Sep 10 01:16:10 2023 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RjsP71r1tz4sb3m for ; Sun, 10 Sep 2023 01:16:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RjsP64ssvz4NCZ for ; Sun, 10 Sep 2023 01:16:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694308570; a=rsa-sha256; cv=none; b=ZZvbD6e3GCtFKFXghoGwHw+45OE6oQXTQIKezinuoniuiFhqn1cbURY/ef391jYReexUiL vYX2NKmXfhIcwc/L74UFu+tbQJEXnmSZuH5BqJH5HNJHcCkvStIG02hoTpPhel2wOBuuOe 2bjdwfkd96Uepa9OH98+b0rP69rgpfUBJzd3JNPsfKZmvc/QZs0bza9LLDxJd+ZhDzWCL1 Jz4Y2AlOXlVw4RvDSULW2hsmOQXNNLOvlazFt8b3cO13FvEW0h7qkl1QPSwIS9CTpbIma1 ovyjamteqkEtpjzxaC3rBy0pVAj1SCTqUmen40JgynaSv6tSmS9zeqDxw/7aww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694308570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XY0FWSDUxeXnu3LubWdAGEw292UeN6CNIatjZ7vAHJ4=; b=eUPxa+nO0I17bP4Elk8qWfVWN8p8Pbi85/6HiF9k7MkmiHKZCZfWeJf19PExpLUHpPmz8x t1DVDLL2xeWTW7pTSZH0Sc4ZcEOyTG/IWWVTiWmMRdwyk226fMsaFZXYr+qLCwzu8jWXTG ADfbpHXwaFghug3LwkwOQsGbsTA9fGKnNJtJDRHSKgptCppsFJbnBMaFRPF2hi0Xzw3XQv GZQbwDl/1NgLf0Q5Bpmsg+VtqRcUf2Obrcsj/t1pyhqQgOW46ZnzxYWDIbzequZsIqiuoX Nigcq5btl8mCInHafCebzODRNF3WIfRwM2yyoatd6/kPYibQetEhBF7RMdKeRQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RjsP63stVzmjZ for ; Sun, 10 Sep 2023 01:16:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38A1GAIo042579 for ; Sun, 10 Sep 2023 01:16:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38A1GAFn042578 for ports-bugs@FreeBSD.org; Sun, 10 Sep 2023 01:16:10 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 273666] devel/py-invoke: Change default shell to /bin/sh, Add SUDO option Date: Sun, 10 Sep 2023 01:16:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: DtxdF@disroot.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: sunpoet@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273666 Bug ID: 273666 Summary: devel/py-invoke: Change default shell to /bin/sh, Add SUDO option Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: sunpoet@FreeBSD.org Reporter: DtxdF@disroot.org Flags: maintainer-feedback?(sunpoet@FreeBSD.org) Assignee: sunpoet@FreeBSD.org Attachment #244741 maintainer-approval+ Flags: Created attachment 244741 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D244741&action= =3Dedit py-invoke.patch Description: pyinvoke has some issues with the default shell [1], which is /bin/bash. Ma= ny unix-like systems don't have that shell but have /bin/sh. FreeBSD is one of them, so I think it is worth patching this port to use /bin/sh to avoid the error in Exception #1. I have added the SUDO option because it might be useful for those who use s= udo and it also solves the problem described in Exception #2. [1] https://github.com/pyinvoke/invoke/issues?q=3D%2Fbin%2Fsh Exception #1: ``` # python3.9 Python 3.9.17 (main, Aug 6 2023, 01:11:50) [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc= 1238 on freebsd13 Type "help", "copyright", "credits" or "license" for more information. >>> import invoke >>> invoke.run("whoami") Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.9/site-packages/invoke/__init__.py", line 50= , in run return Context().run(command, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/context.py", line 104= , in run return self._run(runner, command, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/context.py", line 113= , in _run return runner.run(command, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 395= , in run return self._run_body(command, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 440= , in _run_body self.start(command, self.opts["shell"], self.env) File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 133= 7, in start self.process =3D Popen( File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.9/subprocess.py", line 1837, in _execute_chi= ld raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/bin/bash' ``` Exception #2: ``` # python3.9 Python 3.9.18 (main, Sep 9 2023, 23:31:39) [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc= 1238 on freebsd13 Type "help", "copyright", "credits" or "license" for more information. >>> import invoke >>> invoke.run("whoami") root >>> invoke.sudo() Traceback (most recent call last): File "", line 1, in TypeError: sudo() missing 1 required positional argument: 'command' >>> invoke.sudo("whoami") /bin/sh: sudo: not found Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.9/site-packages/invoke/__init__.py", line 70= , in sudo return Context().sudo(command, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/context.py", line 185= , in sudo return self._sudo(runner, command, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/context.py", line 232= , in _sudo return runner.run(cmd_str, watchers=3Dwatchers, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 395= , in run return self._run_body(command, **kwargs) File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 451= , in _run_body return self.make_promise() if self._asynchronous else self._finish() File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 518= , in _finish raise UnexpectedExit(result) invoke.exceptions.UnexpectedExit: Encountered a bad command exit code! Command: "sudo -S -p '[sudo] password: ' whoami" Exit code: 127 Stdout: already printed Stderr: already printed ``` QA: * portlint: OK (looks fine.) * testport: OK (poudriere: 13.2-RELEASE, amd64, SUDO tested) --=20 You are receiving this mail because: You are the assignee for the bug.=