live-build/functions/echo.sh

55 lines
735 B
Bash
Raw Normal View History

2007-09-23 08:04:49 +00:00
#!/bin/sh
# echo.sh - define output methods
# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
#
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
set -e
Echo_debug ()
{
2007-09-23 08:04:51 +00:00
STRING="${1}"
2007-09-23 08:04:49 +00:00
if [ "${LH_DEBUG}" = "enabled" ]
2007-09-23 08:04:49 +00:00
then
2007-09-23 08:04:51 +00:00
echo "D: ${STRING}"
2007-09-23 08:04:49 +00:00
fi
}
Echo_error ()
{
2007-09-23 08:04:51 +00:00
STRING="${1}"
2007-09-23 08:05:09 +00:00
echo "E: ${STRING}" >&2
2007-09-23 08:04:49 +00:00
}
Echo_message ()
{
2007-09-23 08:04:51 +00:00
STRING="${1}"
2007-09-23 08:04:49 +00:00
if [ "${LH_QUIET}" != "enabled" ]
2007-09-23 08:04:49 +00:00
then
2007-09-23 08:04:51 +00:00
echo "P: ${STRING}"
2007-09-23 08:04:49 +00:00
fi
}
Echo_verbose ()
{
2007-09-23 08:04:51 +00:00
STRING="${1}"
2007-09-23 08:04:49 +00:00
if [ "${LH_VERBOSE}" = "enabled" ]
2007-09-23 08:04:49 +00:00
then
2007-09-23 08:04:51 +00:00
echo "I: ${STRING}"
2007-09-23 08:04:49 +00:00
fi
}
Echo_warning ()
{
2007-09-23 08:04:51 +00:00
STRING="${1}"
echo "W: ${STRING}"
2007-09-23 08:04:49 +00:00
}