live-build/functions/echo.sh

71 lines
1.1 KiB
Bash
Raw Normal View History

2007-09-23 08:04:49 +00:00
#!/bin/sh
# echo.sh - define output methods
2008-03-06 14:43:00 -01:00
# Copyright (C) 2006-2008 Daniel Baumann <daniel@debian.org>
2007-09-23 08:04:49 +00:00
#
# 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
}
Echo_breakage ()
{
Echo_message "If the following stage fails, the most likely cause of the problem is with"
case "${LH_DISTRIBUTION}" in
sid|unstable)
Echo_message "your mirror configuration, a caching proxy or the sid distribution."
;;
*)
Echo_message "your mirror configuration or a caching proxy."
;;
esac
2008-06-15 00:58:07 +00:00
Echo_message "${@}"
}