From ce0c7bc3ddca313632dc16b2a6553d11cfab4e38 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Fri, 8 May 2020 21:34:46 +0200 Subject: [PATCH] - fix color reset on terminals with more than 16 colors --- color-fix.patch | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ rc-scripts.spec | 4 +++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 color-fix.patch diff --git a/color-fix.patch b/color-fix.patch new file mode 100644 index 0000000..3af2643 --- /dev/null +++ b/color-fix.patch @@ -0,0 +1,63 @@ +From 5d89b49a413e24dae01d41cdb0d50b919ad4830e Mon Sep 17 00:00:00 2001 +From: Marcin Krol +Date: Fri, 8 May 2020 21:18:49 +0200 +Subject: [PATCH] - drop setting color to white as default, use color reset + instead + +--- + lib/functions | 7 +++---- + sysconfig/init-colors | 2 +- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/lib/functions b/lib/functions +index fb41ffa..8f08dc6 100644 +--- a/lib/functions ++++ b/lib/functions +@@ -39,7 +39,6 @@ BLUE=4 + MAGENTA=5 + CYAN=6 + WHITE=7 +-NORMAL=15 + # Bold definition (second parameter to termput setaf) + BOLD=1 + NOBOLD=0 +@@ -53,7 +52,7 @@ CTLD="$GREEN" # "TLD Linux" color + CI="$RED" # Capital I color (press I to enter interactive startup) + CRESMAN="$GREEN" # "Resource Manager" color + CHARS="" # Characters displayed on the beginning of show line +-CCHARS="$NORMAL" # Color of these characters (look at /etc/sysconfig/init-colors.gentoo example) ++CCHARS="$WHITE" # Color of these characters (look at /etc/sysconfig/init-colors.gentoo example) + + # Source configuration if available - may override default values + [ -r /etc/sysconfig/init-colors ] && . /etc/sysconfig/init-colors +@@ -283,7 +282,7 @@ termput() { + is_yes "$COLOR_INIT" && echo -ne "\033[${ISBOLD};3${2}m" + ;; + op) +- termput setaf $NORMAL ++ echo -ne "\033[0m" + ;; + esac + else +@@ -296,7 +295,7 @@ termput() { + is_yes "$COLOR_INIT" && tput setaf "$2" + ;; + op) +- termput setaf $NORMAL ++ tput sgr0 + ;; + esac + fi +diff --git a/sysconfig/init-colors b/sysconfig/init-colors +index 1632fdb..8798b96 100644 +--- a/sysconfig/init-colors ++++ b/sysconfig/init-colors +@@ -9,4 +9,4 @@ CTLD="$GREEN" # "TLD Linux" color + CI="$RED" # Capital I color (press I to enter interactive startup) + CRESMAN="$GREEN" # "Resource Manager" color + CHARS="" # Characters displayed on the beginning of show line +-CCHARS="$NORMAL" # Color of these characters (look at /usr/share/doc/rc-scripts-*/init-colors.gentoo.gz example) ++CCHARS="$WHITE" # Color of these characters (look at /usr/share/doc/rc-scripts-*/init-colors.gentoo.gz example) +-- +2.25.1 + diff --git a/rc-scripts.spec b/rc-scripts.spec index 723efc0..08d0bb8 100644 --- a/rc-scripts.spec +++ b/rc-scripts.spec @@ -8,11 +8,12 @@ Summary(pl.UTF-8): inittab i skrypty startowe z katalogu /etc/rc.d Summary(tr.UTF-8): inittab ve /etc/rc.d dosyaları Name: rc-scripts Version: 0.5.2 -Release: 1 +Release: 2 License: GPL v2 Group: Base Source0: %{name}-%{version}.tar.gz # Source0-md5: bc6f66a2511cf866e852d40349d7b609 +Patch0: color-fix.patch URL: https://git.tld-linux.org/?p=rc-scripts.git BuildRequires: autoconf BuildRequires: automake @@ -101,6 +102,7 @@ programcıklar içerir. %prep %setup -q +%patch0 -p1 # hack, currently this results in errno@@GLIBC_PRIVATE symbol in ppp-watch: #GLIB_LIBS="-Wl,-static `$PKG_CONFIG --libs --static glib-2.0` -Wl,-Bdynamic" -- 2.46.0