-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(debug xtrace): failures with mksh and with rd.live.debug #2287
Conversation
What happens when /bin/sh points to mksh ? |
5f6fa41
to
82d2828
Compare
This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions. |
@LaszloGombos > What happens when /bin/sh points to mksh ? Independent of this code, with, Pull Request #2359 addresses this bug. |
@LaszloGombos > What happens when /bin/sh points to mksh ? -- bug 2 Independent of this code, when these conditions apply,
resolve_deps() will install mksh, as the source for Pull Request #2362 addresses this bug. |
This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions. |
Drop debug_on() debug_off() project-wide as setting xtrace is only local in mksh. Use set -x directly instead. And use the shell's 'local -' feature to automate the restoration of local xtrace option changes on function returns. This fixes the bug with rd.live.debug where the debug_on() call in the first getarg() call would fail to restore xtracing because RD_DEBUG was not set. This also allows rd.live.debug to be independent of rd.debug and eliminates 18 debug_off/debug_on calls. This feature is present in bash and dash and not needed in mksh. In mksh, local - (- alone) is an alias for typeset -p (synonymous with declare -p in bash). Use local - with additional arguments to avoid this alternate behavior in mksh. This code works with dash since v0.5.2 (2005-09-26) and with bash since v4.4 (2016-09-15). Replace the nulling of debug_on()/debug_off() functions in TEST-98-GETARG by overriding set +x in a temporary working copy of the relevant code to aid in debugging a getarg() failure.
This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions. |
Drop debug_on() debug_off() project-wide as setting xtrace is only
local in mksh. Use
set -x
directly instead. And use the shell'slocal -
feature to automate the restoration of local xtraceoption changes on function returns.
This fixes the bug with
rd.live.debug
where the debug_on() callin the first getarg() call would fail to restore xtracing because
RD_DEBUG
was not set. This also allowsrd.live.debug
to beindependent of
rd.debug
and eliminates 18 debug_off/debug_on calls.This feature is present in bash and dash and not needed in mksh.
In mksh,
local -
(-
alone) is an alias fortypeset -p
(synonymouswith
declare -p
in bash). Uselocal -
with additional arguments toavoid this alternate behavior in mksh.
This code works with dash since v0.5.2 (2005-09-26) and with bash
since v4.4 (2016-09-15).
Replace the nulling of debug_on()/debug_off() functions in
TEST-98-GETARG by overriding
set +x
in a temporary working copy ofthe relevant code to aid in debugging a getarg() failure.
Checklist