Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 822033 - sys-apps/portage: bash_command_not_found_re does not detect command not found when sh is busybox
Summary: sys-apps/portage: bash_command_not_found_re does not detect command not found...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 919862
Blocks: nonbash
  Show dependency tree
 
Reported: 2021-11-06 00:06 UTC by Zac Medico
Modified: 2024-04-11 01:02 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2021-11-06 00:06:59 UTC
Continued from bug 727832 comment 6, bash_command_not_found_re does not handle the case where sh is busybox:

> $ ash -c 'foo'
> ash: foo: not found

lib/portage/package/ebuild/doebuild.py:    bash_command_not_found_re = re.compile(
lib/portage/package/ebuild/doebuild.py-        r"(.*): line (\d*): (.*): command not found$"
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-11-06 07:33:07 UTC
If sh is busybox, then command-not-found detection not working properly is the least of our worries.  IIRC busybox sh isn't POSIX-compliant.
Comment 2 Fabian Groffen gentoo-dev 2021-11-06 07:58:09 UTC
While at it:

% dash -c foo
dash: 1: foo: not found
Comment 3 orbea 2022-06-18 17:22:55 UTC
Another one...

$ mksh -c 'foo'
mksh: foo: inaccessible or not found
Comment 4 Larry the Git Cow gentoo-dev 2023-12-20 14:04:23 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=a2409ba65d38d2eb8cb3923733d9062e3b4da1ad

commit a2409ba65d38d2eb8cb3923733d9062e3b4da1ad
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: 2023-12-20 05:56:53 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-20 14:04:12 +0000

    ebuild: command not found QA: detect in dash as well
    
    Bug: https://bugs.gentoo.org/822033
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/portage/package/ebuild/doebuild.py | 7 +++++++
 1 file changed, 7 insertions(+)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-20 14:05:37 UTC
I'll add a depends-on for portage-3.0.59, but we shouldn't close this on release given busybox/mksh isn't covered. Not that I really think busybox is a suitable /bin/sh.
Comment 6 Eli Schwartz gentoo-dev 2023-12-20 14:11:20 UTC
I'll also note that I kinda have zero interest in mksh on a personal level, and while I do like busybox as a general thing I have *negative* interest in it as a general purpose /bin/sh and would strongly prefer refusing to support it.

Someone other than me should add support for mksh though. :D
Comment 7 Larry the Git Cow gentoo-dev 2023-12-27 21:28:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a1f19cdd7a598070b7eb08b3954e677aa4868ad

commit 0a1f19cdd7a598070b7eb08b3954e677aa4868ad
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-12-27 21:27:55 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-27 21:28:01 +0000

    sys-apps/portage: add 3.0.59
    
    Closes: https://bugs.gentoo.org/587088
    Closes: https://bugs.gentoo.org/822033
    Closes: https://bugs.gentoo.org/915494
    Closes: https://bugs.gentoo.org/916135
    Closes: https://bugs.gentoo.org/917120
    Closes: https://bugs.gentoo.org/919862
    Closes: https://bugs.gentoo.org/920095
    Closes: https://bugs.gentoo.org/920258
    Closes: https://bugs.gentoo.org/920537
    Closes: https://bugs.gentoo.org/920654
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.59.ebuild | 246 +++++++++++++++++++++++++++++++++
 2 files changed, 247 insertions(+)