Exclude prep and distclean from autolog
This commit is contained in:
parent
697f9cff21
commit
e0ec247848
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
# Automatic logging is enabled by default
|
# Automatic logging is enabled by default
|
||||||
autolog=1
|
autolog=1
|
||||||
|
# Don't log these methods
|
||||||
|
nolog="prep distclean"
|
||||||
|
|
||||||
# Define script functions and register them
|
# Define script functions and register them
|
||||||
METHODS=""
|
METHODS=""
|
||||||
@ -67,7 +69,7 @@ build_sh() {
|
|||||||
|
|
||||||
for METHOD in $*
|
for METHOD in $*
|
||||||
do
|
do
|
||||||
( log_start $METHOD; $METHOD; log_stop )
|
( log_start $METHOD; $METHOD; log_stop $METHOD )
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +82,7 @@ log_start()
|
|||||||
local func=$1
|
local func=$1
|
||||||
build_sh_logfile=${topdir}-${version}_${pkgver}-${os}-${arch}-${func}-$(date +%Y%m%d%H%M%S).log
|
build_sh_logfile=${topdir}-${version}_${pkgver}-${os}-${arch}-${func}-$(date +%Y%m%d%H%M%S).log
|
||||||
|
|
||||||
if [ $autolog -eq 1 ]; then
|
if [ $autolog -eq 1 -a -z "$(${__expr} "$nolog" : ".*\($func\)")" ]; then
|
||||||
# save stdout and stderr to file descriptors 3 and 4
|
# save stdout and stderr to file descriptors 3 and 4
|
||||||
# then redirect them to $build_sh_logfile
|
# then redirect them to $build_sh_logfile
|
||||||
echo "Opening logfile: $build_sh_logfile"
|
echo "Opening logfile: $build_sh_logfile"
|
||||||
@ -95,7 +97,8 @@ log_start()
|
|||||||
# Stop logging
|
# Stop logging
|
||||||
log_stop()
|
log_stop()
|
||||||
{
|
{
|
||||||
if [ $autolog -eq 1 ]; then
|
local func=$1
|
||||||
|
if [ $autolog -eq 1 -a -z "$(${__expr} "$nolog" : ".*\($func\)")" ]; then
|
||||||
# Log a timestamp
|
# Log a timestamp
|
||||||
date +%Y%m%d%H%M%S
|
date +%Y%m%d%H%M%S
|
||||||
# restore stdout and stderr
|
# restore stdout and stderr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user