DIR_COLORS.xterm should have higher priority than DIR_COLORS.256color (#921651)

This commit is contained in:
Ondřej Vašík 2013-03-14 16:50:09 +01:00
parent 1ad51b6276
commit c7a1b74c04
3 changed files with 16 additions and 12 deletions

View File

@ -13,14 +13,14 @@ set COLORS=/etc/DIR_COLORS
set TMP="`mktemp .colorlsXXX`" set TMP="`mktemp .colorlsXXX`"
if ($?TERM) then 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 ( -e "/etc/DIR_COLORS.256color" ) then
if ( "`tput colors`" == "256" ) then if ( "`tput colors`" == "256" ) then
set COLORS=/etc/DIR_COLORS.256color set COLORS=/etc/DIR_COLORS.256color
endif endif
endif endif
if ( -e "/etc/DIR_COLORS.$TERM" ) then
set COLORS="/etc/DIR_COLORS.$TERM"
endif
endif endif
if ( -f ~/.dircolors ) set COLORS=~/.dircolors if ( -f ~/.dircolors ) set COLORS=~/.dircolors
if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors

View File

@ -21,15 +21,15 @@ if [ -z "$USER_LS_COLORS" ]; then
break break
done done
[ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \ [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.$TERM" ] && \
[ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \ COLORS="/etc/DIR_COLORS.$TERM"
COLORS="/etc/DIR_COLORS.256color"
if [ -z "$COLORS" ]; then [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \
for colors in "/etc/DIR_COLORS.$TERM" "/etc/DIR_COLORS" ; do [ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \
[ -e "$colors" ] && COLORS="$colors" && break COLORS="/etc/DIR_COLORS.256color"
done
fi [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS" ] && \
COLORS="/etc/DIR_COLORS"
# Existence of $COLORS already checked above. # Existence of $COLORS already checked above.
[ -n "$COLORS" ] || return [ -n "$COLORS" ] || return

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils Name: coreutils
Version: 8.21 Version: 8.21
Release: 9%{?dist} Release: 10%{?dist}
License: GPLv3+ License: GPLv3+
Group: System Environment/Base Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/ Url: http://www.gnu.org/software/coreutils/
@ -375,6 +375,10 @@ fi
%{_sbindir}/chroot %{_sbindir}/chroot
%changelog %changelog
* Thu Mar 14 2013 Ondrej Vasik <ovasik@redhat.com> 8.21-10
- DIR_COLORS.$TERM should have higher priority than
DIR_COLORS.256color (#921651)
* Mon Mar 11 2013 Ondrej Oprala <ooprala@redhat.com> 8.21-9 * Mon Mar 11 2013 Ondrej Oprala <ooprala@redhat.com> 8.21-9
- add support for INCLUDE in colorls scripts (#818069) - add support for INCLUDE in colorls scripts (#818069)