2007-09-23 08:04:49 +00:00
#!/bin/sh
2010-09-02 11:12:37 +00:00
## live-build(7) - System Build Scripts
2015-01-04 18:05:39 -01:00
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
2010-09-02 11:12:37 +00:00
##
2012-07-29 23:59:00 +00:00
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
2010-09-02 11:12:37 +00:00
## 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
2020-03-01 01:54:18 -01:00
printf " ${ STRING } \n " " ${ @ } " >& 1
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
2020-03-01 01:54:18 -01:00
printf " D: ${ STRING } \n " " ${ @ } " >& 1
2007-09-23 08:04:49 +00:00
fi
}
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
2020-03-01 01:42:27 -01:00
printf "E:" >& 2
2008-11-01 14:31:26 -01:00
else
2020-03-01 01:42:27 -01:00
printf " ${ RED } E ${ NO_COLOR } : " >& 2
2008-11-01 14:31:26 -01:00
fi
2012-06-05 18:38:37 +00:00
printf " ${ STRING } \n " " ${ @ } " >& 2
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
2020-03-01 01:54:18 -01:00
printf "P:" >& 1
2008-11-01 14:31:26 -01:00
else
2020-03-01 01:54:18 -01:00
printf " ${ WHITE } P ${ NO_COLOR } : " >& 1
2008-11-01 14:31:26 -01:00
fi
2020-03-01 01:54:18 -01:00
printf " ${ STRING } \n " " ${ @ } " >& 1
2008-11-01 14:31:26 -01:00
fi
}
2007-09-23 08:04:49 +00:00
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
2020-03-01 01:54:18 -01:00
printf " I: ${ STRING } \n " " ${ @ } " >& 1
2007-09-23 08:04:49 +00:00
fi
}
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
2020-03-01 01:57:05 -01:00
printf "W:" >& 2
2008-11-01 14:31:26 -01:00
else
2020-03-01 01:57:05 -01:00
printf " ${ YELLOW } W ${ NO_COLOR } : " >& 2
2008-11-01 14:31:26 -01:00
fi
2020-03-01 01:57:05 -01:00
printf " ${ STRING } \n " " ${ @ } " >& 2
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_file ( )
{
while read LINE
do
2020-03-01 01:54:18 -01:00
echo " ${ 1 } : ${ LINE } " >& 1
2008-11-01 14:31:26 -01:00
done < " ${ 1 } "
}
2008-06-14 17:25:05 +00:00
Echo_breakage ( )
{
2019-12-19 16:18:44 -01:00
case " ${ LB_PARENT_DISTRIBUTION_BINARY } " in
2012-07-27 21:29:19 +00:00
sid)
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
}