Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 720996 - app-eselect/eselect-sh: consider not offering posh as an option
Summary: app-eselect/eselect-sh: consider not offering posh as an option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-04 20:40 UTC by kfm
Modified: 2020-05-17 13:36 UTC (History)
0 users

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 kfm 2020-05-04 20:40:13 UTC
Although posh definitely has some utility with respect to portability testing, it is not a compliant implementation of the Shell Command Language, as defined by POSIX.1-2008 or later. For example:

  $ posh -c 'command -v ls'
  command: invalid option -- 'v'
  $ posh -c 'command -V ls'
  command: invalid option -- 'V

This is an example of two switches that were optional in POSIX.1-2004, per the "User Portability Utilities" provisions, but not as of POSIX.1-2008.

In my view, this doesn't cut it in 2020. For a Gentoo user to select a /bin/sh implementation that is only compliant with the mandatory parts of POSIX.1-2004 stands a high chance of failing with scripts in the wild. If that does not seem sufficently persuasive, consider that there is no shortage of openrc runscripts that will break, including "bootmisc", "local", "loopback" and "net.lo".

Essentially, nobody in the Linux world is really interested in strict POSIX.1-2004 compliance at this juncture. It's hard enough to get people to write scripts that are even compliant with the current specs [1]. Therefore, I suggest simply not offering posh as an option in eselect-sh.

[1] For instance, gentoo runscripts constantly use the entirely non-standard local keyword although that is the fault of their authors and not posh, which is definitely under no obligation to implement it.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-05-17 13:34:08 UTC
I guess this makes sense.
Comment 2 Larry the Git Cow gentoo-dev 2020-05-17 13:36:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=761b42c9fdae7c8cd01615be8d2b4f6cad5c3443

commit 761b42c9fdae7c8cd01615be8d2b4f6cad5c3443
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-05-17 13:35:35 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-05-17 13:36:36 +0000

    app-eselect/eselect-sh: Remove posh from targets
    
    Closes: https://bugs.gentoo.org/720996
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 app-eselect/eselect-sh/eselect-sh-0.4.1.ebuild | 21 +++++++++++++++++++++
 app-eselect/eselect-sh/files/sh.eselect-0.4.1  | 13 +++++++++++++
 2 files changed, 34 insertions(+)