bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ls: support disabling colors on all subtypes


From: Jim Meyering
Subject: Re: [PATCH] ls: support disabling colors on all subtypes
Date: Tue, 22 Sep 2009 10:16:29 +0200

Pádraig Brady wrote:
> Pádraig Brady wrote:
>> I was trying to disable the green colors today in my ls listing
>> and noticed that if you do that the directories are shown
>> without color rather than falling back to the standard color
>> for directories (blue).
>>
>> The attached patch fixes that up.
...
> Subject: [PATCH] ls: allow disabling colors on all file types
>
> * src/ls.c (print_color_indicator): Use consistent syntax for
> all file and directory subtypes, and fall back to the color
> of the base type if there is no enabled color for the subtype.
> This allows turning off specific colors for o+w dirs for example.
> * tests/ls/color-dtype-dir: Add a case to test that turning off
> coloring for o+w directories, falls back to standard dir color.
> * NEWS: Mention the fix
> Introduced by commit ac467814, 2005-09-05,
> "Colorize set-user-ID ... files and sticky ... directories."

Thanks for doing this.
However, with that change, the ls/no-cap test now fails:
(on Fedora 11, configured with libcap-devel.x86_64)

    make check -C tests TESTS=ls/no-cap VERBOSE=yes

perhaps because of the way it tries to disable colorizing
based on capabilities:

    rm -f out
    eval "$(TERM=xterm dircolors -b | sed 's/ca=[^:]*:/ca=:/')"
    strace -e capget ls --color=always > /dev/null 2> out || fail=1

    $EGREP 'capget\(' out && fail=1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]