bug-coreutils
[Top][All Lists]
Advanced

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

Re: How to make the colors different for a symbol link pointing to a fil


From: Jim Meyering
Subject: Re: How to make the colors different for a symbol link pointing to a file and symbol link pointing to a dir?
Date: Fri, 01 Jan 2010 20:17:23 +0100

Eric Blake wrote:
> Here's what I came up with.  OK to squash this with the previous, and push
> the fix?  Prior to the fix in ls.c, sl-dangle2 fails; sl-dangle3 and
> sl-dangle4 just add more coverage to ensure no regressions (it took me a
> while to figure out the difference between ORPHAN and MISSING in the
> dircolors input file - the coreutils.texi could really use some details
> there.  ORPHAN is used for dangling symlinks in short listings, and for
> the symlink on the left side of the -> in long listings; MISSING is used
> for the target of dangling symlinks on the right side of -> in long
> listings.  If omitted, MISSING defaults to ORPHAN).

Nice summary.  I agree the documentation is way too sparse.
Any addition would be most welcome.

> Here is the failure, pre-patch:
>
> *** 1,2 ****
> ! ESC[0mESC[targetmlESC[0m -> nowhere
> ! ESC[m
> \ No newline at end of file
> --- 1 ----
> ! l -> nowhere
>
>
> diff --git a/tests/misc/ls-misc b/tests/misc/ls-misc
> index a077482..ee9b417 100755
> --- a/tests/misc/ls-misc
> +++ b/tests/misc/ls-misc
> @@ -185,6 +185,35 @@ my @Tests =
>                      restore_ls_colors; }},
>       ],
>
> +     # Test for a bug fixed after coreutils-8.2.
> +     ['sl-dangle2', '-o --color=always l',
> +      {OUT_SUBST => 's/.*[0-9][0-9]:[0-9][0-9] //'},
> +      {OUT => "l -> nowhere\n"},
> +      {PRE => sub {symlink 'nowhere', 'l' or die "l: $!\n";
> +                   push_ls_colors('ln=target')
> +       }},
> +      {POST => sub {unlink 'l' or die "l: $!\n";
> +                    restore_ls_colors; }},
> +     ],

That looks perfect.  Please do.




reply via email to

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