Bug 711889 - lesspipe man page reads are broken
Summary: lesspipe man page reads are broken
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: less
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Vojtech Vitek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-08 21:35 UTC by Jorn Amundsen
Modified: 2015-03-04 23:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-13 12:01:15 UTC
Type: ---


Attachments (Terms of Use)
data an comparison of broken vs. fixed lesspipe.sh (14.79 KB, application/x-compressed-tar)
2011-06-08 21:35 UTC, Jorn Amundsen
no flags Details

Description Jorn Amundsen 2011-06-08 21:35:12 UTC
Created attachment 503787 [details]
data an comparison of broken vs. fixed lesspipe.sh

Description of problem:
The lesspipe.sh case switch source code to handle compressed and uncompressed man pages is broken. There are multiple issues, from using obsoleted switches to man(1), e.g. -l, erroneous usage of the man(1) ``name'' command line argument and inappropriate use of file(1) to check for man page contents: e.g. using file(1) on /usr/share/man1/man.1.gz returns ``FORTRAN program'' which isn't quite the expected ``troff or preprocessor input text''.

A modified lesspipe.sh is attached as a suggestion for improvement. You might want to do further changes to this file, implement the desired functionality differently or remove man page handling.

A final and not related issue: the less.spec make command line appends datadir=%{_docdir}. This should IMO read datarootdir=%{_docdir}. There is no variable ``datadir'' in Makefile.in. However, a Makefile.in @datarootdir@ is not properly expanded when generating Makefile from Makefile.in.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. unpack attached tar archive
2. read the README file for further instructions
3.
  
Actual results:
Unable to display some man format files

Expected results:
Less w/lesspipe.sh enabled should be able to display man page files

Additional info:

Comment 1 Vojtech Vitek 2011-06-30 17:25:47 UTC
(In reply to comment #0)
> There are multiple issues, from using obsoleted switches
> to man(1), e.g. -l,
Where did you get that information? It is not obsolete switch, afaik.

> erroneous usage of the man(1) ``name'' command line argument
I don't follow you, can you please explain it in detail?

> and inappropriate use of file(1) to check for man page contents: e.g.
> using file(1) on /usr/share/man1/man.1.gz returns ``FORTRAN program'' which
> isn't quite the expected ``troff or preprocessor input text''.
So the bug is in file(1), as it can't recognize the format correctly. Feel free to open new bug report for the file component. Imho, I wouldn't call it as "inappropriate use" - this is first time I see it's wrong guess.

Anyway, thanks for the bug report!
I'm waiting for your response now..

Comment 2 Vojtech Vitek 2011-09-13 12:01:15 UTC
$ less /usr/share/man/man1/man.1.gz
  # OK!

$ cat /usr/share/man/man1/man.1.gz | file -
/dev/stdin: gzip compressed data, from Unix, max compression
  # OK!

$ cat /usr/share/man/man1/man.1.gz | gzip -d | file -
/dev/stdin: troff or preprocessor input, ASCII text
  # OK!

It is OK now, file(1) seems to work..

---

I'm closing this bz NOTABUG.
Feel free to reopen, if you wish to continue the discussion. Thanks!


Note You need to log in before you can comment on or make changes to this bug.