2007-09-23 08:04:49 +00:00
#!/bin/sh
2010-09-02 11:12:37 +00:00
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
##
## live-build 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.
2007-09-23 08:04:49 +00:00
2008-08-14 18:25:29 +00:00
Echo ( )
{
STRING = " ${ 1 } "
shift
2008-11-01 12:52:35 -01:00
if [ " ${ _L10N } " = "false" ]
2008-10-29 07:36:29 -01:00
then
2008-11-13 13:00:42 -01:00
printf " ${ STRING } \n " " ${ @ } "
2008-10-29 07:36:29 -01:00
else
printf " $( eval_gettext " ${ STRING } " ) " " ${ @ } " ; echo;
fi
2008-08-14 18:25:29 +00:00
}
2007-09-23 08:04:49 +00:00
Echo_debug ( )
{
2009-12-13 19:17:45 -01:00
if [ " ${ _DEBUG } " = "true" ]
2007-09-23 08:04:49 +00:00
then
2008-11-01 14:31:26 -01:00
STRING = " ${ 1 } "
shift
2008-11-01 12:52:35 -01:00
if [ " ${ _L10N } " = "false" ]
2008-10-29 07:36:29 -01:00
then
2008-11-13 13:00:42 -01:00
printf " D: ${ STRING } \n " " ${ @ } "
2008-10-29 07:36:29 -01:00
else
printf " D: $( eval_gettext " ${ STRING } " ) " " ${ @ } " ; echo;
fi
2007-09-23 08:04:49 +00:00
fi
}
2008-11-01 14:31:26 -01:00
Echo_debug_running ( )
{
2009-12-13 19:17:45 -01:00
if [ " ${ _DEBUG } " = "true" ]
2008-11-01 14:31:26 -01:00
then
STRING = " ${ 1 } "
shift
if [ " ${ _L10N } " = "false" ]
then
2008-11-13 13:00:42 -01:00
printf " D: ${ STRING } " " ${ @ } "
2008-11-01 14:31:26 -01:00
else
printf " D: $( eval_gettext " ${ STRING } " ) " " ${ @ } "
fi
if [ " ${ _COLOR } " = "false" ]
then
printf "..."
else
printf " ... ${ YELLOW } ${ BLINK } running ${ NO_COLOR } "
fi
fi
}
2007-09-23 08:04:49 +00:00
Echo_error ( )
{
2007-09-23 08:04:51 +00:00
STRING = " ${ 1 } "
2008-08-11 20:28:54 +00:00
shift
2007-09-23 08:04:51 +00:00
2008-11-01 14:31:26 -01:00
if [ " ${ _COLOR } " = "false" ]
then
printf "E:"
else
printf " ${ RED } E ${ NO_COLOR } : "
fi
2008-11-01 12:52:35 -01:00
if [ " ${ _L10N } " = "false" ]
2008-10-29 07:36:29 -01:00
then
2009-01-15 00:45:51 -01:00
printf " ${ STRING } \n " " ${ @ } " >& 2
2008-10-29 07:36:29 -01:00
else
2009-01-15 00:45:51 -01:00
( printf " $( eval_gettext " ${ STRING } " ) " " ${ @ } " ; echo; ) >& 2
2008-10-29 07:36:29 -01:00
fi
2007-09-23 08:04:49 +00:00
}
Echo_message ( )
{
2009-12-13 19:17:45 -01:00
if [ " ${ _QUIET } " != "true" ]
2008-11-01 14:31:26 -01:00
then
STRING = " ${ 1 } "
shift
2007-09-23 08:04:51 +00:00
2008-11-01 14:31:26 -01:00
if [ " ${ _COLOR } " = "false" ]
then
printf "P:"
else
printf " ${ WHITE } P ${ NO_COLOR } : "
fi
if [ " ${ _L10N } " = "false" ]
then
2008-11-13 13:00:42 -01:00
printf " ${ STRING } \n " " ${ @ } "
2008-11-01 14:31:26 -01:00
else
printf " $( eval_gettext " ${ STRING } " ) " " ${ @ } " ; echo;
fi
fi
}
Echo_message_running ( )
{
2009-12-13 19:17:45 -01:00
if [ " ${ _QUIET } " != "true" ]
2007-09-23 08:04:49 +00:00
then
2008-11-01 14:31:26 -01:00
STRING = " ${ 1 } "
shift
if [ " ${ _COLOR } " = "false" ]
then
printf "P:"
else
printf " ${ WHITE } P ${ NO_COLOR } : "
fi
2008-11-01 12:52:35 -01:00
if [ " ${ _L10N } " = "false" ]
2008-10-29 07:36:29 -01:00
then
2008-11-13 13:00:42 -01:00
printf " ${ STRING } " " ${ @ } "
2008-11-01 14:31:26 -01:00
else
printf " $( eval_gettext " ${ STRING } " ) " " ${ @ } " ;
fi
if [ " ${ _COLOR } " = "false" ]
then
2008-11-21 10:43:40 -01:00
printf "..."
2008-10-29 07:36:29 -01:00
else
2008-11-01 14:31:26 -01:00
printf " ... ${ YELLOW } ${ BLINK } running ${ NO_COLOR } "
2008-10-29 07:36:29 -01:00
fi
2007-09-23 08:04:49 +00:00
fi
}
Echo_verbose ( )
{
2009-12-13 19:17:45 -01:00
if [ " ${ _VERBOSE } " = "true" ]
2007-09-23 08:04:49 +00:00
then
2008-11-01 14:31:26 -01:00
STRING = " ${ 1 } "
shift
2008-11-01 12:52:35 -01:00
if [ " ${ _L10N } " = "false" ]
2008-10-29 07:36:29 -01:00
then
2008-11-13 13:00:42 -01:00
printf " I: ${ STRING } \n " " ${ @ } "
2008-10-29 07:36:29 -01:00
else
printf " I: $( eval_gettext " ${ STRING } " ) " " ${ @ } " ; echo;
fi
2007-09-23 08:04:49 +00:00
fi
}
2008-11-01 14:31:26 -01:00
Echo_verbose_running ( )
{
2009-12-13 19:17:45 -01:00
if [ " ${ _VERBOSE } " != "true" ]
2008-11-01 14:31:26 -01:00
then
STRING = " ${ 1 } "
shift
if [ " ${ _L10N } " = "false" ]
then
2008-11-13 13:00:42 -01:00
printf " I: ${ STRING } " " ${ @ } "
2008-11-01 14:31:26 -01:00
else
printf " I: $( eval_gettext " ${ STRING } " ) " " ${ @ } " ;
fi
if [ " ${ _COLOR } " = "false" ]
then
2008-11-21 10:43:40 -01:00
printf "..."
2008-11-01 14:31:26 -01:00
else
printf " ... ${ YELLOW } ${ BLINK } running ${ NO_COLOR } "
fi
fi
}
2007-09-23 08:04:49 +00:00
Echo_warning ( )
{
2007-09-23 08:04:51 +00:00
STRING = " ${ 1 } "
2008-08-11 20:28:54 +00:00
shift
2007-09-23 08:04:51 +00:00
2008-11-01 14:31:26 -01:00
if [ " ${ _COLOR } " = "false" ]
then
printf "W:"
else
printf " ${ YELLOW } W ${ NO_COLOR } : "
fi
2008-11-01 12:52:35 -01:00
if [ " ${ _L10N } " = "false" ]
2008-10-29 07:36:29 -01:00
then
2008-11-13 13:00:42 -01:00
printf " ${ STRING } \n " " ${ @ } "
2008-10-29 07:36:29 -01:00
else
2008-11-02 10:55:04 -01:00
printf " $( eval_gettext " ${ STRING } " ) " " ${ @ } " ; echo;
2008-10-29 07:36:29 -01:00
fi
2007-09-23 08:04:49 +00:00
}
2008-06-14 17:25:05 +00:00
2008-11-01 14:31:26 -01:00
Echo_status ( )
{
__RETURN = " ${ ? } "
if [ " ${ _COLOR } " = "false" ]
then
if [ " ${ __RETURN } " = "0" ]
then
printf " done.\n"
else
printf " failed.\n"
fi
else
Cursor_columns_backward 8
if [ " ${ __RETURN } " = "0" ]
then
printf " ${ GREEN } done ${ NO_COLOR } . \n "
else
printf " ${ RED } failed ${ NO_COLOR } .\n "
fi
fi
}
Echo_done ( )
{
if [ " ${ _COLOR } " = "false" ]
then
printf " already done.\n"
else
Cursor_columns_backward 8
printf " ${ GREEN } already done ${ NO_COLOR } .\n "
fi
}
Echo_file ( )
{
while read LINE
do
echo " ${ 1 } : ${ LINE } "
done < " ${ 1 } "
}
2008-06-14 17:25:05 +00:00
Echo_breakage ( )
{
2010-09-07 13:11:20 +00:00
case " ${ LB_DISTRIBUTION } " in
2008-06-14 17:25:05 +00:00
sid| unstable)
2008-08-11 20:28:54 +00:00
Echo_message "If the following stage fails, the most likely cause of the problem is with your mirror configuration, a caching proxy or the sid distribution."
2008-06-14 17:25:05 +00:00
; ;
*)
2008-08-11 20:28:54 +00:00
Echo_message "If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy."
2008-06-14 17:25:05 +00:00
; ;
esac
2008-06-15 00:58:07 +00:00
Echo_message " ${ @ } "
2008-06-14 17:25:05 +00:00
}