Ticket #4272: nc.ext: fix recognition of plain and compressed man pages.

Support various versions of file utility which output is changed from
one version to another:

$ file --version
file-4.26
magic file from /etc/magic:/usr/share/file/magic
$ file mc.1
mc.1: ASCII troff or preprocessor input text
$ file -z -L mc.1.gz
mc.1.gz: ASCII troff or preprocessor input text (gzip compressed data, was "mc.1", last modified: Tue Aug 24 08:17:47 2021, from Unix)

$ file --version
file-5.40
magic file from /etc/file/magic
eccomp support included
$ file mc.1
mc.1: troff or preprocessor input, ASCII text
$ file -z -L -S mc.1.gz
mc.1.gz: troff or preprocessor input, ASCII text (gzip compressed data, was "mc.1", last modified: Wed Aug 18 04:41:29 2021, from Unix)

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-08-29 19:42:10 +03:00
parent a4cccdff0d
commit 53b1bb63ac

View File

@ -373,28 +373,23 @@ shell/.ms
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view nroff.ms %var{PAGER:more} View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view nroff.ms %var{PAGER:more}
# Manual page - compressed # Manual page - compressed
type/^(ASCII )?troff.*gzip compressed type/troff.*gzip compressed
Open=@EXTHELPERSDIR@/text.sh open man.gz %var{PAGER:more} Open=@EXTHELPERSDIR@/text.sh open man.gz %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.gz %var{PAGER:more} View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.gz %var{PAGER:more}
type/^(ASCII )?troff.*bzip compressed type/troff.*bzip compressed
Open=@EXTHELPERSDIR@/text.sh open man.bz %var{PAGER:more} Open=@EXTHELPERSDIR@/text.sh open man.bz %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.bz %var{PAGER:more} View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.bz %var{PAGER:more}
type/^(ASCII )?troff.*bzip2 compressed type/troff.*bzip2 compressed
Open=@EXTHELPERSDIR@/text.sh open man.bz2 %var{PAGER:more} Open=@EXTHELPERSDIR@/text.sh open man.bz2 %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.bz2 %var{PAGER:more} View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.bz2 %var{PAGER:more}
# Manual page # Manual page
type/^(ASCII )?troff type/troff or preprocessor input
Open=@EXTHELPERSDIR@/text.sh open man %var{PAGER:more} Open=@EXTHELPERSDIR@/text.sh open man %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man %var{PAGER:more} View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man %var{PAGER:more}
# Perl pod page
shell/.pod
Open=@EXTHELPERSDIR@/text.sh open pod %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view pod %var{PAGER:more}
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz$ regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz$
Open=@EXTHELPERSDIR@/text.sh open man.lz %var{PAGER:more} Open=@EXTHELPERSDIR@/text.sh open man.lz %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.lz %var{PAGER:more} View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.lz %var{PAGER:more}
@ -415,6 +410,11 @@ regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.zst$
Open=@EXTHELPERSDIR@/text.sh open man.zst %var{PAGER:more} Open=@EXTHELPERSDIR@/text.sh open man.zst %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.zst %var{PAGER:more} View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view man.zst %var{PAGER:more}
# Perl pod page
shell/.pod
Open=@EXTHELPERSDIR@/text.sh open pod %var{PAGER:more}
View=%view{ascii,nroff} @EXTHELPERSDIR@/text.sh view pod %var{PAGER:more}
# CHM # CHM
shell/i/.chm shell/i/.chm
Open=@EXTHELPERSDIR@/text.sh open chm Open=@EXTHELPERSDIR@/text.sh open chm