From 363957f2623aa60e3ef7f6976515f1a259043f00 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Sun, 19 Feb 2023 22:44:09 -0500 Subject: [PATCH 1/3] common/xbps-src/shutils/build_dependencies.sh: convert to msg_normal There remained two locations where the functionality of msg_normal was manually implemented. --- common/xbps-src/shutils/build_dependencies.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh index 20f61528d14c2..57ef45a7d5dd4 100644 --- a/common/xbps-src/shutils/build_dependencies.sh +++ b/common/xbps-src/shutils/build_dependencies.sh @@ -410,22 +410,12 @@ install_pkg_deps() { done if [[ ${host_binpkg_deps} ]]; then - if [ -z "$XBPS_QUIET" ]; then - # normal messages in bold - [[ $NOCOLORS ]] || printf "\033[1m" - echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..." - [[ $NOCOLORS ]] || printf "\033[m" - fi + msg_normal "$pkgver: installing host dependencies: ${host_binpkg_deps[*]} ...\n" install_pkg_from_repos "" host "${host_binpkg_deps[@]}" fi if [[ ${binpkg_deps} ]]; then - if [ -z "$XBPS_QUIET" ]; then - # normal messages in bold - [[ $NOCOLORS ]] || printf "\033[1m" - echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..." - [[ $NOCOLORS ]] || printf "\033[m" - fi + msg_normal "$pkgver: installing target dependencies: ${binpkg_deps[*]} ...\n" install_pkg_from_repos "$cross" target "${binpkg_deps[@]}" fi From 8526dc9777241e27164238139a4daaddfae7e469 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Sun, 19 Feb 2023 22:02:40 -0500 Subject: [PATCH 2/3] common/xbps-src/shutils/common.sh: ensure white text in msg_normal Most terminals see '1m' as being a "bright colour" modifier, but others consider it to be the "bold font" modifier, like the GitHub Actions log. '97m' is a standalone "bright white" that is supported in most terminals, including GitHub Actions, and is ignored where not supported. --- common/xbps-src/shutils/common.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index 04247942decf2..4083e08ee084f 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -176,8 +176,13 @@ msg_warn_nochroot() { msg_normal() { if [ -z "$XBPS_QUIET" ]; then - # normal messages in bold - [ -n "$NOCOLORS" ] || printf "\033[1m" + # normal messages in bright bold white + if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then + # Github CI considers '1m' to be just a font bold + [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m" + else + [ -n "$NOCOLORS" ] || printf "\033[1m" + fi printf "=> $@" [ -n "$NOCOLORS" ] || printf "\033[m" fi @@ -201,7 +206,12 @@ report_broken() { } msg_normal_append() { - [ -n "$NOCOLORS" ] || printf "\033[1m" + if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then + # Github CI considers '1m' to be just a font bold + [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m" + else + [ -n "$NOCOLORS" ] || printf "\033[1m" + fi printf "$@" [ -n "$NOCOLORS" ] || printf "\033[m" } From 84f5945516ee235ef2a301201e91788f451d5011 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Fri, 5 Jan 2024 18:56:41 -0500 Subject: [PATCH 3/3] xbps-src: disable NOCOLORS in CI This allows having the message colours in CI, and only affects xbps-src itself --- xbps-src | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xbps-src b/xbps-src index cdb5f8c6d643e..712a578c6f91a 100755 --- a/xbps-src +++ b/xbps-src @@ -474,6 +474,9 @@ fi # Read settings from config file [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null +# show colors unconditionally in CI +[ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ] && export NOCOLORS= + # Set options passed on command line, after configuration files have been read [ -n "$XBPS_ARG_BUILD_ONLY_ONE_PKG" ] && XBPS_BUILD_ONLY_ONE_PKG=yes [ -n "$XBPS_ARG_IGNORE_BROKENNESS" ] && XBPS_IGNORE_BROKENNESS=1