classes/logging: allow shell message functions to work in devshell
Fix a regression caused by the shell message changes - if you run a shell task's runfile, the task isn't actually running in BitBake and thus the message FIFO won't exist - so we should just fall back to printing the message with echo as we did before so that the run files are still useful. (From OE-Core rev: 607d3306f7abef057693dcb6aac1f7b26880181d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
ddc1df3e80
commit
e60597abb7
|
@ -9,34 +9,54 @@ LOGFIFO = "${T}/fifo.${@os.getpid()}"
|
||||||
# tasks that should be seen on the console. Use sparingly.
|
# tasks that should be seen on the console. Use sparingly.
|
||||||
# Output: logs console
|
# Output: logs console
|
||||||
bbplain() {
|
bbplain() {
|
||||||
printf "%b\0" "bbplain $*" > ${LOGFIFO}
|
if [ -p ${LOGFIFO} ] ; then
|
||||||
|
printf "%b\0" "bbplain $*" > ${LOGFIFO}
|
||||||
|
else
|
||||||
|
echo "$*"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Notify the user of a noteworthy condition.
|
# Notify the user of a noteworthy condition.
|
||||||
# Output: logs
|
# Output: logs
|
||||||
bbnote() {
|
bbnote() {
|
||||||
printf "%b\0" "bbnote $*" > ${LOGFIFO}
|
if [ -p ${LOGFIFO} ] ; then
|
||||||
|
printf "%b\0" "bbnote $*" > ${LOGFIFO}
|
||||||
|
else
|
||||||
|
echo "NOTE: $*"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print a warning to the log. Warnings are non-fatal, and do not
|
# Print a warning to the log. Warnings are non-fatal, and do not
|
||||||
# indicate a build failure.
|
# indicate a build failure.
|
||||||
# Output: logs console
|
# Output: logs console
|
||||||
bbwarn() {
|
bbwarn() {
|
||||||
printf "%b\0" "bbwarn $*" > ${LOGFIFO}
|
if [ -p ${LOGFIFO} ] ; then
|
||||||
|
printf "%b\0" "bbwarn $*" > ${LOGFIFO}
|
||||||
|
else
|
||||||
|
echo "WARNING: $*"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print an error to the log. Errors are non-fatal in that the build can
|
# Print an error to the log. Errors are non-fatal in that the build can
|
||||||
# continue, but they do indicate a build failure.
|
# continue, but they do indicate a build failure.
|
||||||
# Output: logs console
|
# Output: logs console
|
||||||
bberror() {
|
bberror() {
|
||||||
printf "%b\0" "bberror $*" > ${LOGFIFO}
|
if [ -p ${LOGFIFO} ] ; then
|
||||||
|
printf "%b\0" "bberror $*" > ${LOGFIFO}
|
||||||
|
else
|
||||||
|
echo "ERROR: $*"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print a fatal error to the log. Fatal errors indicate build failure
|
# Print a fatal error to the log. Fatal errors indicate build failure
|
||||||
# and halt the build, exiting with an error code.
|
# and halt the build, exiting with an error code.
|
||||||
# Output: logs console
|
# Output: logs console
|
||||||
bbfatal() {
|
bbfatal() {
|
||||||
printf "%b\0" "bbfatal $*" > ${LOGFIFO}
|
if [ -p ${LOGFIFO} ] ; then
|
||||||
|
printf "%b\0" "bbfatal $*" > ${LOGFIFO}
|
||||||
|
else
|
||||||
|
echo "ERROR: $*"
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +64,11 @@ bbfatal() {
|
||||||
# bitbake's UI.
|
# bitbake's UI.
|
||||||
# Output: logs console
|
# Output: logs console
|
||||||
bbfatal_log() {
|
bbfatal_log() {
|
||||||
printf "%b\0" "bbfatal_log $*" > ${LOGFIFO}
|
if [ -p ${LOGFIFO} ] ; then
|
||||||
|
printf "%b\0" "bbfatal_log $*" > ${LOGFIFO}
|
||||||
|
else
|
||||||
|
echo "ERROR: $*"
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +92,10 @@ bbdebug() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# All debug output is printed to the logs
|
# All debug output is printed to the logs
|
||||||
printf "%b\0" "bbdebug $DBGLVL $*" > ${LOGFIFO}
|
if [ -p ${LOGFIFO} ] ; then
|
||||||
|
printf "%b\0" "bbdebug $DBGLVL $*" > ${LOGFIFO}
|
||||||
|
else
|
||||||
|
echo "DEBUG: $*"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue