Skip to content

Commit

Permalink
do not use any longer antiword for decoding MS word files
Browse files Browse the repository at this point in the history
  • Loading branch information
wofr06 committed Jan 28, 2024
1 parent e32be35 commit 552aede
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
****************************************************************************
# ChangeLog for lesspipe.sh #
****************************************************************************
- don't use antiword any longer, outdated
- use 7zip instead of now outdated p7zip if available
- propagate file extension to newly created temporary files
- use again csvlook for display of csv files if available
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ the author by email.
- zip archive requires `bsdtar` or `unzip`
- jar archive requires `bsdtar` or `unzip`
- rar archive requires `bsdtar` or `unrar` or `rar`
- 7-zip archive requires `7zr`
- 7-zip archive requires `7zz` or `7zr` or `7z` or `7za`
- lzip archive requires `lzip`
- iso images requires `bsdtar` or `isoinfo`
- rpm requires `rpm2cpio` and `cpio` or `bsdtar`
Expand All @@ -204,7 +204,7 @@ the author by email.
- directory displayed using `ls -lA`
- nroff(man) requires `groff` or `mandoc`
- shared library requires `nm`
- MS Word (doc) requires `wvText` or `antiword` or `catdoc` or `libreoffice`
- MS Word (doc) requires `wvText` or `catdoc` or `libreoffice`
- Powerpoint (ppt) requires `catppt`
- Excel (xls) requires `in2csv` (csvkit) or `xls2csv`
- odt requires `pandoc` or `odt2txt` or `libreoffice`
Expand Down Expand Up @@ -401,7 +401,6 @@ filtering for certain file types.
### 11.1 URLs to some utilities (with last known release)
- 7zz https://sourceforge.net/projects/sevenzip/ (2023)
- 7zr (outdated!) https://sourceforge.net/projects/p7zip/ (2016)
- antiword no longer valid: https://www.winfield.demon.nl/ (2005)
- cabextract https://www.cabextract.org.uk/ (2019)
- catdoc,catppt,xls2csv https://www.wagner.pp.ru/~vitus/software/catdoc/ (2016)
- ccze https://github.com/cornet/ccze (2011)
Expand Down
5 changes: 3 additions & 2 deletions lesscomplete
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ get_unpack_cmd () {
{ has_cmd cabextract && prog=cabextract; } ;;
7z-compressed)
{ has_cmd bsdtar && prog=bsdtar; } ||
{ has_cmd 7zz && prog=7zz; } ||
{ has_cmd 7zr && prog=7zr; } ||
{ has_cmd 7za && prog=7za; } ;;
iso9660-image)
Expand Down Expand Up @@ -244,7 +245,7 @@ isarchive () {
istemp cabextract2 "$2" "$3" ;;
isoinfo)
istemp "isoinfo -i" "$2" "-x$3" ;;
7za|7zr)
7zz|7za|7zr)
istemp "$prog e -so" "$2" "$3"
esac
else
Expand All @@ -264,7 +265,7 @@ isarchive () {
istemp "isoinfo -d -i" "$2" >/dev/null
istemp "isoinfo -d -i" "$t"| grep -E '^Joliet' && joliet=J
isoinfo -fR"$joliet" -i "$t" ;;
7za|7zr)
7zz|7za|7zr)
$prog l "$2"|grep -E '^[0-9][0-9][0-9[0-9]'|cut -c 54-|grep -Ev ' files$'
esac
fi
Expand Down
1 change: 0 additions & 1 deletion lesspipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ isfinal () {
msword)
t="$1"; [[ "$t" == - ]] && t=/dev/stdin
{ has_cmd wvText && cmd=(istemp wvText "$t" /dev/stdout); } ||
{ has_cmd antiword && cmd=(antiword "$1"); } ||
{ has_cmd catdoc && cmd=(catdoc "$1"); } ||
{ has_cmd libreoffice && cmd=(isoffice2 "$1"); } ;;
ms-powerpoint)
Expand Down
10 changes: 5 additions & 5 deletions test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ sub comp {
= test
less tests/archive.tgz:test_cab:a\ text.gz # (on the fly), needs cabextract
= test
less $T/tests/test_7z # 7z contents, needs 7zr|7za
less $T/tests/test_7z # 7z contents, needs 7zz|7zr|7za
~ .* testok/aaa.txt
less tests/archive.tgz:test_7z # (on the fly), needs 7zr|7za
less tests/archive.tgz:test_7z # (on the fly), needs 7zz|7zr|7za
~ .* testok/aaa.txt
less $T/tests/test_7z:testok/a\|b.txt # extract file from 7z, needs 7zr|7za
less $T/tests/test_7z:testok/a\|b.txt # extract file from 7z, needs 7zz|7zr|7za
= test
less tests/archive.tgz:test_7z:testok/a\|b.txt # (on the fly), needs 7zr|7za
less tests/archive.tgz:test_7z:testok/a\|b.txt # (on the fly), needs 7zz|7zr|7za
= test
less $T/tests/test_iso # iso9660 contents, needs bsdtar
~ .* ISO.TXT
Expand Down Expand Up @@ -363,7 +363,7 @@ sub comp {
~ \s*test
less tests/filter.tgz:test_ods # ods, needs xlscat|libreoffice,html_converter
~ test
less tests/filter.tgz:test_doc # doc (old), needs wvText|antiword|catdoc|libreoffice
less tests/filter.tgz:test_doc # doc (old), needs wvText|catdoc|libreoffice
~ *test
less tests/filter.tgz:test_ppt:ms-powerpoint # ppt (old), catppt not always working, needs libreoffice,html_converter
~ .*1. test|\s*test
Expand Down

0 comments on commit 552aede

Please sign in to comment.