From 55707b64eefb4b8e0a433d76ae58700f2cc7fb4b Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Feb 07 2008 15:10:39 +0000 Subject: improve 256-color support handling in colorls shell scripts + color tunning --- diff --git a/coreutils-DIR_COLORS.256color b/coreutils-DIR_COLORS.256color index 21d8284..896667e 100644 --- a/coreutils-DIR_COLORS.256color +++ b/coreutils-DIR_COLORS.256color @@ -67,19 +67,19 @@ OTHER_WRITABLE 48;5;10;38;5;21 # dir that is other-writable (o+w) and not sticky STICKY 48;5;21;38;5;15 # dir with the sticky bit set (+t) and not other-writable # This is for files with execute permission: -EXEC 01;38;5;10 +EXEC 01;38;5;34 # List any file extensions like '.gz' or '.tar' that you would like ls # to colorize below. Put the extension, a space, and the color init string. # (and any comments you want to add after a '#') # executables (bright green) -.cmd 01;38;5;10 -.exe 01;38;5;10 -.com 01;38;5;10 -.btm 01;38;5;10 -.bat 01;38;5;10 -.sh 01;38;5;10 -.csh 01;38;5;10 +.cmd 01;38;5;34 +.exe 01;38;5;34 +.com 01;38;5;34 +.btm 01;38;5;34 +.bat 01;38;5;34 +.sh 01;38;5;34 +.csh 01;38;5;34 # archives or compressed (bright red) .tar 01;38;5;9 .tgz 01;38;5;9 @@ -148,14 +148,14 @@ EXEC 01;38;5;10 .yuv 01;38;5;13 .svg 01;38;5;13 # audio formats (cyan) -.aac 00;38;5;14 -.au 00;38;5;14 -.flac 00;38;5;14 -.mid 00;38;5;14 -.midi 00;38;5;14 -.mka 00;38;5;14 -.mp3 00;38;5;14 -.mpc 00;38;5;14 -.ogg 00;38;5;14 -.ra 00;38;5;14 -.wav 00;38;5;14 +.aac 00;38;5;45 +.au 00;38;5;45 +.flac 00;38;5;45 +.mid 00;38;5;45 +.midi 00;38;5;45 +.mka 00;38;5;45 +.mp3 00;38;5;45 +.mpc 00;38;5;45 +.ogg 00;38;5;45 +.ra 00;38;5;45 +.wav 00;38;5;45 diff --git a/coreutils-colorls.csh b/coreutils-colorls.csh index 79613de..64ffe94 100755 --- a/coreutils-colorls.csh +++ b/coreutils-colorls.csh @@ -16,7 +16,7 @@ if ($?TERM) then endif endif if ( -e "/etc/DIR_COLORS.256color" ) then - if ( "`infocmp $TERM | sed -n 's/.*colors#\([0-9]\+\).*/\1/p'`" == "256" ) then + if ( "`tput colors 2>/dev/null`" == "256" ) then set COLORS=/etc/DIR_COLORS.256color endif endif diff --git a/coreutils-colorls.sh b/coreutils-colorls.sh index 9caef03..a8cb275 100755 --- a/coreutils-colorls.sh +++ b/coreutils-colorls.sh @@ -7,7 +7,7 @@ if [ -z "$LS_COLORS" ]; then COLORS=/etc/DIR_COLORS [ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM" [ -e "/etc/DIR_COLORS.256color" ] && \ - [ "`infocmp $TERM | sed -n 's/.*colors#\([0-9]\+\).*/\1/p'`" -eq 256 ] && \ + [ "`tput colors 2>/dev/null`" = "256" ] && \ COLORS="/etc/DIR_COLORS.256color" [ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors" [ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors" diff --git a/coreutils-selinux.patch b/coreutils-selinux.patch index 5d6b22b..2a945c5 100644 --- a/coreutils-selinux.patch +++ b/coreutils-selinux.patch @@ -508,6 +508,14 @@ diff -urp coreutils-6.10-orig/src/install.c coreutils-6.10/src/install.c x.preserve_security_context = true; use_default_selinux_context = false; break; +@@ -432,6 +432,7 @@ main (int argc, char **argv) + break; + } + scontext = optarg; ++ x.set_security_context = true; + use_default_selinux_context = false; + break; + case_GETOPT_HELP_CHAR; @@ -825,8 +831,8 @@ Mandatory arguments to long options are -v, --verbose print the name of each directory as it is created\n\ "), stdout); diff --git a/coreutils.spec b/coreutils.spec index e2756d2..de320d3 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: The GNU core utilities: a set of tools commonly used in shell scripts Name: coreutils Version: 6.10 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -291,6 +291,10 @@ fi /sbin/runuser %changelog +* Thu Feb 7 2008 Ondrej Vasik - 6.10-6 +- better 256-color support in colorls shell scripts +- color tuning(based on feedback in #429121) + * Mon Feb 4 2008 Ondrej Vasik - 6.10-5 - enabled 256-color support in colorls shell scripts(#429121) - fixed syntax error in csh script(#431315)