Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
66aabc77
Commit
66aabc77
authored
Dec 30, 2013
by
korex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added two functions for additional script-debug
parent
5a79f467
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
1 deletion
+65
-1
common
share/eterbuild/functions/common
+65
-1
No files found.
share/eterbuild/functions/common
View file @
66aabc77
...
@@ -128,15 +128,79 @@ print_list()
...
@@ -128,15 +128,79 @@ print_list()
done
done
}
}
# Function debug_print_var()
# show at point of call name of function that called her
# and show list values of variables, defined in parameters.
#
# Difference between function assert_var() -
# assert_var() call fatal() if variable not defined.
debug_print_var
()
{
local
i re
echo
echo
"==================================================="
echo
"Into function :
${
FUNCNAME
[1]
}
"
echo
echo
"Watch of variables :"
echo
"------------------------------------------"
for
i
in
$@
do
re
=
$(
eval echo
\$
$i
)
if
[
-n
"
$re
"
]
then
echo
"
${
i
}
=
${
re
}
"
else
echo
"Variable
${
i
}
NOT DEFINED !!!"
fi
done
echo
"------------------------------------------"
echo
"==================================================="
}
# Function debug_print_backtrace() show all functions
# (call stack of functions),
# that called before this funcions (callback list)
debug_print_backtrace
()
{
echo
echo
"==================================================="
echo
"Into function :
${
FUNCNAME
[1]
}
"
local
i
=
1
while
[
-n
"
${
FUNCNAME
[i]
}
"
]
do
echo
" Callback N
${
i
}
:
${
FUNCNAME
[i]
}
"
let
"i+=1"
done
echo
"==================================================="
}
# Function assert_var() also show callstack, if assert variable is empty.
assert_var
()
assert_var
()
{
{
local
i re
local
i re
for
i
in
$@
;
do
for
i
in
$@
;
do
re
=
$(
eval echo
\$
$i
)
re
=
$(
eval echo
\$
$i
)
[
-n
"
$re
"
]
||
fatal
"assert:
$i
nonexist"
if
[
-z
"
$re
"
]
then
debug_print_backtrace
fatal
"assert:
$i
nonexist"
fi
done
done
}
}
prepare_rpmdir
()
prepare_rpmdir
()
{
{
assert_var RPMTOPDIR LOGDIR
assert_var RPMTOPDIR LOGDIR
...
...
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