Summary: | app-admin/eselect: exits with no description when inherited lib is not readable | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Michał Górny <mgorny> |
Component: | eselect | Assignee: | Gentoo eselect Team <eselect> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | InVCS |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 475284 | ||
Bug Blocks: | |||
Attachments: | Patch for core.bash |
Description
Michał Górny
2013-01-10 10:25:00 UTC
Created attachment 335284 [details, diff]
Patch for core.bash
It correctly calls die(), but stderr is redirected during sourcing, so the output doesn't show.
Attached patch should fix it. I shall do some testing though, to see if it doesn't have unwanted side effects.
(In reply to comment #1) > It correctly calls die(), but stderr is redirected during sourcing, so the > output doesn't show. Sorry this is misleading. It should read: inherit() correctly calls die(), ... Comment on attachment 335284 [details, diff] Patch for core.bash >diff --git a/libs/core.bash.in b/libs/core.bash.in >index 4431a8f..960886b 100644 >--- a/libs/core.bash.in >+++ b/libs/core.bash.in >@@ -77,9 +77,9 @@ do_action() { > > modfile=$( es_find_module "${action}" ) > ( >- source "$ESELECT_DEFAULT_ACTIONS" 2>/dev/null \ >+ source "$ESELECT_DEFAULT_ACTIONS" \ > || die "Couldn't source ${ESELECT_DEFAULT_ACTIONS}" >- source "${modfile}" 2>/dev/null \ >+ source "${modfile}" \ > || die "Couldn't source ${modfile}" > if [[ -z ${subaction} ]] ; then > check_do "do_${DEFAULT_ACTION:-usage}" "$@" Hmm, I don't think that this redirect should affect 'die'… $ source /tmp/foo 2>/dev/null || { echo 11 >&2; } 11 (In reply to comment #3) > Hmm, I don't think that this redirect should affect 'die'… Have to tested the patch? The die in do_action wouldn't be affected, but it is never reached. The program dies in the inherit() function before, and there redirection is still active. (In reply to comment #4) > Have to tested the patch? s/to/you/ (In reply to comment #4) > (In reply to comment #3) > > Hmm, I don't think that this redirect should affect 'die'… > > Have to tested the patch? Hmm, indeed it works. > The die in do_action wouldn't be affected, but it is never reached. The > program dies in the inherit() function before, and there redirection is > still active. Ah, I understand it now. Well, that looks a bit like addressing one issue through introduce another (maybe lesser one). I'd rather work on making die() work independently of 2>/dev/null. Fixed in git: <http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=12e3ecb19d311b888abc118d806fee635602e3ee> Fixed in eselect-1.3.5. (In reply to Ulrich Müller from comment #7) > Fixed in git: > <http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit; > h=12e3ecb19d311b888abc118d806fee635602e3ee> This breaks bash on Mac OS X, see bug 475284. Reopening. Fixed in eselect 1.3.6. The stderr descriptor is now only saved for >=bash-4.1: <http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=3a412426d924310abb59311dd3cc1133eb1c6849> This means that the bug will still show up for users of bash 4.0 or lower. Please reopen if you think that this merits further attention. |