Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 650490 - app-eselect/eselect-sh should depend on its supported shells
Summary: app-eselect/eselect-sh should depend on its supported shells
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
: 650492 650494 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-14 14:45 UTC by Scall
Modified: 2018-03-14 19:25 UTC (History)
1 user (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 Scall 2018-03-14 14:45:25 UTC
app-eselect/eselect-sh should be added as a dependency to app-shells/dash

> grep SYMLINK_TARGETS /usr/share/eselect/modules/sh.eselect
SYMLINK_TARGETS=( bash dash posh mksh )
Comment 1 Mike Gilbert gentoo-dev 2018-03-14 14:49:50 UTC
No, such a dependency does not make sense.
Comment 2 Mike Gilbert gentoo-dev 2018-03-14 14:54:52 UTC
*** Bug 650492 has been marked as a duplicate of this bug. ***
Comment 3 Mike Gilbert gentoo-dev 2018-03-14 15:02:23 UTC
To elaborate, it is possible to use bash, dash, posh, or mksh without touching the /bin/sh symlink.

Further, using eselect-sh to update the symlink is not even necessary; it can be done with the ln command directly.

Conversely, it might makes sense to add a dependency like this in eselect-sh:

RDEPEND="|| ( app-shells/bash app-shells/dash app-shells/posh app-shells/mksh )"
Comment 4 Mike Gilbert gentoo-dev 2018-03-14 15:02:54 UTC
*** Bug 650494 has been marked as a duplicate of this bug. ***
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-14 15:40:23 UTC
Except this dependency doesn't really make any sense, given that bash is in @system for most of our profiles, so the dependency will always be satisfied.
Comment 6 Scall 2018-03-14 18:23:55 UTC
> Further, using eselect-sh to update the symlink is not even necessary; it
> can be done with the ln command directly.

Using the ln command mistakes are possibile, though. A typo in the shell name in "ln -sf shell /bin/sh" can be annoying if one doesn't notice it, especially after a reboot (e.g.: you may need to boot with the single or init=/bin/shell parameter to fix the symlink), and eselect-sh can prevent you from doing such mistakes.

Looking at the packages that depend on "app-eselect/eselect-vi", for example:

app-editors/elvis
app-editors/gvim
app-editors/nvi
app-editors/vile
app-editors/vim
app-editors/vis

I don't see why, analogously, "app-eselect/eselect-sh" shouldn't be a dependency of dash, posh, and mksh. It seems consistent to me.
Comment 7 Mike Gilbert gentoo-dev 2018-03-14 18:38:20 UTC
(In reply to Scall from comment #6)
> Looking at the packages that depend on "app-eselect/eselect-vi", for example:
> 
> app-editors/elvis
> app-editors/gvim
> app-editors/nvi
> app-editors/vile
> app-editors/vim
> app-editors/vis
> 
> I don't see why, analogously, "app-eselect/eselect-sh" shouldn't be a
> dependency of dash, posh, and mksh. It seems consistent to me.

Those ebuilds call "eselect vi" in pkg_postinst and pkg_postrm so the RDEPEND entry is necessary to ensure that will not fail.

No ebuild calls "eselect sh", so no dependency is necessary.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-14 19:25:12 UTC
The difference is that 'eselect vi' is 'officially' responsible for setting 'vi' symlink. The 'sh' symlink is instead part of the default setup, and 'eselect-sh' is just an 'extra' tool to switch it (which is not exactly 100% supported).