2007-09-23 08:04:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2020-03-11 09:07:21 -01:00
|
|
|
## Copyright (C) 2016-2020 The Debian Live team
|
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.
|
|
|
|
|
2020-03-07 01:33:08 -01:00
|
|
|
exec 3>&1
|
2007-09-23 08:04:49 +00:00
|
|
|
|
2008-08-14 18:25:29 +00:00
|
|
|
Echo ()
|
|
|
|
{
|
2020-02-20 05:58:11 -01:00
|
|
|
local STRING="${1}"
|
2008-08-14 18:25:29 +00:00
|
|
|
shift
|
|
|
|
|
2020-03-07 01:33:08 -01:00
|
|
|
printf "${STRING}\n" "${@}" >&3
|
2008-08-14 18:25:29 +00:00
|
|
|
}
|
|
|
|
|
2007-09-23 08:04:49 +00:00
|
|
|
Echo_debug ()
|
|
|
|
{
|
2020-03-01 02:49:57 -01:00
|
|
|
if [ "${_DEBUG}" = "true" ]; then
|
2020-02-20 05:58:11 -01:00
|
|
|
local STRING="${1}"
|
2008-11-01 14:31:26 -01:00
|
|
|
shift
|
|
|
|
|
2020-03-07 01:33:08 -01:00
|
|
|
printf "D: ${STRING}\n" "${@}" >&3
|
2007-09-23 08:04:49 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
Echo_error ()
|
|
|
|
{
|
2020-02-20 05:58:11 -01:00
|
|
|
local STRING="${1}"
|
2008-08-11 20:28:54 +00:00
|
|
|
shift
|
2007-09-23 08:04:51 +00:00
|
|
|
|
2020-03-01 02:49:57 -01:00
|
|
|
local PREFIX="${RED}E${NO_COLOR}"
|
2020-03-13 17:36:26 -01:00
|
|
|
if [ "${_COLOR_ERR}" = "false" ]; then
|
2020-03-01 02:49:57 -01:00
|
|
|
PREFIX="E"
|
2008-11-01 14:31:26 -01:00
|
|
|
fi
|
|
|
|
|
2020-03-01 02:49:57 -01:00
|
|
|
printf "${PREFIX}: ${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
|
2020-02-20 05:58:11 -01:00
|
|
|
local STRING="${1}"
|
2008-11-01 14:31:26 -01:00
|
|
|
shift
|
2007-09-23 08:04:51 +00:00
|
|
|
|
2020-03-11 21:05:27 -01:00
|
|
|
local PREFIX="${PURPLE}P${NO_COLOR}"
|
2020-03-13 17:36:26 -01:00
|
|
|
if [ "${_COLOR_OUT}" = "false" ]; then
|
2020-03-01 02:49:57 -01:00
|
|
|
PREFIX="P"
|
2008-11-01 14:31:26 -01:00
|
|
|
fi
|
|
|
|
|
2020-03-07 01:33:08 -01:00
|
|
|
printf "${PREFIX}: ${STRING}\n" "${@}" >&3
|
2008-11-01 14:31:26 -01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2007-09-23 08:04:49 +00:00
|
|
|
Echo_verbose ()
|
|
|
|
{
|
2020-03-01 02:49:57 -01:00
|
|
|
if [ "${_VERBOSE}" = "true" ]; then
|
2020-02-20 05:58:11 -01:00
|
|
|
local STRING="${1}"
|
2008-11-01 14:31:26 -01:00
|
|
|
shift
|
|
|
|
|
2020-03-07 01:33:08 -01:00
|
|
|
printf "I: ${STRING}\n" "${@}" >&3
|
2007-09-23 08:04:49 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
Echo_warning ()
|
|
|
|
{
|
2020-02-20 05:58:11 -01:00
|
|
|
local STRING="${1}"
|
2008-08-11 20:28:54 +00:00
|
|
|
shift
|
2007-09-23 08:04:51 +00:00
|
|
|
|
2020-03-01 02:49:57 -01:00
|
|
|
local PREFIX="${YELLOW}W${NO_COLOR}"
|
2020-03-13 17:36:26 -01:00
|
|
|
if [ "${_COLOR_ERR}" = "false" ]; then
|
2020-03-01 02:49:57 -01:00
|
|
|
PREFIX="W"
|
2008-11-01 14:31:26 -01:00
|
|
|
fi
|
|
|
|
|
2020-03-01 02:49:57 -01:00
|
|
|
printf "${PREFIX}: ${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 ()
|
|
|
|
{
|
2020-02-20 05:58:11 -01:00
|
|
|
local LINE
|
2020-03-07 04:57:15 -01:00
|
|
|
while read -r LINE
|
2008-11-01 14:31:26 -01:00
|
|
|
do
|
2020-03-07 01:33:08 -01:00
|
|
|
echo "${1}: ${LINE}" >&3
|
2008-11-01 14:31:26 -01:00
|
|
|
done < "${1}"
|
|
|
|
}
|