From 2216daa91b58ab08e8f760ad545071c9a0c9c131 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 8 Apr 2008 12:22:14 +0000 Subject: [PATCH] Add some more MIME types, mainly for scripting languages. Change some that were "application/x-foo" to "text/x-foo". Move the gnu gettext catalog patterns to "gnu" from "lisp". --- magic/Magdir/commands | 47 ++++++++++++++++++++++++------------------- magic/Magdir/diff | 5 +++++ magic/Magdir/gnu | 4 ++++ magic/Magdir/lisp | 11 ++++++---- magic/Magdir/msdos | 4 ++++ magic/Magdir/perl | 14 ++++++------- magic/Magdir/sgml | 6 ++++++ 7 files changed, 59 insertions(+), 32 deletions(-) diff --git a/magic/Magdir/commands b/magic/Magdir/commands index cdfc66d8..0942802d 100644 --- a/magic/Magdir/commands +++ b/magic/Magdir/commands @@ -4,48 +4,48 @@ # #0 string : shell archive or script for antique kernel text 0 string/b #!\ /bin/sh POSIX shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /bin/csh C shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript # korn shell magic, sent by George Wu, gwu@clyde.att.com 0 string/b #!\ /bin/ksh Korn shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /bin/tcsh Tenex C shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript # # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson) 0 string/b #!\ /bin/zsh Paul Falstad's zsh script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /usr/bin/zsh Paul Falstad's zsh script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /usr/local/bin/zsh Paul Falstad's zsh script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /usr/local/bin/ash Neil Brown's ash script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /usr/local/bin/ae Neil Brown's ae script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /bin/nawk new awk script text executable -!:mime application/x-nawk +!:mime text/x-nawk 0 string/b #!\ /usr/bin/nawk new awk script text executable -!:mime application/x-nawk +!:mime text/x-nawk 0 string/b #!\ /usr/local/bin/nawk new awk script text executable -!:mime application/x-nawk +!:mime text/x-nawk 0 string/b #!\ /bin/gawk GNU awk script text executable -!:mime application/x-gawk +!:mime text/x-gawk 0 string/b #!\ /usr/bin/gawk GNU awk script text executable -!:mime application/x-gawk +!:mime text/x-gawk 0 string/b #!\ /usr/local/bin/gawk GNU awk script text executable -!:mime application/x-gawk +!:mime text/x-gawk # 0 string/b #!\ /bin/awk awk script text executable -!:mime application/x-awk +!:mime text/x-awk 0 string/b #!\ /usr/bin/awk awk script text executable -!:mime application/x-awk +!:mime text/x-awk # update to distinguish from *.vcf files # this is broken because postscript has /EBEGIN{ for example. #0 search/Bb BEGIN { awk script text @@ -55,9 +55,9 @@ # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de) 0 string/b #!\ /bin/bash Bourne-Again shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript 0 string/b #!\ /usr/local/bin/bash Bourne-Again shell script text executable -!:mime application/x-shellscript +!:mime text/x-shellscript # using env 0 string #!/usr/bin/env a @@ -68,10 +68,15 @@ # PHP scripts # Ulf Harnhammar 0 search/1/c =7 string >\0 \b, format %s >7 string 02 \b (frcode) + +# Files produced by GNU gettext +0 long 0xDE120495 GNU-format message catalog data +0 long 0x950412DE GNU-format message catalog data diff --git a/magic/Magdir/lisp b/magic/Magdir/lisp index 21449926..5144e26e 100644 --- a/magic/Magdir/lisp +++ b/magic/Magdir/lisp @@ -12,12 +12,19 @@ #>2 search/2048 \r Windows INF file 0 search/256 (if\ Lisp/Scheme program text +!:mime text/x-lisp 0 search/256 (setq\ Lisp/Scheme program text +!:mime text/x-lisp 0 search/256 (defvar\ Lisp/Scheme program text +!:mime text/x-lisp 0 search/256 (defparam\ Lisp/Scheme program text +!:mime text/x-lisp 0 search/256 (defun\ Lisp/Scheme program text +!:mime text/x-lisp 0 search/256 (autoload\ Lisp/Scheme program text +!:mime text/x-lisp 0 search/256 (custom-set-variables\ Lisp/Scheme program text +!:mime text/x-lisp # Emacs 18 - this is always correct, but not very magical. 0 string \012( Emacs v18 byte-compiled Lisp data @@ -35,10 +42,6 @@ 0 long 0x70768BD2 CLISP memory image data 0 long 0xD28B7670 CLISP memory image data, other endian -# Files produced by GNU gettext -0 long 0xDE120495 GNU-format message catalog data -0 long 0x950412DE GNU-format message catalog data - #.com and .bin for MIT scheme 0 string \372\372\372\372 MIT scheme (library?) diff --git a/magic/Magdir/msdos b/magic/Magdir/msdos index bb81498d..f449643d 100644 --- a/magic/Magdir/msdos +++ b/magic/Magdir/msdos @@ -7,9 +7,13 @@ # updated by Joerg Jenderek 0 string @ >1 string/cB \ echo\ off MS-DOS batch file text +!:mime text/x-msdos-batch >1 string/cB echo\ off MS-DOS batch file text +!:mime text/x-msdos-batch >1 string/cB rem\ MS-DOS batch file text +!:mime text/x-msdos-batch >1 string/cB set\ MS-DOS batch file text +!:mime text/x-msdos-batch # OS/2 batch files are REXX. the second regex is a bit generic, oh well diff --git a/magic/Magdir/perl b/magic/Magdir/perl index 045edcbb..73fb88ba 100644 --- a/magic/Magdir/perl +++ b/magic/Magdir/perl @@ -5,19 +5,19 @@ # Keith Waclena # Send additions to 0 search/1/b #!\ /bin/perl Perl script text executable -!:mime application/x-perl +!:mime text/x-perl 0 search/1 eval\ "exec\ /bin/perl Perl script text -!:mime application/x-perl +!:mime text/x-perl 0 search/1/b #!\ /usr/bin/perl Perl script text executable -!:mime application/x-perl +!:mime text/x-perl 0 search/1 eval\ "exec\ /usr/bin/perl Perl script text -!:mime application/x-perl +!:mime text/x-perl 0 search/1/b #!\ /usr/local/bin/perl Perl script text executable -!:mime application/x-perl +!:mime text/x-perl 0 search/1 eval\ "exec\ /usr/local/bin/perl Perl script text -!:mime application/x-perl +!:mime text/x-perl 0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text -!:mime application/x-perl +!:mime text/x-perl # by Dmitry V. Levin and Alexey Tourbin diff --git a/magic/Magdir/sgml b/magic/Magdir/sgml index 203b84e1..3742caf0 100644 --- a/magic/Magdir/sgml +++ b/magic/Magdir/sgml @@ -25,14 +25,20 @@ # Extensible markup language (XML), a subset of SGML # from Marc Prud'hommeaux (marc@apocalypse.org) 0 search/1/cb \15 search/1 >\0 %.3s document text >>23 search/1 \>24 search/1 \