Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Enable xbps-src colours in CI
@ 2022-05-25  4:09 0x5c
  2022-05-25  4:17 ` [PR REVIEW] " 0x5c
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: 0x5c @ 2022-05-25  4:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

There is a new pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the same colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]

From a230e25c6b17d169c67448bedfe2f63291ee7379 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Thu, 19 May 2022 03:21:51 -0400
Subject: [PATCH 1/2] xbps-src: add way to force colours

The tty and NO_COLOR checks aree overriden by config var XBPS_FORCE_COLORS

The msg_normal colour is changed from "bold" (1) to "bright white, bold"
(97; 1) since github workflows render 1 as bold letters of the same colour.
This should have no effect on the vast majority of terminals setups, as 1 is
already rendered as bright white with or without bolded font.
---
 common/xbps-src/shutils/build_dependencies.sh | 8 ++++----
 common/xbps-src/shutils/common.sh             | 6 +++---
 xbps-src                                      | 2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index e4e2210d4e56..bef82d793b89 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -406,8 +406,8 @@ install_pkg_deps() {
 
     if [[ ${host_binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
@@ -416,8 +416,8 @@ install_pkg_deps() {
 
     if [[ ${binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index a640528f4d6a..ae96f8e7c87d 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97;1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97;1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }
diff --git a/xbps-src b/xbps-src
index dfa059927cc2..6167e38a22dc 100755
--- a/xbps-src
+++ b/xbps-src
@@ -464,6 +464,8 @@ fi
 # Read settings from config file
 [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
 
+[ -n "${XBPS_FORCE_COLORS}" ] && export -n 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

From 93f1400e4499390f474beca729f3cafff1a9ed79 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 24 May 2022 23:24:25 -0400
Subject: [PATCH 2/2] common/travis/prepare.sh: force colours in CI

---
 common/travis/prepare.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..63edb72e0e7b 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -7,6 +7,7 @@
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
+echo XBPS_FORCE_COLORS=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
 echo XBPS_CHROOT_CMD=ethereal >> etc/conf

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
@ 2022-05-25  4:17 ` 0x5c
  2022-05-25  6:22 ` classabbyamp
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-05-25  4:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r881201588

Comment:
Seeing the code for msg_{red,warn}, I suspect that this will need to be changed to `\033[97m\033[1m`

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
  2022-05-25  4:17 ` [PR REVIEW] " 0x5c
@ 2022-05-25  6:22 ` classabbyamp
  2022-05-25  6:33 ` 0x5c
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: classabbyamp @ 2022-05-25  6:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r881260232

Comment:
can these echos be replaced with `msg_normal`?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
  2022-05-25  4:17 ` [PR REVIEW] " 0x5c
  2022-05-25  6:22 ` classabbyamp
@ 2022-05-25  6:33 ` 0x5c
  2022-05-25 12:25 ` ahesford
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-05-25  6:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r881267415

Comment:
I think they should, considering that there's `msg_{normal,error}` in that same function and that those two lines use `echo`s to print the message instead of `printf`s

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (2 preceding siblings ...)
  2022-05-25  6:33 ` 0x5c
@ 2022-05-25 12:25 ` ahesford
  2022-05-25 20:55 ` 0x5c
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ahesford @ 2022-05-25 12:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1137176000

Comment:
Does this inject a bunch of control characters into the raw output from GitHub CI?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (3 preceding siblings ...)
  2022-05-25 12:25 ` ahesford
@ 2022-05-25 20:55 ` 0x5c
  2022-05-30 19:25 ` [PR PATCH] [Updated] " 0x5c
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-05-25 20:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 839 bytes --]

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1137839489

Comment:
> Does this inject a bunch of control characters into the raw output from GitHub CI?

Yes, Github uses standard ANSI escape codes to render colours in the output, so this change ensures the `msg_*` functions print the sequences when in CI regardless of the output not being a TTY by overriding the check there https://github.com/void-linux/void-packages/blob/5f3d8572ce0bb8be8deca2c68847cd20668f3ce1/xbps-src#L408-L413. We already use colours that way in all the other steps of the `build` job, for example the colour in https://github.com/void-linux/void-packages/blob/5f3d8572ce0bb8be8deca2c68847cd20668f3ce1/common/travis/prepare.sh#L7 (`32`, green) can be seen in the "Preparing container" step. 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (4 preceding siblings ...)
  2022-05-25 20:55 ` 0x5c
@ 2022-05-30 19:25 ` 0x5c
  2022-06-07  0:37 ` 0x5c
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-05-30 19:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]

From 921d4764ac250c2c94128a094cb5f0d97501948e Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Thu, 19 May 2022 03:21:51 -0400
Subject: [PATCH 1/2] xbps-src: add way to force colours

The tty and NO_COLOR checks aree overriden by config var XBPS_FORCE_COLORS

The msg_normal colour is changed from "bold" (1) to "bright white, bold"
(97; 1) since github workflows render 1 as bold letters of the same colour.
This should have no effect on the vast majority of terminals setups, as 1 is
already rendered as bright white with or without bolded font.
---
 common/xbps-src/shutils/build_dependencies.sh | 8 ++++----
 common/xbps-src/shutils/common.sh             | 6 +++---
 xbps-src                                      | 2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index e4e2210d4e56..bef82d793b89 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -406,8 +406,8 @@ install_pkg_deps() {
 
     if [[ ${host_binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
@@ -416,8 +416,8 @@ install_pkg_deps() {
 
     if [[ ${binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index a640528f4d6a..ae96f8e7c87d 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97;1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97;1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }
diff --git a/xbps-src b/xbps-src
index dfa059927cc2..6167e38a22dc 100755
--- a/xbps-src
+++ b/xbps-src
@@ -464,6 +464,8 @@ fi
 # Read settings from config file
 [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
 
+[ -n "${XBPS_FORCE_COLORS}" ] && export -n 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

From 3809fea11834896d9a5e400fcf753338f2aa3a89 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 24 May 2022 23:24:25 -0400
Subject: [PATCH 2/2] common/travis/prepare.sh: force colours in CI

---
 common/travis/prepare.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..63edb72e0e7b 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -7,6 +7,7 @@
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
+echo XBPS_FORCE_COLORS=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
 echo XBPS_CHROOT_CMD=ethereal >> etc/conf

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (5 preceding siblings ...)
  2022-05-30 19:25 ` [PR PATCH] [Updated] " 0x5c
@ 2022-06-07  0:37 ` 0x5c
  2022-06-12  1:28 ` 0x5c
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-06-07  0:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]

From 005120fc80266744686ce8fd14e332182e63725a Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Thu, 19 May 2022 03:21:51 -0400
Subject: [PATCH 1/2] xbps-src: add way to force colours

The tty and NO_COLOR checks aree overriden by config var XBPS_FORCE_COLORS

The msg_normal colour is changed from "bold" (1) to "bright white, bold"
(97; 1) since github workflows render 1 as bold letters of the same colour.
This should have no effect on the vast majority of terminals setups, as 1 is
already rendered as bright white with or without bolded font.
---
 common/xbps-src/shutils/build_dependencies.sh | 8 ++++----
 common/xbps-src/shutils/common.sh             | 6 +++---
 xbps-src                                      | 2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index e4e2210d4e56..bef82d793b89 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -406,8 +406,8 @@ install_pkg_deps() {
 
     if [[ ${host_binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
@@ -416,8 +416,8 @@ install_pkg_deps() {
 
     if [[ ${binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index a640528f4d6a..ae96f8e7c87d 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97;1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97;1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }
diff --git a/xbps-src b/xbps-src
index dfa059927cc2..6167e38a22dc 100755
--- a/xbps-src
+++ b/xbps-src
@@ -464,6 +464,8 @@ fi
 # Read settings from config file
 [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
 
+[ -n "${XBPS_FORCE_COLORS}" ] && export -n 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

From 003ef869c59cedc4f61163092f75c42e38d58f2f Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 24 May 2022 23:24:25 -0400
Subject: [PATCH 2/2] common/travis/prepare.sh: force colours in CI

---
 common/travis/prepare.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..63edb72e0e7b 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -7,6 +7,7 @@
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
+echo XBPS_FORCE_COLORS=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
 echo XBPS_CHROOT_CMD=ethereal >> etc/conf

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (6 preceding siblings ...)
  2022-06-07  0:37 ` 0x5c
@ 2022-06-12  1:28 ` 0x5c
  2022-06-12  1:43 ` 0x5c
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-06-12  1:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]

From 0bad89be83e1304da2f3dfe33a2edb7ab7730c81 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Thu, 19 May 2022 03:21:51 -0400
Subject: [PATCH 1/2] xbps-src: add way to force colours

The tty and NO_COLOR checks aree overriden by config var XBPS_FORCE_COLORS

The msg_normal colour is changed from "bold" (1) to "bright white, bold"
(97; 1) since github workflows render 1 as bold letters of the same colour.
This should have no effect on the vast majority of terminals setups, as 1 is
already rendered as bright white with or without bolded font.
---
 common/xbps-src/shutils/build_dependencies.sh | 8 ++++----
 common/xbps-src/shutils/common.sh             | 6 +++---
 xbps-src                                      | 2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index e4e2210d4e56..bef82d793b89 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -406,8 +406,8 @@ install_pkg_deps() {
 
     if [[ ${host_binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
@@ -416,8 +416,8 @@ install_pkg_deps() {
 
     if [[ ${binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index a640528f4d6a..ae96f8e7c87d 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97;1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97;1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }
diff --git a/xbps-src b/xbps-src
index dfa059927cc2..6167e38a22dc 100755
--- a/xbps-src
+++ b/xbps-src
@@ -464,6 +464,8 @@ fi
 # Read settings from config file
 [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
 
+[ -n "${XBPS_FORCE_COLORS}" ] && export -n 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

From 0275905aefb8a245900fbab05c9a7c07b2d032a5 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 24 May 2022 23:24:25 -0400
Subject: [PATCH 2/2] common/travis/prepare.sh: force colours in CI

---
 common/travis/prepare.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..63edb72e0e7b 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -7,6 +7,7 @@
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
+echo XBPS_FORCE_COLORS=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
 echo XBPS_CHROOT_CMD=ethereal >> etc/conf

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (7 preceding siblings ...)
  2022-06-12  1:28 ` 0x5c
@ 2022-06-12  1:43 ` 0x5c
  2022-06-13 16:38 ` [PR REVIEW] " ericonr
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-06-12  1:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1137839489

Comment:
> Does this inject a bunch of control characters into the raw output from GitHub CI?

Yes, Github uses standard ANSI escape codes to render colours in the output, so this change ensures the `msg_*` functions print the sequences when in CI regardless of the output not being a TTY by overriding the check there https://github.com/void-linux/void-packages/blob/5f3d8572ce0bb8be8deca2c68847cd20668f3ce1/xbps-src#L408-L413. We already use colours that way in all the other steps of the `build` job, for example the colour in https://github.com/void-linux/void-packages/blob/5f3d8572ce0bb8be8deca2c68847cd20668f3ce1/common/travis/prepare.sh#L7 (`32`, green) can be seen in the "Preparing masterdir" step. 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (8 preceding siblings ...)
  2022-06-12  1:43 ` 0x5c
@ 2022-06-13 16:38 ` ericonr
  2022-06-14  4:34 ` 0x5c
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2022-06-13 16:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r895922177

Comment:
This mechanism is a bit wrong, because anyone who decides to enable it locally can't override it with the `-L` flag.

You should maybe check first if `NOCOLORS` hasn't been set.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (9 preceding siblings ...)
  2022-06-13 16:38 ` [PR REVIEW] " ericonr
@ 2022-06-14  4:34 ` 0x5c
  2022-06-14  4:57 ` 0x5c
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-06-14  4:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r896364863

Comment:
`NOCOLORS` is set used by both the tty check and the `NO_COLOR` check here:
https://github.com/void-linux/void-packages/blob/f7e694733df137bc5957d62a43bb81b27a5af130/xbps-src#L408-L413
and by the argument parsing just above it. The configuration is loaded much later than those 3 points, so detection of `-L`/`NO_COLOR` would be faked by the tty check.

Not sure what the best way to go is, would it be fine to move tty/NO_COLORS to where the override currently is, and change the var set by arg parsing to an intermediary var?

Another way would be to move the tty check to where the override is, where it could simply be skipped in the presence of the command. This might be the better way

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (10 preceding siblings ...)
  2022-06-14  4:34 ` 0x5c
@ 2022-06-14  4:57 ` 0x5c
  2022-09-13  2:14 ` github-actions
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-06-14  4:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r896364863

Comment:
`NOCOLORS` is set used by both the tty check and the `NO_COLOR` check here:
https://github.com/void-linux/void-packages/blob/f7e694733df137bc5957d62a43bb81b27a5af130/xbps-src#L408-L413
and by the argument parsing just above it. The configuration is loaded much later than those 3 points, so detection of `-L`/`NO_COLOR` would be faked by the tty check.

Not sure what the best way to go is, would it be fine to move tty/NO_COLORS to where the override currently is, and change the var set by arg parsing to an intermediary var?

Another way would be to move the tty check to where the override is, where it could simply be skipped in the presence of the config var. This might be the better way

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (11 preceding siblings ...)
  2022-06-14  4:57 ` 0x5c
@ 2022-09-13  2:14 ` github-actions
  2022-09-26  2:37 ` [PR PATCH] [Updated] " 0x5c
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: github-actions @ 2022-09-13  2:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1244809688

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (12 preceding siblings ...)
  2022-09-13  2:14 ` github-actions
@ 2022-09-26  2:37 ` 0x5c
  2022-12-31  1:55 ` github-actions
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2022-09-26  2:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]

From 09ea02b9a9f0c05272cb72c3509dfa9d8796a045 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Thu, 19 May 2022 03:21:51 -0400
Subject: [PATCH 1/2] xbps-src: add way to force colours

The tty and NO_COLOR checks aree overriden by config var XBPS_FORCE_COLORS

The msg_normal colour is changed from "bold" (1) to "bright white, bold"
(97; 1) since github workflows render 1 as bold letters of the same colour.
This should have no effect on the vast majority of terminals setups, as 1 is
already rendered as bright white with or without bolded font.
---
 common/xbps-src/shutils/build_dependencies.sh | 8 ++++----
 common/xbps-src/shutils/common.sh             | 6 +++---
 xbps-src                                      | 2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index e4e2210d4e56..bef82d793b89 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -406,8 +406,8 @@ install_pkg_deps() {
 
     if [[ ${host_binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
@@ -416,8 +416,8 @@ install_pkg_deps() {
 
     if [[ ${binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index a640528f4d6a..ae96f8e7c87d 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97;1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97;1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }
diff --git a/xbps-src b/xbps-src
index f93f5c5827fd..01b24a62b92f 100755
--- a/xbps-src
+++ b/xbps-src
@@ -463,6 +463,8 @@ fi
 # Read settings from config file
 [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
 
+[ -n "${XBPS_FORCE_COLORS}" ] && export -n 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

From 10fcb50c8133746d6ac14c607b598d4009231eb8 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 24 May 2022 23:24:25 -0400
Subject: [PATCH 2/2] common/travis/prepare.sh: force colours in CI

---
 common/travis/prepare.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..63edb72e0e7b 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -7,6 +7,7 @@
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
+echo XBPS_FORCE_COLORS=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
 echo XBPS_CHROOT_CMD=ethereal >> etc/conf

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (13 preceding siblings ...)
  2022-09-26  2:37 ` [PR PATCH] [Updated] " 0x5c
@ 2022-12-31  1:55 ` github-actions
  2023-01-13  3:12 ` [PR PATCH] [Updated] " 0x5c
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: github-actions @ 2022-12-31  1:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1368144901

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (14 preceding siblings ...)
  2022-12-31  1:55 ` github-actions
@ 2023-01-13  3:12 ` 0x5c
  2023-02-20  2:08 ` 0x5c
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-01-13  3:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]

From e8fc9d25609e878aa75c930691ac3c36b643ab85 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Thu, 19 May 2022 03:21:51 -0400
Subject: [PATCH 1/2] xbps-src: add way to force colours

The tty and NO_COLOR checks aree overriden by config var XBPS_FORCE_COLORS

The msg_normal colour is changed from "bold" (1) to "bright white, bold"
(97; 1) since github workflows render 1 as bold letters of the same colour.
This should have no effect on the vast majority of terminals setups, as 1 is
already rendered as bright white with or without bolded font.
---
 common/xbps-src/shutils/build_dependencies.sh | 8 ++++----
 common/xbps-src/shutils/common.sh             | 6 +++---
 xbps-src                                      | 2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index 1d19de54ae80..35481fd5feec 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -406,8 +406,8 @@ install_pkg_deps() {
 
     if [[ ${host_binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
@@ -416,8 +416,8 @@ install_pkg_deps() {
 
     if [[ ${binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 1aeeaddc268e..b84c4e2c200c 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97;1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97;1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643..408571af1a8d 100755
--- a/xbps-src
+++ b/xbps-src
@@ -474,6 +474,8 @@ fi
 # Read settings from config file
 [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
 
+[ -n "${XBPS_FORCE_COLORS}" ] && export -n 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

From fc24cb4aa732aed07bd632c4fc8dc97dfa89c3ba Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 24 May 2022 23:24:25 -0400
Subject: [PATCH 2/2] common/travis/prepare.sh: force colours in CI

---
 common/travis/prepare.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..63edb72e0e7b 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -7,6 +7,7 @@
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
+echo XBPS_FORCE_COLORS=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
 echo XBPS_CHROOT_CMD=ethereal >> etc/conf

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (15 preceding siblings ...)
  2023-01-13  3:12 ` [PR PATCH] [Updated] " 0x5c
@ 2023-02-20  2:08 ` 0x5c
  2023-02-20  3:50 ` 0x5c
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-02-20  2:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]

From 04e25a7fc7c5bed9fdb961a2d0a0dd2eeaf656c8 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Thu, 19 May 2022 03:21:51 -0400
Subject: [PATCH 1/2] xbps-src: add way to force colours

The tty and NO_COLOR checks aree overriden by config var XBPS_FORCE_COLORS

The msg_normal colour is changed from "bold" (1) to "bright white, bold"
(97; 1) since github workflows render 1 as bold letters of the same colour.
This should have no effect on the vast majority of terminals setups, as 1 is
already rendered as bright white with or without bolded font.
---
 common/xbps-src/shutils/build_dependencies.sh | 8 ++++----
 common/xbps-src/shutils/common.sh             | 6 +++---
 xbps-src                                      | 2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index 1d19de54ae80..35481fd5feec 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -406,8 +406,8 @@ install_pkg_deps() {
 
     if [[ ${host_binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
@@ -416,8 +416,8 @@ install_pkg_deps() {
 
     if [[ ${binpkg_deps} ]]; then
         if [ -z "$XBPS_QUIET" ]; then
-            # normal messages in bold
-            [[ $NOCOLORS ]] || printf "\033[1m"
+            # normal messages in bright bold white
+            [[ $NOCOLORS ]] || printf "\033[97;1m"
             echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
             [[ $NOCOLORS ]] || printf "\033[m"
         fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index fdc0c5eedd92..34a31808e957 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97;1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97;1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }
diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643..408571af1a8d 100755
--- a/xbps-src
+++ b/xbps-src
@@ -474,6 +474,8 @@ fi
 # Read settings from config file
 [ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
 
+[ -n "${XBPS_FORCE_COLORS}" ] && export -n 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

From fb3e6a29447863adea19fcc0bcd5f36eaf71a30c Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 24 May 2022 23:24:25 -0400
Subject: [PATCH 2/2] common/travis/prepare.sh: force colours in CI

---
 common/travis/prepare.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..63edb72e0e7b 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -7,6 +7,7 @@
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
+echo XBPS_FORCE_COLORS=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
 echo XBPS_CHROOT_CMD=ethereal >> etc/conf

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (16 preceding siblings ...)
  2023-02-20  2:08 ` 0x5c
@ 2023-02-20  3:50 ` 0x5c
  2023-02-20  3:51 ` [PR REVIEW] " 0x5c
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-02-20  3:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Enable xbps-src colours in CI
This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3395 bytes --]

From 958d650cb9c4773379fc5528a08095d0cf082681 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:02:40 -0500
Subject: [PATCH 1/2] 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.

By prefixing the "bold" modifier with "bright white", we ensure that the
message shows as intended on as many terminals as possible.

Normal messages will be bright white on most terminals, with bolding depending
on terminal configuration.
Where 97m is not supported, only 1m will have an effect.
---
 common/xbps-src/shutils/common.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index fdc0c5eedd92..3592a1a3a3c8 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }

From 95b2c63b4a797fd961c66ae4e784463456ae93d5 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:44:09 -0500
Subject: [PATCH 2/2] 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 1d19de54ae80..c9935644f4c8 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -405,22 +405,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
 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (17 preceding siblings ...)
  2023-02-20  3:50 ` 0x5c
@ 2023-02-20  3:51 ` 0x5c
  2023-02-20  3:52 ` 0x5c
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-02-20  3:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r1111431181

Comment:
Since Github has changed the way they run CI, the whole override mechanism is not longer needed and has been removed from the PR.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] Enable xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (18 preceding siblings ...)
  2023-02-20  3:51 ` [PR REVIEW] " 0x5c
@ 2023-02-20  3:52 ` 0x5c
  2023-02-20  3:59 ` Fix " 0x5c
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-02-20  3:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#discussion_r1111431343

Comment:
They have been converted now.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (19 preceding siblings ...)
  2023-02-20  3:52 ` 0x5c
@ 2023-02-20  3:59 ` 0x5c
  2023-05-22  1:57 ` github-actions
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-02-20  3:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1436286471

Comment:
Github did some changes to how CI is run. xbps-src now prints colours on it's own just like on the terminal. I scrapped the part of the PR that was adding an override mechanism, keeping the colour change and the conversion to `msg_normal`.

The main thing remaining to see is how `97m` shows on light-theme terminals.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (20 preceding siblings ...)
  2023-02-20  3:59 ` Fix " 0x5c
@ 2023-05-22  1:57 ` github-actions
  2023-05-25  0:34 ` [PR PATCH] [Updated] " 0x5c
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: github-actions @ 2023-05-22  1:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1556398750

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (21 preceding siblings ...)
  2023-05-22  1:57 ` github-actions
@ 2023-05-25  0:34 ` 0x5c
  2023-09-23  1:44 ` github-actions
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-05-25  0:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Fix xbps-src colours in CI
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3395 bytes --]

From 64742b0c9ae62534ceec5a15baf29417980c0836 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:02:40 -0500
Subject: [PATCH 1/2] 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.

By prefixing the "bold" modifier with "bright white", we ensure that the
message shows as intended on as many terminals as possible.

Normal messages will be bright white on most terminals, with bolding depending
on terminal configuration.
Where 97m is not supported, only 1m will have an effect.
---
 common/xbps-src/shutils/common.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 2218d34ce30b..63e0475e363f 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -140,8 +140,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -165,7 +165,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }

From 9169fb57794710fdb5f7153dd51fc13b8e3df51b Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:44:09 -0500
Subject: [PATCH 2/2] 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 20f61528d14c..57ef45a7d5dd 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
 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (22 preceding siblings ...)
  2023-05-25  0:34 ` [PR PATCH] [Updated] " 0x5c
@ 2023-09-23  1:44 ` github-actions
  2023-09-28 23:12 ` [PR PATCH] [Updated] " 0x5c
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: github-actions @ 2023-09-23  1:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1732174580

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (23 preceding siblings ...)
  2023-09-23  1:44 ` github-actions
@ 2023-09-28 23:12 ` 0x5c
  2023-12-28  1:45 ` github-actions
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2023-09-28 23:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Fix xbps-src colours in CI
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3399 bytes --]

From e624e13105dfcb6fbb768fb140ea4af248c19f39 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:02:40 -0500
Subject: [PATCH 1/2] 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.

By prefixing the "bold" modifier with "bright white", we ensure that the
message shows as intended on as many terminals as possible.

Normal messages will be bright white on most terminals, with bolding depending
on terminal configuration.
Where 97m is not supported, only 1m will have an effect.
---
 common/xbps-src/shutils/common.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 04247942decf2..6e625a169600a 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -176,8 +176,8 @@ 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
+        [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m"
         printf "=> $@"
         [ -n "$NOCOLORS" ] || printf "\033[m"
     fi
@@ -201,7 +201,7 @@ report_broken() {
 }
 
 msg_normal_append() {
-    [ -n "$NOCOLORS" ] || printf "\033[1m"
+    [ -n "$NOCOLORS" ] || printf "\033[97m\033[1m"
     printf "$@"
     [ -n "$NOCOLORS" ] || printf "\033[m"
 }

From 51ce4004408f965fc3aeedd6c93d2c7e80cd079c Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:44:09 -0500
Subject: [PATCH 2/2] 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
 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (24 preceding siblings ...)
  2023-09-28 23:12 ` [PR PATCH] [Updated] " 0x5c
@ 2023-12-28  1:45 ` github-actions
  2024-01-05 23:47 ` [PR PATCH] [Updated] " 0x5c
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: github-actions @ 2023-12-28  1:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1870742951

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (25 preceding siblings ...)
  2023-12-28  1:45 ` github-actions
@ 2024-01-05 23:47 ` 0x5c
  2024-01-05 23:50 ` 0x5c
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2024-01-05 23:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Fix xbps-src colours in CI
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 3523 bytes --]

From 363957f2623aa60e3ef7f6976515f1a259043f00 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:44:09 -0500
Subject: [PATCH 1/2] 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 <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:02:40 -0500
Subject: [PATCH 2/2] 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"
 }

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (26 preceding siblings ...)
  2024-01-05 23:47 ` [PR PATCH] [Updated] " 0x5c
@ 2024-01-05 23:50 ` 0x5c
  2024-01-05 23:51 ` [PR PATCH] [Updated] " 0x5c
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2024-01-05 23:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/37283#issuecomment-1879390179

Comment:
Changed the mechanism to be active only in CI; there's still terminals that won't render xbps-src messages as bright white, but at least CI should be fixed.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (27 preceding siblings ...)
  2024-01-05 23:50 ` 0x5c
@ 2024-01-05 23:51 ` 0x5c
  2024-01-06  0:02 ` 0x5c
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2024-01-05 23:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Fix xbps-src colours in CI
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 4155 bytes --]

From 363957f2623aa60e3ef7f6976515f1a259043f00 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
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 <dev@0x5c.io>
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 8dced7fbc8721440f9209a79dfeb85d0fee7d909 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Fri, 5 Jan 2024 18:51:27 -0500
Subject: [PATCH 3/3] demo bump

---
 srcpkgs/ircdog/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ircdog/template b/srcpkgs/ircdog/template
index b8d22e9b7c927..e8802627566dc 100644
--- a/srcpkgs/ircdog/template
+++ b/srcpkgs/ircdog/template
@@ -1,7 +1,7 @@
 # Template file for 'ircdog'
 pkgname=ircdog
 version=0.5.1
-revision=2
+revision=3
 build_style=go
 go_import_path="github.com/ergochat/ircdog"
 short_desc="Simple wrapper over the raw IRC protocol"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (28 preceding siblings ...)
  2024-01-05 23:51 ` [PR PATCH] [Updated] " 0x5c
@ 2024-01-06  0:02 ` 0x5c
  2024-01-06  0:13 ` 0x5c
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2024-01-06  0:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Fix xbps-src colours in CI
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 5017 bytes --]

From 363957f2623aa60e3ef7f6976515f1a259043f00 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:44:09 -0500
Subject: [PATCH 1/4] 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 <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:02:40 -0500
Subject: [PATCH 2/4] 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 8dced7fbc8721440f9209a79dfeb85d0fee7d909 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Fri, 5 Jan 2024 18:51:27 -0500
Subject: [PATCH 3/4] demo bump

---
 srcpkgs/ircdog/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ircdog/template b/srcpkgs/ircdog/template
index b8d22e9b7c927..e8802627566dc 100644
--- a/srcpkgs/ircdog/template
+++ b/srcpkgs/ircdog/template
@@ -1,7 +1,7 @@
 # Template file for 'ircdog'
 pkgname=ircdog
 version=0.5.1
-revision=2
+revision=3
 build_style=go
 go_import_path="github.com/ergochat/ircdog"
 short_desc="Simple wrapper over the raw IRC protocol"

From 5dbe9908a5a3cf08275843e0c57bfeb1e91c69f7 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Fri, 5 Jan 2024 18:56:41 -0500
Subject: [PATCH 4/4] abps-src: disable tty/pipe detection for CI

This allows having the message colours in CI, and only affects xbps-src itself
---
 xbps-src | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xbps-src b/xbps-src
index cdb5f8c6d643e..ee33eea337a51 100755
--- a/xbps-src
+++ b/xbps-src
@@ -415,8 +415,10 @@ shift $(($OPTIND - 1))
 
 [ $# -eq 0 ] && usage && exit 1
 
-# Check if stdout is a tty; if false disable colors.
-test -t 1 || export NOCOLORS=1
+if [ "$XBPS_BUILD_ENVIRONMENT" != "void-packages-ci" ]; then
+    # Check if stdout is a tty; if false disable colors.
+    test -t 1 || export NOCOLORS=1
+fi
 # http://no-color.org
 if [ "${NO_COLOR+x}" ]; then
     export NOCOLORS=1

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (29 preceding siblings ...)
  2024-01-06  0:02 ` 0x5c
@ 2024-01-06  0:13 ` 0x5c
  2024-01-06  0:17 ` 0x5c
  2024-01-06  0:18 ` [PR PATCH] [Merged]: " classabbyamp
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2024-01-06  0:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Fix xbps-src colours in CI
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 5031 bytes --]

From 363957f2623aa60e3ef7f6976515f1a259043f00 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:44:09 -0500
Subject: [PATCH 1/4] 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 <dev@0x5c.io>
Date: Sun, 19 Feb 2023 22:02:40 -0500
Subject: [PATCH 2/4] 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 8dced7fbc8721440f9209a79dfeb85d0fee7d909 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Fri, 5 Jan 2024 18:51:27 -0500
Subject: [PATCH 3/4] demo bump

---
 srcpkgs/ircdog/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ircdog/template b/srcpkgs/ircdog/template
index b8d22e9b7c927..e8802627566dc 100644
--- a/srcpkgs/ircdog/template
+++ b/srcpkgs/ircdog/template
@@ -1,7 +1,7 @@
 # Template file for 'ircdog'
 pkgname=ircdog
 version=0.5.1
-revision=2
+revision=3
 build_style=go
 go_import_path="github.com/ergochat/ircdog"
 short_desc="Simple wrapper over the raw IRC protocol"

From fec1a77f5d46a6cd57d095c1ef7227477d82c5d5 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Fri, 5 Jan 2024 18:56:41 -0500
Subject: [PATCH 4/4] 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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (30 preceding siblings ...)
  2024-01-06  0:13 ` 0x5c
@ 2024-01-06  0:17 ` 0x5c
  2024-01-06  0:18 ` [PR PATCH] [Merged]: " classabbyamp
  32 siblings, 0 replies; 34+ messages in thread
From: 0x5c @ 2024-01-06  0:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages ci-colours
https://github.com/void-linux/void-packages/pull/37283

Fix xbps-src colours in CI
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/37283.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-colours-37283.patch --]
[-- Type: text/x-diff, Size: 4399 bytes --]

From 363957f2623aa60e3ef7f6976515f1a259043f00 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
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 <dev@0x5c.io>
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 <dev@0x5c.io>
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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Merged]: Fix xbps-src colours in CI
  2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
                   ` (31 preceding siblings ...)
  2024-01-06  0:17 ` 0x5c
@ 2024-01-06  0:18 ` classabbyamp
  32 siblings, 0 replies; 34+ messages in thread
From: classabbyamp @ 2024-01-06  0:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

There's a merged pull request on the void-packages repository

Fix xbps-src colours in CI
https://github.com/void-linux/void-packages/pull/37283

Description:
~~This PR adds a new config variable `XBPS_FORCE_COLORS`, which overrides the "is this not a tty" and `NO_COLOR` checks, and adds it to config entries for CI.~~
**EDIT** Github has changed the way CI is run; xbps-src now thinks it is running in a terminal and prints with colour. This part of the PR has been removed.

The `msg_normal()` colour is changed from "bold" (`1`) to "bright white, bold" (`97`, `1`) since Github workflows render `1` as bold letters of the current colour. This should have no effect on the vast majority of terminals setups, as `1` is already rendered as bright white with or without bolded font.

![image](https://user-images.githubusercontent.com/5877043/170177533-b0be695f-a9c0-42d5-9ea9-e2f0657b3b68.png)
![image](https://user-images.githubusercontent.com/5877043/170177592-a3c5de00-8bb2-48a9-8b62-65035889d84c.png)

I also setup [a demo](https://github.com/0x5c/void-packages/pull/4/checks) on my fork.

#### Testing the changes
- I tested the changes in this PR: **YES**


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2024-01-06  0:18 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  4:09 [PR PATCH] Enable xbps-src colours in CI 0x5c
2022-05-25  4:17 ` [PR REVIEW] " 0x5c
2022-05-25  6:22 ` classabbyamp
2022-05-25  6:33 ` 0x5c
2022-05-25 12:25 ` ahesford
2022-05-25 20:55 ` 0x5c
2022-05-30 19:25 ` [PR PATCH] [Updated] " 0x5c
2022-06-07  0:37 ` 0x5c
2022-06-12  1:28 ` 0x5c
2022-06-12  1:43 ` 0x5c
2022-06-13 16:38 ` [PR REVIEW] " ericonr
2022-06-14  4:34 ` 0x5c
2022-06-14  4:57 ` 0x5c
2022-09-13  2:14 ` github-actions
2022-09-26  2:37 ` [PR PATCH] [Updated] " 0x5c
2022-12-31  1:55 ` github-actions
2023-01-13  3:12 ` [PR PATCH] [Updated] " 0x5c
2023-02-20  2:08 ` 0x5c
2023-02-20  3:50 ` 0x5c
2023-02-20  3:51 ` [PR REVIEW] " 0x5c
2023-02-20  3:52 ` 0x5c
2023-02-20  3:59 ` Fix " 0x5c
2023-05-22  1:57 ` github-actions
2023-05-25  0:34 ` [PR PATCH] [Updated] " 0x5c
2023-09-23  1:44 ` github-actions
2023-09-28 23:12 ` [PR PATCH] [Updated] " 0x5c
2023-12-28  1:45 ` github-actions
2024-01-05 23:47 ` [PR PATCH] [Updated] " 0x5c
2024-01-05 23:50 ` 0x5c
2024-01-05 23:51 ` [PR PATCH] [Updated] " 0x5c
2024-01-06  0:02 ` 0x5c
2024-01-06  0:13 ` 0x5c
2024-01-06  0:17 ` 0x5c
2024-01-06  0:18 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).