From c7a1b74c04c2ce8da16d4e4f8192c2016e72bf91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= Date: Thu, 14 Mar 2013 16:50:09 +0100 Subject: [PATCH] DIR_COLORS.xterm should have higher priority than DIR_COLORS.256color (#921651) --- coreutils-colorls.csh | 6 +++--- coreutils-colorls.sh | 16 ++++++++-------- coreutils.spec | 6 +++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/coreutils-colorls.csh b/coreutils-colorls.csh index 3243484..8c5b993 100755 --- a/coreutils-colorls.csh +++ b/coreutils-colorls.csh @@ -13,14 +13,14 @@ set COLORS=/etc/DIR_COLORS set TMP="`mktemp .colorlsXXX`" if ($?TERM) then - if ( -e "/etc/DIR_COLORS.$TERM" ) then - set COLORS="/etc/DIR_COLORS.$TERM" - endif if ( -e "/etc/DIR_COLORS.256color" ) then if ( "`tput colors`" == "256" ) then set COLORS=/etc/DIR_COLORS.256color endif endif + if ( -e "/etc/DIR_COLORS.$TERM" ) then + set COLORS="/etc/DIR_COLORS.$TERM" + endif endif if ( -f ~/.dircolors ) set COLORS=~/.dircolors if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors diff --git a/coreutils-colorls.sh b/coreutils-colorls.sh index adb3574..f354698 100755 --- a/coreutils-colorls.sh +++ b/coreutils-colorls.sh @@ -21,15 +21,15 @@ if [ -z "$USER_LS_COLORS" ]; then break done - [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \ - [ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \ - COLORS="/etc/DIR_COLORS.256color" + [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.$TERM" ] && \ + COLORS="/etc/DIR_COLORS.$TERM" - if [ -z "$COLORS" ]; then - for colors in "/etc/DIR_COLORS.$TERM" "/etc/DIR_COLORS" ; do - [ -e "$colors" ] && COLORS="$colors" && break - done - fi + [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \ + [ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \ + COLORS="/etc/DIR_COLORS.256color" + + [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS" ] && \ + COLORS="/etc/DIR_COLORS" # Existence of $COLORS already checked above. [ -n "$COLORS" ] || return diff --git a/coreutils.spec b/coreutils.spec index 7d8f09b..a62ccab 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 8.21 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -375,6 +375,10 @@ fi %{_sbindir}/chroot %changelog +* Thu Mar 14 2013 Ondrej Vasik 8.21-10 +- DIR_COLORS.$TERM should have higher priority than + DIR_COLORS.256color (#921651) + * Mon Mar 11 2013 Ondrej Oprala 8.21-9 - add support for INCLUDE in colorls scripts (#818069)