Debian Bug report logs - #479544
dircolors: please eliminate duplicates before writing variable

version graph

Package: coreutils; Maintainer for coreutils is Michael Stone <[email protected]>; Source for coreutils is src:coreutils (PTS, buildd, popcon).

Reported by: martin f krafft <[email protected]>

Date: Mon, 5 May 2008 12:45:03 UTC

Severity: wishlist

Found in version coreutils/6.10-6

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Michael Stone <[email protected]>:
Bug#479544; Package coreutils. (full text, mbox, link).


Message #3 received at [email protected] (full text, mbox, reply):

From: martin f krafft <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: dircolors: please eliminate duplicates before writing variable
Date: Mon, 5 May 2008 13:21:22 +0100
[Message part 1 (text/plain, inline)]
Package: coreutils
Version: 6.10-6
Severity: wishlist
File: /usr/bin/dircolors

If I specify a filetype twice in the dircolors file, the resulting
LS_COLORS will have the entry twice:

  lapse:/% echo "EXEC 00\nEXEC 01" | dircolors -
  LS_COLORS='ex=00:ex=01:';
  export LS_COLORS

While /bin/ls works fine with it and prefers the last setting over
previous ones, e.g. zsh's completion system works the other way.

I realise I could be filing this as a bug against zsh, but that
would be asking zsh to work around a shortcoming in the dircolors
"API".

Instead, would it be possible to fix dircolors so that it eliminates
earlier entries if the dircolors file overrides entries for a given
file class?

The rationale is that I need dircolors --print-database output in my
own dircolors file if I don't want to hardcode defaults by hand. If
I do that, I'd prefer to keep customisation separate.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1+scoflowctrl.1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages coreutils depends on:
ii  libacl1                       2.2.47-2   Access control list shared library
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libselinux1                   2.0.59-1   SELinux shared libraries

coreutils recommends no packages.

-- no debconf information


-- 
 .''`.   martin f. krafft <[email protected]>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#479544; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Jim Meyering <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #8 received at [email protected] (full text, mbox, reply):

From: Jim Meyering <[email protected]>
To: martin f krafft <[email protected]>, [email protected]
Cc: [email protected]
Subject: Re: Bug#479544: dircolors: please eliminate duplicates before writing variable
Date: Mon, 05 May 2008 19:29:27 +0200
martin f krafft <[email protected]> wrote:
> Package: coreutils
> Version: 6.10-6
> Severity: wishlist
> File: /usr/bin/dircolors
>
> If I specify a filetype twice in the dircolors file, the resulting
> LS_COLORS will have the entry twice:
>
>   lapse:/% echo "EXEC 00\nEXEC 01" | dircolors -
>   LS_COLORS='ex=00:ex=01:';
>   export LS_COLORS
>
> While /bin/ls works fine with it and prefers the last setting over
> previous ones, e.g. zsh's completion system works the other way.
>
> I realise I could be filing this as a bug against zsh, but that
> would be asking zsh to work around a shortcoming in the dircolors
> "API".
>
> Instead, would it be possible to fix dircolors so that it eliminates
> earlier entries if the dircolors file overrides entries for a given
> file class?
>
> The rationale is that I need dircolors --print-database output in my
> own dircolors file if I don't want to hardcode defaults by hand. If
> I do that, I'd prefer to keep customisation separate.

Good idea.
If no one volunteers to do this soon
I'll put it on the TODO list.




Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#479544; Package coreutils. (full text, mbox, link).


Message #11 received at [email protected] (full text, mbox, reply):

From: martin f krafft <[email protected]>
To: Jim Meyering <[email protected]>, [email protected]
Cc: [email protected]
Subject: Re: Bug#479544: dircolors: please eliminate duplicates before writing variable
Date: Tue, 6 May 2008 09:30:43 +0100
[Message part 1 (text/plain, inline)]
also sprach Jim Meyering <[email protected]> [2008.05.05.1829 +0100]:
> If no one volunteers to do this soon
> I'll put it on the TODO list.

FWIW, this is a zsh-style way of dealing with it. It's not exactly
rocket science, I just use an associative array to uniquify:

  http://git.madduck.net/v/etc/zsh.git?a=blob;f=.zsh/zshrc/89_dircolors;hb=HEAD

-- 
 .''`.   martin f. krafft <[email protected]>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#479544; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Jim Meyering <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #16 received at [email protected] (full text, mbox, reply):

From: Jim Meyering <[email protected]>
To: martin f krafft <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: Bug#479544: dircolors: please eliminate duplicates before writing variable
Date: Tue, 06 May 2008 10:46:37 +0200
martin f krafft <[email protected]> wrote:
> also sprach Jim Meyering <[email protected]> [2008.05.05.1829 +0100]:
>> If no one volunteers to do this soon
>> I'll put it on the TODO list.
>
> FWIW, this is a zsh-style way of dealing with it. It's not exactly
> rocket science, I just use an associative array to uniquify:
>
>   http://git.madduck.net/v/etc/zsh.git?a=blob;f=.zsh/zshrc/89_dircolors;hb=HEAD

Yep.  When this is done in dircolors, it'll do the same, using lib/hash.c.




Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#479544; Package coreutils. (Tue, 15 Mar 2022 19:12:04 GMT) (full text, mbox, link).


Acknowledgement sent to "martin f krafft" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Tue, 15 Mar 2022 19:12:04 GMT) (full text, mbox, link).


Message #21 received at [email protected] (full text, mbox, reply):

From: "martin f krafft" <[email protected]>
To: [email protected]
Subject: Re: Bug#479544: dircolors: please eliminate duplicates before writing variable
Date: Tue, 15 Mar 2022 10:21:35 -0800
[Message part 1 (text/html, inline)]

Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#479544; Package coreutils. (Tue, 21 Jun 2022 14:45:04 GMT) (full text, mbox, link).


Acknowledgement sent to "martin f krafft" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Tue, 21 Jun 2022 14:45:04 GMT) (full text, mbox, link).


Message #26 received at [email protected] (full text, mbox, reply):

From: "martin f krafft" <[email protected]>
To: [email protected]
Subject: Re: Bug#479544: dircolors: please eliminate duplicates before writing variable
Date: Tue, 21 Jun 2022 14:36:04 +0000
[Message part 1 (text/html, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 08:45:06 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.