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

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).