summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2022-06-20 21:29:30 +0200
committerZorro Lang <zlang@kernel.org>2022-06-24 23:15:03 +0800
commitfdcff5481a8611f240bc00ea5175faeb9fa2262e (patch)
tree9effa8c2d13f8008a275bbd04f0c45d2406857a3 /check
parent0730b5a94e0fc4e3e8a69f67c1122d1dbcefe90f (diff)
check: simplify check.time parsing
There's no need to use grep and awk when the latter can do all that's needed, including the pretty printing. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'check')
-rwxr-xr-xcheck10
1 files changed, 3 insertions, 7 deletions
diff --git a/check b/check
index 42925e09..43c072d2 100755
--- a/check
+++ b/check
@@ -819,13 +819,9 @@ function run_section()
try="$try $seqnum"
n_try=`expr $n_try + 1`
- # slashes now in names, sed barfs on them so use grep
- lasttime=`grep -w ^$seqnum $check.time | awk '// {print $2}'`
- if [ "X$lasttime" != X ]; then
- echo -n " ${lasttime}s ... "
- else
- echo -n " " # prettier output with timestamps.
- fi
+ awk 'BEGIN {lasttime=" "} \
+ $1 == "'$seqnum'" {lasttime=" " $2 "s ... "; exit} \
+ END {printf "%s", lasttime}' "$check.time"
rm -f core $seqres.notrun
start=`_wallclock`