Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/file/dist from ftp.astron.com



details:   https://anonhg.NetBSD.org/src/rev/ec1b2348e983
branches:  trunk
changeset: 783678:ec1b2348e983
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 03 16:27:48 2013 +0000

description:
from ftp.astron.com

diffstat:

 external/bsd/file/dist/ChangeLog                   |   33 +++
 external/bsd/file/dist/TODO                        |   16 +-
 external/bsd/file/dist/m4/visibility.m4            |   77 ++++++++
 external/bsd/file/dist/magic/magdir/adventure      |   14 +-
 external/bsd/file/dist/magic/magdir/amigaos        |    5 +-
 external/bsd/file/dist/magic/magdir/animation      |   12 +-
 external/bsd/file/dist/magic/magdir/assembler      |   16 +-
 external/bsd/file/dist/magic/magdir/audio          |    3 +-
 external/bsd/file/dist/magic/magdir/c-lang         |   12 +-
 external/bsd/file/dist/magic/magdir/cafebabe       |   48 ++++-
 external/bsd/file/dist/magic/magdir/claris         |   10 +-
 external/bsd/file/dist/magic/magdir/commands       |    5 +-
 external/bsd/file/dist/magic/magdir/convex         |    4 +-
 external/bsd/file/dist/magic/magdir/cubemap        |    8 +
 external/bsd/file/dist/magic/magdir/cups           |   64 ++-----
 external/bsd/file/dist/magic/magdir/database       |    7 +-
 external/bsd/file/dist/magic/magdir/dolby          |    3 +-
 external/bsd/file/dist/magic/magdir/dump           |  106 +++--------
 external/bsd/file/dist/magic/magdir/epoc           |   11 +-
 external/bsd/file/dist/magic/magdir/fonts          |   10 +-
 external/bsd/file/dist/magic/magdir/fortran        |    3 +-
 external/bsd/file/dist/magic/magdir/geo            |   14 +-
 external/bsd/file/dist/magic/magdir/gnome-keyring  |    4 +-
 external/bsd/file/dist/magic/magdir/gnu            |   17 +-
 external/bsd/file/dist/magic/magdir/ibm6000        |    9 +-
 external/bsd/file/dist/magic/magdir/images         |  136 +++++++++++++--
 external/bsd/file/dist/magic/magdir/javascript     |   17 +
 external/bsd/file/dist/magic/magdir/jpeg           |   17 +-
 external/bsd/file/dist/magic/magdir/keepass        |   20 ++
 external/bsd/file/dist/magic/magdir/linux          |   11 +-
 external/bsd/file/dist/magic/magdir/mach           |  185 +++++++++++++-------
 external/bsd/file/dist/magic/magdir/macos          |    7 +
 external/bsd/file/dist/magic/magdir/mail.news      |    3 +-
 external/bsd/file/dist/magic/magdir/matroska       |   14 +-
 external/bsd/file/dist/magic/magdir/msdos          |   43 ++++-
 external/bsd/file/dist/magic/magdir/perl           |    9 +-
 external/bsd/file/dist/magic/magdir/pwsafe         |   14 +
 external/bsd/file/dist/magic/magdir/python         |    7 +-
 external/bsd/file/dist/magic/magdir/sgml           |   18 +-
 external/bsd/file/dist/magic/magdir/sql            |   20 +-
 external/bsd/file/dist/magic/magdir/uterus         |   16 +
 external/bsd/file/dist/magic/magdir/windows        |   49 +++++-
 external/bsd/file/dist/magic/magdir/wordprocessors |    6 +-
 external/bsd/file/dist/src/Makefile.am             |    2 +-
 external/bsd/file/dist/src/ascmagic.c              |    8 +-
 external/bsd/file/dist/src/asctime_r.c             |   25 ++
 external/bsd/file/dist/src/cdf.h                   |    4 +-
 external/bsd/file/dist/src/ctime_r.c               |   25 ++
 external/bsd/file/dist/src/file.c                  |   48 ++++-
 external/bsd/file/dist/src/file_opts.h             |    4 +-
 external/bsd/file/dist/src/vasprintf.c             |   27 ++-
 51 files changed, 929 insertions(+), 317 deletions(-)

diffs (truncated from 2166 to 300 lines):

diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/ChangeLog
--- a/external/bsd/file/dist/ChangeLog  Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/ChangeLog  Thu Jan 03 16:27:48 2013 +0000
@@ -1,3 +1,36 @@
+2012-12-19   8:47  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Only print elf capabilities for archs we know (Jan Kaluza)
+
+2012-10-30  19:14  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Add "name" and "use" file types in order to look
+         inside mach-o files.
+
+2012-09-06  10:40  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * make --version exit 0 (Matthew Schultz)
+       * add string/T (Jan Kaluza)
+
+2012-08-09  2:15  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * add z and t modifiers for our own vasprintf
+       * search for $HOME/.magic.mgc if it is there first
+       * fix reads from a pipe, and preserve errno
+
+2012-05-15  13:12  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * use ctime_r, asctime_r
+
+2012-04-06  17:18  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Fixes for indirect offsets to handle apple disk formats
+
+2012-04-03  18:26  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Add windows date field types
+       * More info for windows shortcuts (incomplete)
+
 2012-02-20  17:33  Christos Zoulas <christos%zoulas.com@localhost>
 
        * Fix CDF parsing issues found by CERT's fuzzing tool (Will Dormann)
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/TODO
--- a/external/bsd/file/dist/TODO       Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/TODO       Thu Jan 03 16:27:48 2013 +0000
@@ -1,6 +1,16 @@
-TODOs live in the TODO section of doc/file.man (i.e. file(1)). They
-are more visible there, so please add any further TODOs to that file,
-not here.
+Most TODOs live in the TODO section of doc/file.man (i.e. file(1)).
+They are more visible there, so please add any further TODOs to that
+file, not here. More speculative material can live here.
 
 (This change was made when Reuben Thomas noticed that all the bugs
 listed in the BUGS section of the man page had been fixed!)
+
+---
+
+It would be nice to simplify file considerably. For example,
+reimplement the apprentice and non-pattern magic methods in Python,
+and compile the magic patterns to a giant regex (or something similar)
+so that only a small amount of C is needed (because fast execution is
+typically only required for soft magic, not the more detailed
+information given by hard-wired routines). In this regard, note that
+hplip, which is BSD-licensed, has a magic reimplementation in Python.
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/m4/visibility.m4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/file/dist/m4/visibility.m4   Thu Jan 03 16:27:48 2013 +0000
@@ -0,0 +1,77 @@
+# visibility.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2005, 2008, 2010-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+    dnl First, check whether -Werror can be added to the command line, or
+    dnl whether it leads to an error because of some other option that the
+    dnl user has put into $CC $CFLAGS $CPPFLAGS.
+    AC_MSG_CHECKING([whether the -Werror option is usable])
+    AC_CACHE_VAL([gl_cv_cc_vis_werror], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Werror"
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[]], [[]])],
+        [gl_cv_cc_vis_werror=yes],
+        [gl_cv_cc_vis_werror=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_vis_werror])
+    dnl Now check whether visibility declarations are supported.
+    AC_MSG_CHECKING([for simple visibility declarations])
+    AC_CACHE_VAL([gl_cv_cc_visibility], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -fvisibility=hidden"
+      dnl We use the option -Werror and a function dummyfunc, because on some
+      dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+      dnl "visibility attribute not supported in this configuration; ignored"
+      dnl at the first function definition in every compilation unit, and we
+      dnl don't want to use the option in this case.
+      if test $gl_cv_cc_vis_werror = yes; then
+        CFLAGS="$CFLAGS -Werror"
+      fi
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+             extern __attribute__((__visibility__("default"))) int exportedvar;
+             extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+             extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+             void dummyfunc (void) {}
+           ]],
+           [[]])],
+        [gl_cv_cc_visibility=yes],
+        [gl_cv_cc_visibility=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_visibility])
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
+  AC_SUBST([CFLAG_VISIBILITY])
+  AC_SUBST([HAVE_VISIBILITY])
+  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/magic/magdir/adventure
--- a/external/bsd/file/dist/magic/magdir/adventure     Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/adventure     Thu Jan 03 16:27:48 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: adventure,v 1.13 2010/12/31 16:32:54 christos Exp $
+# $File: adventure,v 1.14 2012/06/21 01:32:26 christos Exp $
 # adventure: file(1) magic for Adventure game files
 #
 # from Allen Garvin <earendil%faeryland.tamu-commerce.edu@localhost>
@@ -33,10 +33,14 @@
 #
 0      ubyte                   >0
 >0     ubyte                   <9
->>16   belong&0xfe00f0f0       0x3030  Infocom game data
->>>0   ubyte                   x       (Z-machine %d,
->>>>2  ubeshort                x       Release %d /
->>>>18 string                  >\0     Serial %.6s)
+>>16   belong&0xfe00f0f0       0x3030
+>>>0   ubyte                   < 10
+>>>>2  ubeshort                < 10
+>>>>>18        regex                   [0-9][0-9][0-9][0-9][0-9][0-9]
+>>>>>>0        ubyte                   < 10    Infocom (Z-machine %d,
+>>>>>>>2       ubeshort        < 10    Release %d /
+>>>>>>>>18     string          >\0     Serial %.6s)
+!:strength + 40
 
 #------------------------------------------------------------------------------
 # Glulx:  file(1) magic for Glulx binaries.
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/magic/magdir/amigaos
--- a/external/bsd/file/dist/magic/magdir/amigaos       Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/amigaos       Thu Jan 03 16:27:48 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: amigaos,v 1.14 2009/09/19 16:28:07 christos Exp $
+# $File: amigaos,v 1.15 2012/06/21 01:13:59 christos Exp $
 # amigaos:  file(1) magic for AmigaOS binary formats:
 
 #
@@ -63,3 +63,6 @@
 # From: Alex Beregszaszi <alex%fsn.hu@localhost>
 0      string          LZX             LZX compressed archive (Amiga)
 
+# From: Przemek Kramarczyk <pkramarczyk%gmail.com@localhost>
+0      string          .KEY            AmigaDOS script
+0      string          .key            AmigaDOS script
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/magic/magdir/animation
--- a/external/bsd/file/dist/magic/magdir/animation     Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/animation     Thu Jan 03 16:27:48 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.45 2011/09/06 11:00:06 christos Exp $
+# $File: animation,v 1.46 2012/08/26 10:43:05 christos Exp $
 # animation:  file(1) magic for animation/movie formats
 #
 # animation formats
@@ -688,10 +688,6 @@
 # iso 13818 transport stream
 #
 # from Oskar Schirmer <schirmer%scara.com@localhost> Feb 3, 2001 (ISO 13818.1)
-# (the following is a little bit restrictive and works fine for a stream
-#  that starts with PAT properly. it won't work for stream data, that is
-#  cut from an input device data right in the middle, but this shouldn't
-#  disturb)
 # syncbyte      8 bit  0x47
 # error_ind     1 bit  -
 # payload_start 1 bit  1
@@ -699,9 +695,9 @@
 # PID          13 bit  0x0000
 # scrambling    2 bit  -
 # adaptfld_ctrl 2 bit  1 or 3
-# conti_count   4 bit  0
-0      belong&0xFF5FFF1F       0x47400010      MPEG transport stream data
->188   byte                    !0x47           CORRUPTED
+# conti_count   4 bit  -
+0      belong&0xFF5FFF10       0x47400010
+>188   byte                    0x47            MPEG transport stream data
 
 # DIF digital video file format <mpruett%sgi.com@localhost>
 0      belong&0xffffff00       0x1f070000      DIF
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/magic/magdir/assembler
--- a/external/bsd/file/dist/magic/magdir/assembler     Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/assembler     Thu Jan 03 16:27:48 2013 +0000
@@ -1,14 +1,18 @@
 #------------------------------------------------------------------------------
-# $File: assembler,v 1.1 2011/12/08 12:12:46 rrt Exp $
+# $File: assembler,v 1.2 2012/10/31 18:41:42 christos Exp $
 # make:  file(1) magic for assembler source
 #
-0      regex   \^\.asciiz\?    assembler source text
+0      regex   \^[\020\t]*\.asciiz\?           assembler source text
 !:mime text/x-asm
-0      regex   \^\.byte                assembler source text
+0      regex   \^[\020\t]*\.byte               assembler source text
+!:mime text/x-asm
+0      regex   \^[\020\t]*\.even               assembler source text
 !:mime text/x-asm
-0      regex   \^\.even                assembler source text
+0      regex   \^[\020\t]*\.globl              assembler source text
+!:mime text/x-asm
+0      regex   \^[\020\t]*\.text               assembler source text
 !:mime text/x-asm
-0      regex   \^\.globl               assembler source text
+0      regex   \^[\020\t]*\.file               assembler source text
 !:mime text/x-asm
-0      regex   \^\.text                assembler source text
+0      regex   \^[\020\t]*\.type               assembler source text
 !:mime text/x-asm
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/magic/magdir/audio
--- a/external/bsd/file/dist/magic/magdir/audio Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/audio Thu Jan 03 16:27:48 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: audio,v 1.64 2012/02/20 16:37:34 christos Exp $
+# $File: audio,v 1.65 2012/10/31 13:38:40 christos Exp $
 # audio:  file(1) magic for sound formats (see also "iff")
 #
 # Jan Nicolai Langfeldt (janl%ifi.uio.no@localhost), Dan Quinlan (quinlan%yggdrasil.com@localhost),
@@ -571,6 +571,7 @@
 
 # musepak support From: "Jiri Pejchal" <jiri.pejchal%gmail.com@localhost>
 0       string          MP+     Musepack audio
+!:mime audio/x-musepack
 >3      byte            255     \b, SV pre8
 >3      byte&0xF        0x6     \b, SV 6
 >3      byte&0xF        0x8     \b, SV 8
diff -r f31d71646889 -r ec1b2348e983 external/bsd/file/dist/magic/magdir/c-lang
--- a/external/bsd/file/dist/magic/magdir/c-lang        Thu Jan 03 14:03:39 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/c-lang        Thu Jan 03 16:27:48 2013 +0000
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: c-lang,v 1.16 2011/12/09 08:02:16 rrt Exp $
+# $File: c-lang,v 1.17 2012/04/28 21:20:26 christos Exp $
 # c-lang:  file(1) magic for C and related languages programs
 #
 
@@ -30,19 +30,19 @@
 # C++
 # The strength of these rules is increased so they beat the C rules above
 0      regex   \^template      C++ source text
-!:strength + 10
+!:strength + 5
 !:mime text/x-c++
 0      regex   \^virtual               C++ source text
-!:strength + 10
+!:strength + 5
 !:mime text/x-c++
 0      regex   \^class         C++ source text
-!:strength + 10
+!:strength + 5
 !:mime text/x-c++
 0      regex   \^public:               C++ source text



Home | Main Index | Thread Index | Old Index