Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351426 - sys-apps/less: lesspipe does not colorize shell scripts
Summary: sys-apps/less: lesspipe does not colorize shell scripts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-12 10:25 UTC by Raphaël Vinot
Modified: 2011-01-20 13:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix the two bug (lesspipe.patch,950 bytes, patch)
2011-01-12 10:26 UTC, Raphaël Vinot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphaël Vinot 2011-01-12 10:25:26 UTC
lesspipe.sh has some bugs: 
- the source code files are never colorized
- the command name of torrentinfo is torrentinfo and not torrentinfo-console

With my patch, it just works :) 

Reproducible: Always

Steps to Reproduce:
1. export LESSCOLOR=always
2. less /usr/bin/lesspipe
3. no colors

Actual Results:  
no colors

Expected Results:  
colors
Comment 1 Raphaël Vinot 2011-01-12 10:26:33 UTC
Created attachment 259613 [details, diff]
Patch to fix the two bug
Comment 2 SpanKY gentoo-dev 2011-01-18 20:27:07 UTC
the torrentinfo binary has been renamed ... it isnt really "wrong"

http://sources.gentoo.org/sys-apps/less/files/lesspipe.sh?r1=1.43&r2=1.44

as for colorizes, it works fine for me.
$ echo 'main(){}' > test.c
$ LESSCOLOR=yes less test.c
Comment 3 Raphaël Vinot 2011-01-19 14:35:28 UTC
(In reply to comment #2)
> the torrentinfo binary has been renamed ... it isnt really "wrong"
> 
> http://sources.gentoo.org/sys-apps/less/files/lesspipe.sh?r1=1.43&r2=1.44

you're right, I didn't checked. 

> as for colorizes, it works fine for me.
> $ echo 'main(){}' > test.c
> $ LESSCOLOR=yes less test.c

It also work for me... but for example 
$ LESSCOLOR=yes less /usr/bin/lesspipe.sh
-> no colors with the lesspipe provided by sys-apps/less
-> colors with 'my' lesspipe

Comment 4 Raphaël Vinot 2011-01-19 16:44:02 UTC
Well, I tested a bit more on a "bare" system and it seems to work better than on my own system: the bash scripts are not colorized but it works for all the other files... 
Comment 5 SpanKY gentoo-dev 2011-01-20 03:26:26 UTC
ok, i played with it a bit more and see what's going on.  i implemented your suggestion in a slightly different way.

http://sources.gentoo.org/sys-apps/less/files/lesspipe.sh?r1=1.44&r2=1.45
Comment 6 Raphaël Vinot 2011-01-20 13:09:26 UTC
well done, it is much more elegant!

Thanks.