Skip to content

Commit cde6bcb

Browse files
authored
Merge pull request #3855 from citrus-it/pipelog
Use pipelog() in more places
2 parents 8028ea6 + a142be7 commit cde6bcb

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/functions.sh

+10-9
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ EOM
178178
#############################################################################
179179
# Log output of a command to a file
180180
#############################################################################
181+
182+
pipelog() {
183+
$TEE -a $LOGFILE 2>&1
184+
}
185+
181186
logcmd() {
182187
typeset preserve_stdout=0
183188
[ "$1" = "-p" ] && shift && preserve_stdout=1
@@ -191,18 +196,14 @@ logcmd() {
191196
else
192197
if [ "$preserve_stdout" = 0 ]; then
193198
echo Running: "$@"
194-
"$@" | $TEE -a $LOGFILE 2>&1
199+
"$@" | pipelog
195200
return ${PIPESTATUS[0]}
196201
else
197202
"$@"
198203
fi
199204
fi
200205
}
201206

202-
pipelog() {
203-
$TEE -a $LOGFILE 2>&1
204-
}
205-
206207
c_highlight="`$TPUT setaf 2`"
207208
c_error="`$TPUT setaf 1`"
208209
c_note="`$TPUT setaf 6`"
@@ -3596,7 +3597,7 @@ check_rtime() {
35963597
-f $TMPDIR/rtime.files
35973598

35983599
if [ -s "$TMPDIR/rtime.err" ]; then
3599-
$CAT $TMPDIR/rtime.err | $TEE -a $LOGFILE
3600+
$CAT $TMPDIR/rtime.err | pipelog
36003601
logerr "ELF runtime problems detected"
36013602
fi
36023603
}
@@ -3614,7 +3615,7 @@ check_ssp() {
36143615
done < <(rtime_objects)
36153616
wait
36163617
if [ -s "$TMPDIR/rtime.ssp" ]; then
3617-
$CAT $TMPDIR/rtime.ssp | $TEE -a $LOGFILE
3618+
$CAT $TMPDIR/rtime.ssp | pipelog
36183619
logerr "Found object(s) without SSP"
36193620
fi
36203621
}
@@ -3653,7 +3654,7 @@ check_soname() {
36533654
done < <(rtime_objects -f)
36543655
wait
36553656
if [ -s "$TMPDIR/rtime.soname" ]; then
3656-
$CAT $TMPDIR/rtime.soname | $TEE -a $LOGFILE
3657+
$CAT $TMPDIR/rtime.soname | pipelog
36573658
logerr "Found SONAME problems"
36583659
fi
36593660
}
@@ -3678,7 +3679,7 @@ check_bmi() {
36783679
done < <(rtime_objects)
36793680
wait
36803681
if [ -s "$TMPDIR/rtime.bmi" ]; then
3681-
$CAT $TMPDIR/rtime.bmi | $TEE -a $LOGFILE
3682+
$CAT $TMPDIR/rtime.bmi | pipelog
36823683
logerr "BMI instruction set found"
36833684
fi
36843685
}

0 commit comments

Comments
 (0)