Hide Forgot
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:
(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..
$ 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!