From 5b0e7f0ae3f5295021ddcb04e8f04afa255bc759 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <ossi@kde.org>
Date: Fri, 3 Apr 2009 00:30:50 +0200
Subject: [PATCH] call 'file' with -z switch to enable getting type of compressed files
---
src/ext.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ext.c b/src/ext.c
index 510b50e..27d5eee 100644
a
|
b
|
exec_extension (const char *filename, const char *lc_data, int *move_dir, |
302 | 302 | } |
303 | 303 | |
304 | 304 | #ifdef FILE_L |
305 | | # define FILE_CMD "file -L " |
| 305 | # define FILE_CMD "file -L -z " |
306 | 306 | #else |
307 | | # define FILE_CMD "file " |
| 307 | # define FILE_CMD "file -z " |
308 | 308 | #endif |
309 | 309 | |
310 | 310 | /* |
diff --git a/misc/mc.ext.in b/misc/mc.ext.in
index 4860c95..58a89bc 100644
a
|
b
|
type/^Info\ text |
293 | 293 | shell/.info |
294 | 294 | Open=info -f %f |
295 | 295 | |
296 | | # Manual page |
297 | | # Exception - .so libraries are not manual pages |
298 | | regex/\.(so|so\.[0-9\.]*)$ |
299 | | View=%view{ascii} file %f && nm %f |
300 | | |
301 | | regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$ |
302 | | Open=case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more} |
303 | | View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff @MAN_FLAGS@ @MANDOC@ ;; esac |
304 | | |
305 | | # Perl pod page |
306 | | shell/.pod |
307 | | Open=pod2man %f | nroff @MAN_FLAGS@ @MANDOC@ | %var{PAGER:more} |
308 | | View=%view{ascii,nroff} pod2man %f | nroff @MAN_FLAGS@ @MANDOC@ |
309 | | |
310 | 296 | # Troff with me macros. |
311 | 297 | # Exception - "read.me" is not a nroff file. |
312 | 298 | shell/read.me |
… |
… |
shell/read.me |
314 | 300 | |
315 | 301 | # Manual page - compressed |
316 | | regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$ |
317 | | Open=case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more} |
318 | | View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac |
| 302 | type/^(ASCII )?troff.*gzip compressed |
| 303 | Open=gzip -dc %f | nroff -Tlatin1 -mandoc | sensible-pager |
| 304 | View=%view{ascii,nroff} gzip -dc %f | nroff -Tlatin1 -mandoc |
319 | 305 | |
320 | | regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$ |
321 | | Open=case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more} |
322 | | View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac |
| 306 | type/^(ASCII )?troff.*bzip compressed |
| 307 | Open=bzip -dc %f | nroff -Tlatin1 -mandoc | sensible-pager |
| 308 | View=%view{ascii,nroff} bzip -dc %f | nroff -Tlatin1 -mandoc |
323 | 309 | |
324 | | regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$ |
325 | | Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more} |
326 | | View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac |
| 310 | type/^(ASCII )?troff.*bzip2 compressed |
| 311 | Open=bzip2 -dc %f | nroff -Tlatin1 -mandoc | sensible-pager |
| 312 | View=%view{ascii,nroff} bzip2 -dc %f | nroff -Tlatin1 -mandoc |
| 313 | |
| 314 | # Manual page |
| 315 | type/^(ASCII )?troff |
| 316 | Open=nroff -Tlatin1 -mandoc %f | sensible-pager |
| 317 | View=%view{ascii,nroff} nroff -Tlatin1 -mandoc %f |
| 318 | |
| 319 | # Perl pod page |
| 320 | shell/.pod |
| 321 | Open=pod2man %f | nroff @MAN_FLAGS@ @MANDOC@ | %var{PAGER:more} |
| 322 | View=%view{ascii,nroff} pod2man %f | nroff @MAN_FLAGS@ @MANDOC@ |
327 | 323 | |
328 | 324 | regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$ |
329 | 325 | Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more} |
… |
… |
regex/\.([Zz][Oo][Oo])$ |
618 | 614 | View=%view{ascii} zoo l %f |
619 | 615 | |
620 | 616 | # gzip |
621 | | type/^gzip |
622 | | Open=gzip -dc %f | %var{PAGER:more} |
623 | | View=%view{ascii} gzip -dc %f 2>/dev/null |
624 | | |
625 | | regex/\.(gz|Z)?$ |
| 617 | type/\(gzip compressed |
626 | 618 | Open=gzip -dc %f | %var{PAGER:more} |
627 | 619 | View=%view{ascii} gzip -dc %f 2>/dev/null |
628 | 620 | |
629 | 621 | # bzip2 |
630 | | type/^bzip2 |
631 | | Open=bzip2 -dc %f | %var{PAGER:more} |
632 | | View=%view{ascii} bzip2 -dc %f 2>/dev/null |
633 | | |
634 | | regex/\.bz2?$ |
| 622 | type/\(bzip2 compressed |
635 | 623 | Open=bzip2 -dc %f | %var{PAGER:more} |
636 | 624 | View=%view{ascii} bzip2 -dc %f 2>/dev/null |
637 | 625 | |
638 | 626 | # bzip |
639 | | type/^bzip |
| 627 | type/\(bzip compressed |
640 | 628 | Open=bzip -dc %f | %var{PAGER:more} |
641 | 629 | View=%view{ascii} bzip -dc %f 2>/dev/null |
642 | 630 | |
643 | 631 | # compress |
644 | | type/^compress |
| 632 | type/\(compress'd |
645 | 633 | Open=gzip -dc %f | %var{PAGER:more} |
646 | 634 | View=%view{ascii} gzip -dc %f 2>/dev/null |
647 | 635 | |
648 | 636 | # lzma |
649 | | regex/\.lzma$ |
| 637 | type/\(lzma |
650 | 638 | Open=lzma -dc %f | %var{PAGER:more} |
651 | 639 | View=%view{ascii} lzma -dc %f 2>/dev/null |
652 | 640 | |