Automatic merge of trunk into multilib

This commit is contained in:
Thomas Trepl 2024-07-07 00:30:09 +02:00
commit b9908a1ad8
4 changed files with 90 additions and 21 deletions

View File

@ -1,3 +1,7 @@
2024-07-06 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* Add logic to init-functions to only print escape sequences
if stdin and stdout are connected to a terminal.
2024-04-16 Bruce Dubbs <bdubbs@linuxfromscratch.org> 2024-04-16 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* Remove blank output line generated in ifup script when bringing * Remove blank output line generated in ifup script when bringing
up wireless interface. up wireless interface.

View File

@ -58,12 +58,22 @@ SCRIPT_STAT="0"
# Set any user specified environment variables e.g. HEADLESS # Set any user specified environment variables e.g. HEADLESS
[ -r /etc/sysconfig/rc.site ] && . /etc/sysconfig/rc.site [ -r /etc/sysconfig/rc.site ] && . /etc/sysconfig/rc.site
# If HEADLESS is set, use that.
# If file descriptor 1 or 2 (stdout and stderr) is not open or
# does not refer to a terminal, consider the script headless.
[ ! -t 1 -o ! -t 2 ] && HEADLESS=${HEADLESS:-yes}
if [ "x$HEADLESS" != "xyes" ]
then
## Screen Dimensions ## Screen Dimensions
# Find current screen size # Find current screen size
if [ -z "${COLUMNS}" ]; then if [ -z "${COLUMNS}" ]; then
COLUMNS=$(stty size) COLUMNS=$(stty size)
COLUMNS=${COLUMNS##* } COLUMNS=${COLUMNS##* }
fi fi
else
COLUMNS=80
fi
# When using remote connections, such as a serial port, stty size returns 0 # When using remote connections, such as a serial port, stty size returns 0
if [ "${COLUMNS}" = "0" ]; then if [ "${COLUMNS}" = "0" ]; then
@ -575,9 +585,14 @@ timespec()
################################################################################ ################################################################################
log_success_msg() log_success_msg()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${BMPREFIX}${@}" /bin/echo -n -e "${BMPREFIX}${@}"
/bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}" /bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}"
else
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
/bin/echo -e "${logmessage} OK"
fi
# Strip non-printable characters from log file # Strip non-printable characters from log file
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
@ -589,8 +604,13 @@ log_success_msg()
log_success_msg2() log_success_msg2()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${BMPREFIX}${@}" /bin/echo -n -e "${BMPREFIX}${@}"
/bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}" /bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}"
else
echo " OK"
fi
echo " OK" >> ${BOOTLOG} echo " OK" >> ${BOOTLOG}
@ -610,8 +630,14 @@ log_success_msg2()
################################################################################ ################################################################################
log_failure_msg() log_failure_msg()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${BMPREFIX}${@}" /bin/echo -n -e "${BMPREFIX}${@}"
/bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}" /bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}"
else
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
/bin/echo -e "${logmessage} FAIL"
fi
# Strip non-printable characters from log file # Strip non-printable characters from log file
@ -624,8 +650,13 @@ log_failure_msg()
log_failure_msg2() log_failure_msg2()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${BMPREFIX}${@}" /bin/echo -n -e "${BMPREFIX}${@}"
/bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}" /bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}"
else
echo "FAIL"
fi
echo "FAIL" >> ${BOOTLOG} echo "FAIL" >> ${BOOTLOG}
@ -643,8 +674,14 @@ log_failure_msg2()
################################################################################ ################################################################################
log_warning_msg() log_warning_msg()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${BMPREFIX}${@}" /bin/echo -n -e "${BMPREFIX}${@}"
/bin/echo -e "${CURS_ZERO}${WARNING_PREFIX}${SET_COL}${WARNING_SUFFIX}" /bin/echo -e "${CURS_ZERO}${WARNING_PREFIX}${SET_COL}${WARNING_SUFFIX}"
else
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
/bin/echo -e "${logmessage} WARN"
fi
# Strip non-printable characters from log file # Strip non-printable characters from log file
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
@ -656,8 +693,14 @@ log_warning_msg()
log_skip_msg() log_skip_msg()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${BMPREFIX}${@}" /bin/echo -n -e "${BMPREFIX}${@}"
/bin/echo -e "${CURS_ZERO}${SKIP_PREFIX}${SET_COL}${SKIP_SUFFIX}" /bin/echo -e "${CURS_ZERO}${SKIP_PREFIX}${SET_COL}${SKIP_SUFFIX}"
else
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
/bin/echo "SKIP"
fi
# Strip non-printable characters from log file # Strip non-printable characters from log file
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
@ -677,7 +720,13 @@ log_skip_msg()
################################################################################ ################################################################################
log_info_msg() log_info_msg()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${BMPREFIX}${@}" /bin/echo -n -e "${BMPREFIX}${@}"
else
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
/bin/echo -n -e "${logmessage}"
fi
# Strip non-printable characters from log file # Strip non-printable characters from log file
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
@ -689,7 +738,13 @@ log_info_msg()
log_info_msg2() log_info_msg2()
{ {
if [ "x$HEADLESS" != "xyes" ]
then
/bin/echo -n -e "${@}" /bin/echo -n -e "${@}"
else
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
/bin/echo -n -e "${logmessage}"
fi
# Strip non-printable characters from log file # Strip non-printable characters from log file
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`

View File

@ -40,6 +40,16 @@
appropriate for the entry or if needed the entire day's listitem. appropriate for the entry or if needed the entire day's listitem.
--> -->
<listitem>
<para>2024-07-01</para>
<itemizedlist>
<listitem>
<para>[bdubbs] - Update lfs-bootscripts to only output
escape sequences to a terminal. </para>
</listitem>
</itemizedlist>
</listitem>
<listitem> <listitem>
<para>2024-07-01</para> <para>2024-07-01</para>
<itemizedlist> <itemizedlist>

View File

@ -391,7 +391,7 @@
<!ENTITY less-fin-du "12 MB"> <!ENTITY less-fin-du "12 MB">
<!ENTITY less-fin-sbu "less than 0.1 SBU"> <!ENTITY less-fin-sbu "less than 0.1 SBU">
<!ENTITY lfs-bootscripts-version "20240630"> <!-- Scripts depend on this format --> <!ENTITY lfs-bootscripts-version "20240706"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB">
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.xz"> <!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.xz">
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM">