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.$TERM" ] && \ + COLORS="/etc/DIR_COLORS.$TERM" + [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \ - [ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \ - COLORS="/etc/DIR_COLORS.256color" - - if [ -z "$COLORS" ]; then - for colors in "/etc/DIR_COLORS.$TERM" "/etc/DIR_COLORS" ; do - [ -e "$colors" ] && COLORS="$colors" && break - done - fi + [ "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)