Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
aac9f089
Unverified
Commit
aac9f089
authored
Nov 15, 2019
by
neil
Committed by
GitHub
Nov 15, 2019
Browse files
Merge pull request #2583 from JohnVillalovos/dev
debug_bash_helper: Use eval as busybox systems have problems
parents
20b64c89
adce8f52
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
aac9f089
...
...
@@ -268,31 +268,31 @@ _usage() {
__debug_bash_helper() {
# At this point only do for --debug 3
if [ "${DEBUG:-$DEBUG_LEVEL_NONE}" -lt "$DEBUG_LEVEL_3" ]; then
echo ""
return
fi
# Return extra debug info when running with bash, otherwise return empty
# string.
if [ -z "${BASH_VERSION}" ]; then
echo ""
return
fi
# We are a bash shell at this point, return the filename, function name, and
# line number as a string
_dbh_saveIFS=$IFS
IFS=" "
# Must use eval or syntax error happens under dash
# Must use eval or syntax error happens under dash. The eval should use
# single quotes as older versions of busybox had a bug with double quotes and
# eval.
# Use 'caller 1' as we want one level up the stack as we should be called
# by one of the _debug* functions
eval
"
_dbh_called=($(caller 1))
"
eval
'
_dbh_called=($(caller 1))
'
IFS=$_dbh_saveIFS
_dbh_file=${_dbh_called[2]}
eval '
_dbh_file=${_dbh_called[2]}
'
if [ -n "${_script_home}" ]; then
# Trim off the _script_home directory name
_dbh_file=${_dbh_file#$_script_home/}
eval '
_dbh_file=${_dbh_file#$_script_home/}
'
fi
_dbh_function=${_dbh_called[1]}
_dbh_lineno=${_dbh_called[0]}
eval '
_dbh_function=${_dbh_called[1]}
'
eval '
_dbh_lineno=${_dbh_called[0]}
'
printf "%-40s " "$_dbh_file:${_dbh_function}:${_dbh_lineno}"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment