1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: still show systems stas when command has not produced debug.log file

When no debug.log* file is present whole stacktracking was skipped.
Add extra test the file exists to catch this case.
This commit is contained in:
Zdenek Kabelac 2016-04-20 23:19:33 +02:00
parent 22a71e1119
commit 545b58542c

View File

@ -147,11 +147,12 @@ STACKTRACE() {
local name local name
local idx local idx
for i in debug.log* ; do for i in debug.log* ; do
test -f "$i" || break # nothing is found (expands to debug.log*)
name=${i##debug.log_} name=${i##debug.log_}
name=${name%%_*} name=${name%%_*}
test "$name" = "DEBUG" && { name="$name$idx" ; idx=$(($idx + 1)) ; } test "$name" = "DEBUG" && { name="$name$idx" ; idx=$(($idx + 1)) ; }
echo "<======== Debug log $i ========>" echo "<======== Debug log $i ========>"
sed -e "s,^,## $name: ," $i sed -e "s,^,## $name: ," "$i"
done done
if test -e strace.log ; then if test -e strace.log ; then
echo "<======== Strace debug log ========>" echo "<======== Strace debug log ========>"