Hello community,

here is the log from the commit of package file for openSUSE:Factory checked in 
at 2013-12-05 06:54:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/file (Old)
 and      /work/SRC/openSUSE:Factory/.file.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "file"

Changes:
--------
--- /work/SRC/openSUSE:Factory/file/file.changes        2013-11-05 
13:52:30.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.file.new/file.changes   2013-12-05 
06:54:34.000000000 +0100
@@ -1,0 +2,11 @@
+Mon Dec  2 11:29:44 UTC 2013 - [email protected]
+
+- Update to file version 5.16 (bug fix release)
+  * always leave magic file loaded, don't unload for magic_check, etc.
+  * fix default encoding to binary instead of unknown which broke recently
+  * handle empty and one byte files, less specially so that
+    --mime-encoding does not break completely.
+  * fix erroneous non-zero exit code from non-existant file and message
+  * add CDF MSI file detection (Guy Helmer)
+
+-------------------------------------------------------------------
--- /work/SRC/openSUSE:Factory/file/python-magic.changes        2013-10-02 
08:48:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.file.new/python-magic.changes   2013-12-05 
06:54:34.000000000 +0100
@@ -1,0 +2,5 @@
+Mon Dec  2 11:31:12 UTC 2013 - [email protected]
+
+- Make it ready for file 5.16
+
+-------------------------------------------------------------------
@@ -4 +9 @@
-- Make if ready for file 5.15 
+- Make it ready for file 5.15 

Old:
----
  file-5.12-ocloexec.patch
  file-5.15.dif
  file-5.15.tar.gz

New:
----
  file-5.16-ocloexec.patch
  file-5.16.dif
  file-5.16.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ file.spec ++++++
--- /var/tmp/diff_new_pack.LBRQq9/_old  2013-12-05 06:54:35.000000000 +0100
+++ /var/tmp/diff_new_pack.LBRQq9/_new  2013-12-05 06:54:35.000000000 +0100
@@ -30,14 +30,14 @@
 %endif
 #
 # Set Version also in python-magic.spec
-Version:        5.15
+Version:        5.16
 Release:        0
 Summary:        A Tool to Determine File Types
 License:        BSD-2-Clause
 Group:          Productivity/File utilities
 Source:         ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
 Source2:        baselibs.conf
-Patch:          file-5.15.dif
+Patch:          file-5.16.dif
 Patch1:         file-5.14-misc.dif
 Patch4:         file-4.24-autoconf.dif
 Patch5:         file-5.14-tex.dif
@@ -57,7 +57,7 @@
 Patch28:        file-5.07-iso9660.dif
 Patch31:        file-5.07-biorad.dif
 Patch32:        file-5.07-clicfs.dif
-Patch33:        file-5.12-ocloexec.patch
+Patch33:        file-5.16-ocloexec.patch
 Patch34:        file-5.12-endian.patch
 Patch35:        file-5.12-nitpick.dif
 Patch36:        file-5.15-clear-invalid.patch

++++++ python-magic.spec ++++++
--- /var/tmp/diff_new_pack.LBRQq9/_old  2013-12-05 06:54:35.000000000 +0100
+++ /var/tmp/diff_new_pack.LBRQq9/_new  2013-12-05 06:54:35.000000000 +0100
@@ -23,7 +23,7 @@
 BuildRequires:  python-devel
 BuildRequires:  zlib-devel
 Url:            http://www.darwinsys.com/file/
-Version:        5.15
+Version:        5.16
 Release:        0
 Summary:        Python module to use libmagic
 License:        BSD-3-Clause and BSD-4-Clause

++++++ file-5.12-ocloexec.patch -> file-5.16-ocloexec.patch ++++++
--- /work/SRC/openSUSE:Factory/file/file-5.12-ocloexec.patch    2013-10-02 
08:48:17.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.file.new/file-5.16-ocloexec.patch       
2013-12-05 06:54:34.000000000 +0100
@@ -1,6 +1,6 @@
 --- src/apprentice.c
 +++ src/apprentice.c   2013-09-30 00:00:00.000000000 +0000
-@@ -938,7 +938,7 @@ load_1(struct magic_set *ms, int action,
+@@ -944,7 +944,7 @@ load_1(struct magic_set *ms, int action,
        ssize_t len;
        struct magic_entry me;
  
@@ -9,7 +9,7 @@
        if (f == NULL) {
                if (errno != ENOENT)
                        file_error(ms, errno, "cannot read magic file `%s'",
-@@ -2599,7 +2599,7 @@ apprentice_map(struct magic_set *ms, con
+@@ -2605,7 +2605,7 @@ apprentice_map(struct magic_set *ms, con
        if (dbname == NULL)
                goto error;
  
@@ -18,7 +18,7 @@
                goto error;
  
        if (fstat(fd, &st) == -1) {
-@@ -2711,7 +2711,7 @@ apprentice_compile(struct magic_set *ms,
+@@ -2717,7 +2717,7 @@ apprentice_compile(struct magic_set *ms,
        if (dbname == NULL) 
                goto out;
  
@@ -50,13 +50,13 @@
                            progname, fn, strerror(errno));
                        return 1;
 --- src/magic.c
-+++ src/magic.c        2013-09-30 00:00:00.000000000 +0000
++++ src/magic.c        2013-12-02 10:36:33.334786103 +0000
 @@ -372,7 +372,7 @@ file_or_fd(struct magic_set *ms, const c
                else
                        pos = lseek(fd, (off_t)0, SEEK_CUR);
        } else {
 -              int flags = O_RDONLY|O_BINARY;
 +              int flags = O_RDONLY|O_BINARY|O_CLOEXEC;
+               int okstat = stat(inname, &sb) == 0;
  
-               if (stat(inname, &sb) == 0 && S_ISFIFO(sb.st_mode)) {
- #ifdef O_NONBLOCK
+               if (okstat && S_ISFIFO(sb.st_mode)) {

++++++ file-5.15.dif -> file-5.16.dif ++++++
--- /work/SRC/openSUSE:Factory/file/file-5.15.dif       2013-10-02 
08:48:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.file.new/file-5.16.dif  2013-12-05 
06:54:34.000000000 +0100
@@ -1,6 +1,6 @@
 --- magic/Magdir/elf
 +++ magic/Magdir/elf   2013-09-30 00:00:00.000000000 +0000
-@@ -129,7 +129,7 @@
+@@ -128,7 +128,7 @@
  >18   leshort         47              Renesas H8/300H,
  >18   leshort         48              Renesas H8S,
  >18   leshort         49              Renesas H8/500,
@@ -10,8 +10,8 @@
  >18   leshort         52              Motorola Coldfire,
  >18   leshort         53              Motorola M68HC12,
 --- magic/Magdir/linux
-+++ magic/Magdir/linux 2013-09-30 00:00:00.000000000 +0000
-@@ -97,22 +97,44 @@
++++ magic/Magdir/linux 2013-12-02 11:09:39.454735400 +0000
+@@ -97,23 +97,27 @@
  # and Nicolas Lichtmaier <[email protected]>
  # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
  # Linux kernel boot images (i386 arch) (Wolfram Kleff)
@@ -22,7 +22,8 @@
 ->>518 leshort         >0x1ff
 ->>>529        byte            0               zImage,
 ->>>529        byte            1               bzImage,
-->>>(526.s+0x200) string       >\0             version %s,
+->>>526        lelong          >0
+->>>>(526.s+0x200) string      >\0     version %s,
 ->>498 leshort         1               RO-rootFS,
 ->>498 leshort         0               RW-rootFS,
 ->>508 leshort         >0              root_dev 0x%X,
@@ -37,28 +38,11 @@
 +>510  leshort         >0xAA55         Kernel
 +>518  leshort         0x0105          \b, Setup Version 0x105, zImage
 +>518  leshort         >0x0105         \b, Setup Version %#hx
++>518  leshort         >0x1ff
 +>>529 byte            0               \b, zImage
 +>>529 byte            1               \b, bzImage
-+>>>(526.s+0x205)      byte    32
-+>>>>(526.s+0x200)     string  >\0     \b, Version %5.5s
-+>>>(526.s+0x206)      byte    32
-+>>>>(526.s+0x200)     string  >\0     \b, Version %6.6s
-+>>>(526.s+0x207)      byte    32
-+>>>>(526.s+0x200)     string  >\0     \b, Version %7.7s
-+>>>(526.s+0x205)      byte    45
-+>>>>(526.s+0x200)     string  >\0     \b, Version %5.5s
-+>>>(526.s+0x206)      byte    45
-+>>>>(526.s+0x200)     string  >\0     \b, Version %6.6s
-+>>>(526.s+0x207)      byte    45
-+>>>>(526.s+0x200)     string  >\0     \b, Version %7.7s
-+>>>(526.s+0x208)      byte    45
-+>>>>(526.s+0x200)     string  >\0     \b, Version %8.8s
-+>>>(526.s+0x209)      byte    45
-+>>>>(526.s+0x200)     string  >\0     \b, Version %9.9s
-+>>>(526.s+0x20a)      byte    45
-+>>>>(526.s+0x200)     string  >\0     \b, Version %10.10s
-+>>>(526.s+0x20b)      byte    45
-+>>>>(526.s+0x200)     string  >\0     \b, Version %11.11s
++>>526 lelong          >0
++>>>(526.s+0x200)      string  >\0     \b, Version %s
 +>>498 leshort         1               \b, RO-rootFS
 +>>498 leshort         0               \b, RW-rootFS
 +>>508 leshort         >0              \b, root_dev 0x%X
@@ -104,7 +88,7 @@
  
  EXTRA_DIST = \
  $(MAGIC_DIR)/Header \
-@@ -20,7 +20,6 @@ $(MAGIC_FRAGMENT_DIR)/amigaos \
+@@ -21,7 +21,6 @@ $(MAGIC_FRAGMENT_DIR)/android \
  $(MAGIC_FRAGMENT_DIR)/animation \
  $(MAGIC_FRAGMENT_DIR)/aout \
  $(MAGIC_FRAGMENT_DIR)/apl \
@@ -112,7 +96,7 @@
  $(MAGIC_FRAGMENT_DIR)/applix \
  $(MAGIC_FRAGMENT_DIR)/archive \
  $(MAGIC_FRAGMENT_DIR)/assembler \
-@@ -74,7 +73,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
+@@ -75,7 +74,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
  $(MAGIC_FRAGMENT_DIR)/erlang \
  $(MAGIC_FRAGMENT_DIR)/esri \
  $(MAGIC_FRAGMENT_DIR)/fcs \
@@ -120,7 +104,7 @@
  $(MAGIC_FRAGMENT_DIR)/flash \
  $(MAGIC_FRAGMENT_DIR)/fonts \
  $(MAGIC_FRAGMENT_DIR)/fortran \
-@@ -112,6 +110,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
+@@ -113,6 +111,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
  $(MAGIC_FRAGMENT_DIR)/java \
  $(MAGIC_FRAGMENT_DIR)/javascript \
  $(MAGIC_FRAGMENT_DIR)/jpeg \
@@ -129,7 +113,7 @@
  $(MAGIC_FRAGMENT_DIR)/karma \
  $(MAGIC_FRAGMENT_DIR)/kde \
  $(MAGIC_FRAGMENT_DIR)/keepass \
-@@ -119,7 +119,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
+@@ -120,7 +120,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
  $(MAGIC_FRAGMENT_DIR)/lecter \
  $(MAGIC_FRAGMENT_DIR)/lex \
  $(MAGIC_FRAGMENT_DIR)/lif \
@@ -137,7 +121,7 @@
  $(MAGIC_FRAGMENT_DIR)/lisp \
  $(MAGIC_FRAGMENT_DIR)/llvm \
  $(MAGIC_FRAGMENT_DIR)/lua \
-@@ -127,7 +126,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
+@@ -128,7 +127,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
  $(MAGIC_FRAGMENT_DIR)/m4 \
  $(MAGIC_FRAGMENT_DIR)/mach \
  $(MAGIC_FRAGMENT_DIR)/macos \
@@ -145,7 +129,7 @@
  $(MAGIC_FRAGMENT_DIR)/magic \
  $(MAGIC_FRAGMENT_DIR)/mail.news \
  $(MAGIC_FRAGMENT_DIR)/make \
-@@ -146,10 +144,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
+@@ -147,10 +145,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
  $(MAGIC_FRAGMENT_DIR)/mkid \
  $(MAGIC_FRAGMENT_DIR)/mlssa \
  $(MAGIC_FRAGMENT_DIR)/mmdf \
@@ -157,7 +141,7 @@
  $(MAGIC_FRAGMENT_DIR)/msooxml \
  $(MAGIC_FRAGMENT_DIR)/msx \
  $(MAGIC_FRAGMENT_DIR)/msvc \
-@@ -192,6 +190,8 @@ $(MAGIC_FRAGMENT_DIR)/pyramid \
+@@ -193,6 +191,8 @@ $(MAGIC_FRAGMENT_DIR)/pyramid \
  $(MAGIC_FRAGMENT_DIR)/python \
  $(MAGIC_FRAGMENT_DIR)/revision \
  $(MAGIC_FRAGMENT_DIR)/riff \
@@ -166,7 +150,7 @@
  $(MAGIC_FRAGMENT_DIR)/rinex \
  $(MAGIC_FRAGMENT_DIR)/rpm \
  $(MAGIC_FRAGMENT_DIR)/rtf \
-@@ -261,8 +261,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
+@@ -262,8 +262,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
  $(MAGIC_FRAGMENT_DIR)/zilog \
  $(MAGIC_FRAGMENT_DIR)/zyxel 
  
@@ -188,7 +172,7 @@
  
  # FIXME: Build file natively as well so that it can be used to compile
  # the target's magic file; for now we bail if the local version does not match
-@@ -274,19 +286,22 @@ FILE_COMPILE = $(top_builddir)/src/file$
+@@ -275,19 +287,22 @@ FILE_COMPILE = $(top_builddir)/src/file$
  FILE_COMPILE_DEP = $(FILE_COMPILE)
  endif
  
@@ -238,7 +222,7 @@
  EXTRA_DIST = \
  $(MAGIC_DIR)/Header \
  $(MAGIC_DIR)/Localstuff \
-@@ -217,7 +217,6 @@ $(MAGIC_FRAGMENT_DIR)/amigaos \
+@@ -218,7 +218,6 @@ $(MAGIC_FRAGMENT_DIR)/android \
  $(MAGIC_FRAGMENT_DIR)/animation \
  $(MAGIC_FRAGMENT_DIR)/aout \
  $(MAGIC_FRAGMENT_DIR)/apl \
@@ -246,7 +230,7 @@
  $(MAGIC_FRAGMENT_DIR)/applix \
  $(MAGIC_FRAGMENT_DIR)/archive \
  $(MAGIC_FRAGMENT_DIR)/assembler \
-@@ -271,7 +270,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
+@@ -272,7 +271,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
  $(MAGIC_FRAGMENT_DIR)/erlang \
  $(MAGIC_FRAGMENT_DIR)/esri \
  $(MAGIC_FRAGMENT_DIR)/fcs \
@@ -254,7 +238,7 @@
  $(MAGIC_FRAGMENT_DIR)/flash \
  $(MAGIC_FRAGMENT_DIR)/fonts \
  $(MAGIC_FRAGMENT_DIR)/fortran \
-@@ -309,6 +307,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
+@@ -310,6 +308,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
  $(MAGIC_FRAGMENT_DIR)/java \
  $(MAGIC_FRAGMENT_DIR)/javascript \
  $(MAGIC_FRAGMENT_DIR)/jpeg \
@@ -263,7 +247,7 @@
  $(MAGIC_FRAGMENT_DIR)/karma \
  $(MAGIC_FRAGMENT_DIR)/kde \
  $(MAGIC_FRAGMENT_DIR)/keepass \
-@@ -316,7 +316,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
+@@ -317,7 +317,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
  $(MAGIC_FRAGMENT_DIR)/lecter \
  $(MAGIC_FRAGMENT_DIR)/lex \
  $(MAGIC_FRAGMENT_DIR)/lif \
@@ -271,7 +255,7 @@
  $(MAGIC_FRAGMENT_DIR)/lisp \
  $(MAGIC_FRAGMENT_DIR)/llvm \
  $(MAGIC_FRAGMENT_DIR)/lua \
-@@ -324,7 +323,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
+@@ -325,7 +324,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
  $(MAGIC_FRAGMENT_DIR)/m4 \
  $(MAGIC_FRAGMENT_DIR)/mach \
  $(MAGIC_FRAGMENT_DIR)/macos \
@@ -279,7 +263,7 @@
  $(MAGIC_FRAGMENT_DIR)/magic \
  $(MAGIC_FRAGMENT_DIR)/mail.news \
  $(MAGIC_FRAGMENT_DIR)/make \
-@@ -343,10 +341,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
+@@ -344,10 +342,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
  $(MAGIC_FRAGMENT_DIR)/mkid \
  $(MAGIC_FRAGMENT_DIR)/mlssa \
  $(MAGIC_FRAGMENT_DIR)/mmdf \
@@ -291,7 +275,7 @@
  $(MAGIC_FRAGMENT_DIR)/msooxml \
  $(MAGIC_FRAGMENT_DIR)/msx \
  $(MAGIC_FRAGMENT_DIR)/msvc \
-@@ -389,6 +387,8 @@ $(MAGIC_FRAGMENT_DIR)/pyramid \
+@@ -390,6 +388,8 @@ $(MAGIC_FRAGMENT_DIR)/pyramid \
  $(MAGIC_FRAGMENT_DIR)/python \
  $(MAGIC_FRAGMENT_DIR)/revision \
  $(MAGIC_FRAGMENT_DIR)/riff \
@@ -300,7 +284,7 @@
  $(MAGIC_FRAGMENT_DIR)/rinex \
  $(MAGIC_FRAGMENT_DIR)/rpm \
  $(MAGIC_FRAGMENT_DIR)/rtf \
-@@ -458,10 +458,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
+@@ -459,10 +459,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
  $(MAGIC_FRAGMENT_DIR)/zilog \
  $(MAGIC_FRAGMENT_DIR)/zyxel 
  
@@ -324,7 +308,7 @@
  # FIXME: Build file natively as well so that it can be used to compile
  # the target's magic file; for now we bail if the local version does not match
  @IS_CROSS_COMPILE_TRUE@FILE_COMPILE = file${EXEEXT}
-@@ -676,23 +688,25 @@ uninstall-am: uninstall-pkgdataDATA
+@@ -677,23 +689,25 @@ uninstall-am: uninstall-pkgdataDATA
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        uninstall uninstall-am uninstall-pkgdataDATA
  

++++++ file-5.15.tar.gz -> file-5.16.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/ChangeLog new/file-5.16/ChangeLog
--- old/file-5.15/ChangeLog     2013-09-10 22:05:01.000000000 +0200
+++ new/file-5.16/ChangeLog     2013-11-20 00:52:21.000000000 +0100
@@ -1,3 +1,18 @@
+2013-11-19  20:10  Christos Zoulas <[email protected]>
+
+       * always leave magic file loaded, don't unload for magic_check, etc.
+       * fix default encoding to binary instead of unknown which broke recently
+       * handle empty and one byte files, less specially so that
+         --mime-encoding does not break completely.
+               `
+2013-11-06  14:40  Christos Zoulas <[email protected]>
+
+       * fix erroneous non-zero exit code from non-existant file and message
+
+2013-10-29  14:25  Christos Zoulas <[email protected]>
+
+       * add CDF MSI file detection (Guy Helmer)
+
 2013-09-03  11:56  Christos Zoulas <[email protected]>
 
        * Don't mix errors and regular output if there was an error
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/configure new/file-5.16/configure
--- old/file-5.15/configure     2013-09-24 17:22:10.000000000 +0200
+++ new/file-5.16/configure     2013-12-01 20:23:26.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for file 5.15.
+# Generated by GNU Autoconf 2.68 for file 5.16.
 #
 # Report bugs to <[email protected]>.
 #
@@ -709,8 +709,8 @@
 # Identity of this package.
 PACKAGE_NAME='file'
 PACKAGE_TARNAME='file'
-PACKAGE_VERSION='5.15'
-PACKAGE_STRING='file 5.15'
+PACKAGE_VERSION='5.16'
+PACKAGE_STRING='file 5.16'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL=''
 
@@ -1442,7 +1442,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures file 5.15 to adapt to many kinds of systems.
+\`configure' configures file 5.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1512,7 +1512,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of file 5.15:";;
+     short | recursive ) echo "Configuration of file 5.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1618,7 +1618,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-file configure 5.15
+file configure 5.16
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2271,7 +2271,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by file $as_me 5.15, which was
+It was created by file $as_me 5.16, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -3089,7 +3089,7 @@
 
 # Define the identity of the package.
  PACKAGE='file'
- VERSION='5.15'
+ VERSION='5.16'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13974,7 +13974,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by file $as_me 5.15, which was
+This file was extended by file $as_me 5.16, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -14040,7 +14040,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-file config.status 5.15
+file config.status 5.16
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/configure.ac new/file-5.16/configure.ac
--- old/file-5.15/configure.ac  2013-09-24 17:21:34.000000000 +0200
+++ new/file-5.16/configure.ac  2013-12-01 20:22:13.000000000 +0100
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([file],[5.15],[[email protected]])
+AC_INIT([file],[5.16],[[email protected]])
 AM_INIT_AUTOMAKE([subdir-objects foreign])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/android 
new/file-5.16/magic/Magdir/android
--- old/file-5.15/magic/Magdir/android  1970-01-01 01:00:00.000000000 +0100
+++ new/file-5.16/magic/Magdir/android  2013-11-08 02:24:22.000000000 +0100
@@ -0,0 +1,100 @@
+
+#------------------------------------------------------------
+# $File: android,v 1.3 2013/11/08 01:24:22 christos Exp $
+# Various android related magic entries
+#------------------------------------------------------------
+
+# Dalvik .dex format. http://retrodev.com/android/dexformat.html
+# From <[email protected]> "Mike Fleming"
+# Fixed to avoid regexec 17 errors on some dex files
+# From <[email protected]> "Tim Strazzere"
+0      string  dex\n
+>0     regex   dex\n[0-9]{2}\0 Dalvik dex file
+>4     string  >000                    version %s
+0      string  dey\n
+>0     regex   dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
+>4     string  >000                    version %s
+
+# http://android.stackexchange.com/questions/23357/\
+# is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\
+# 23608#23608
+0      string  ANDROID\040BACKUP\n     Android Backup
+>15    string  1\n                     \b, version 1
+>17    string  0\n                     \b, uncompressed
+>17    string  1\n                     \b, compressed
+>19    string  none\n                  \b, unencrypted
+>19    string  AES-256\n               \b, encrypted AES-256
+
+# Android bootimg format
+# From https://android.googlesource.com/\
+# platform/system/core/+/master/mkbootimg/bootimg.h
+0              string  ANDROID!        Android bootimg
+>8             lelong  >0                      \b, kernel
+>>12   lelong  >0                      \b (0x%x)
+>16            lelong  >0                      \b, ramdisk
+>>20   lelong  >0                      \b (0x%x)
+>24            lelong  >0                      \b, second stage
+>>28   lelong  >0                      \b (0x%x)
+>36            lelong  >0                      \b, page size: %d
+>38            string  >0                      \b, name: %s
+>64            string  >0                      \b, cmdline (%s)
+# Dalvik .dex format. http://retrodev.com/android/dexformat.html
+# From <[email protected]> "Mike Fleming"
+# Fixed to avoid regexec 17 errors on some dex files
+# From <[email protected]> "Tim Strazzere"
+0      string  dex\n
+>0     regex   dex\n[0-9]{2}\0 Dalvik dex file
+>4     string  >000                    version %s
+0      string  dey\n
+>0     regex   dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
+>4     string  >000                    version %s
+
+# http://android.stackexchange.com/questions/23357/\
+# is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\
+# 23608#23608
+0      string  ANDROID\040BACKUP\n     Android Backup
+>15    string  1\n                     \b, version 1
+>17    string  0\n                     \b, uncompressed
+>17    string  1\n                     \b, compressed
+>19    string  none\n                  \b, unencrypted
+>19    string  AES-256\n               \b, encrypted AES-256
+
+# Android bootimg format
+# From https://android.googlesource.com/\
+# platform/system/core/+/master/mkbootimg/bootimg.h
+0              string  ANDROID!        Android bootimg
+>8             lelong  >0                      \b, kernel
+>>12   lelong  >0                      \b (0x%x)
+>16            lelong  >0                      \b, ramdisk
+>>20   lelong  >0                      \b (0x%x)
+>24            lelong  >0                      \b, second stage
+>>28   lelong  >0                      \b (0x%x)
+>36            lelong  >0                      \b, page size: %d
+>38            string  >0                      \b, name: %s
+>64            string  >0                      \b, cmdline (%s)
+
+# Android Backup archive
+# From: Ariel Shkedi
+# File extension: .ab
+# No mime-type defined
+# URL: https://github.com/android/platform_frameworks_base/blob/\
+# 0bacfd2ba68d21a68a3df345b830bc2a1e515b5a/services/java/com/\
+# android/server/BackupManagerService.java#L2367
+# After the header comes a tar file
+# If compressed, the entire tar file is compressed with JAVA deflate
+#
+# Include the version number hardcoded with the magic string to avoid
+# false positives
+0      string/b        ANDROID\ BACKUP\n1\n    Android Backup
+>17    string          0\n                     \b, Not-Compressed
+>17    string          1\n                     \b, Compressed
+# any string as long as it's not the word none (which is matched below)
+>>19    regex/1                \^([^n\n]|n[^o]|no[^n]|non[^e]|none.+).*        
\b, Encrypted (%s)
+>>19   string          none\n                  \b, Not-Encrypted
+# Commented out because they don't seem useful to print
+# (but they are part of the header - the tar file comes after them):
+#>>>&1         regex/1 .*      \b, Password salt: %s
+#>>>>&1                regex/1 .*      \b, Master salt: %s
+#>>>>>&1       regex/1 .*      \b, PBKDF2 rounds: %s
+#>>>>>>&1      regex/1 .*      \b, IV: %s
+#>>>>>>>&1     regex/1 .*      \b, Key: %s
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/compress 
new/file-5.16/magic/Magdir/compress
--- old/file-5.15/magic/Magdir/compress 2013-08-15 14:53:10.000000000 +0200
+++ new/file-5.16/magic/Magdir/compress 2013-11-19 21:38:57.000000000 +0100
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: compress,v 1.50 2013/08/15 12:53:10 christos Exp $
+# $File: compress,v 1.51 2013/11/19 20:38:57 christos Exp $
 # compress:  file(1) magic for pure-compression formats (no archives)
 #
 # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@@ -191,10 +191,13 @@
 
 # Type: LZMA
 0      lelong&0xffffff =0x5d
->12    leshort         =0xff                   LZMA compressed data,
+!:mime application/x-lzma
+>12    leshort         0xff                    LZMA compressed data,
+>>5    lequad          =0xffffffffffffffff     streamed
+>>5    lequad          !0xffffffffffffffff     non-streamed, size %lld
+>12    leshort         0                       LZMA compressed data,
 >>5    lequad          =0xffffffffffffffff     streamed
 >>5    lequad          !0xffffffffffffffff     non-streamed, size %lld
-!:mime application/x-lzma
 
 # http://tukaani.org/xz/xz-file-format.txt
 0      ustring         \xFD7zXZ\x00            XZ compressed data
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/database 
new/file-5.16/magic/Magdir/database
--- old/file-5.15/magic/Magdir/database 2013-06-17 21:22:47.000000000 +0200
+++ new/file-5.16/magic/Magdir/database 2013-11-20 01:00:14.000000000 +0100
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: database,v 1.34 2013/06/17 19:22:47 christos Exp $
+# $File: database,v 1.35 2013/11/20 00:00:14 christos Exp $
 # database:  file(1) magic for various databases
 #
 # extracted from header/code files by Graeme Wilford ([email protected])
@@ -84,8 +84,8 @@
 #
 #
 # Round Robin Database Tool by Tobias Oetiker <[email protected]>
-0      string  RRD             RRDTool DB
->4     string  x               version %s
+0      string/b        RRD\0           RRDTool DB
+>4     string/b        x               version %s
 #----------------------------------------------------------------------
 # ROOT: file(1) magic for ROOT databases
 #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/filesystems 
new/file-5.16/magic/Magdir/filesystems
--- old/file-5.15/magic/Magdir/filesystems      2013-09-24 16:52:26.000000000 
+0200
+++ new/file-5.16/magic/Magdir/filesystems      2013-11-20 00:54:05.000000000 
+0100
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: filesystems,v 1.83 2013/09/24 14:52:26 christos Exp $
+# $File: filesystems,v 1.85 2013/11/19 23:54:05 christos Exp $
 # filesystems:  file(1) magic for different filesystems
 #
 0      name    partid  
@@ -1957,7 +1957,7 @@
 >34816 string    \000CD001\001EL\ TORITO\ SPECIFICATION    (bootable)
 37633  string    CD001     ISO 9660 CD-ROM filesystem data (raw 2352 byte 
sectors)
 !:mime application/x-iso9660-image
-32776  string    CDROM     High Sierra CD-ROM filesystem data
+32777  string    CDROM     High Sierra CD-ROM filesystem data
 
 # .cso files
 0    string    CISO    Compressed ISO CD image
@@ -2319,3 +2319,8 @@
 # ReFS
 # Richard W.M. Jones <[email protected]>
 0      string  \0\0\0ReFS\0    ReFS filesystem image
+
+# EFW encase image file format:
+# Gregoire Passault
+# http://www.forensicswiki.org/wiki/Encase_image_file_format
+0      string  EVF\x09\x0d\x0a\xff\x00 EWF/Expert Witness/EnCase image file 
format
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/images 
new/file-5.16/magic/Magdir/images
--- old/file-5.15/magic/Magdir/images   2013-09-23 16:33:58.000000000 +0200
+++ new/file-5.16/magic/Magdir/images   2013-11-20 00:56:04.000000000 +0100
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: images,v 1.84 2013/09/23 14:33:58 christos Exp $
+# $File: images,v 1.86 2013/11/19 23:56:04 christos Exp $
 # images:  file(1) magic for image formats (see also "iff", and "c-lang" for
 # XPM bitmaps)
 #
@@ -45,7 +45,7 @@
 >>3    regex           =\ [0-9]+       \b%s
 !:strength + 45
 !:mime image/x-portable-greymap
-0      search/1        P3              Netpbm PPM image text
+0      search/1        P3
 >3     regex           =[0-9]*\ [0-9]*         Netpbm PPM image text
 >3     regex           =[0-9]+\                \b, size = %sx
 >>3    regex           =\ [0-9]+       \b%s
@@ -256,6 +256,8 @@
 # at offset 8 starts imagedata followed by "RGB " marker
 
 # PC bitmaps (OS/2, Windows BMP files)  (Greg Roelofs, [email protected])
+# http://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
+# 28bitmap_information_header.29
 0      string          BM
 >14    leshort         12              PC bitmap, OS/2 1.x format
 !:mime image/x-ms-bmp
@@ -269,6 +271,16 @@
 !:mime image/x-ms-bmp
 >>18   lelong          x               \b, %d x
 >>22   lelong          x               %d x
+>>28   leshort         x               %d
+>14    leshort         124             PC bitmap, Windows 98/2000 and newer 
format
+!:mime image/x-ms-bmp
+>>18   lelong          x               \b, %d x
+>>22   lelong          x               %d x
+>>28   leshort         x               %d
+>14    leshort         108             PC bitmap, Windows 95/NT4 and newer 
format
+!:mime image/x-ms-bmp
+>>18   lelong          x               \b, %d x
+>>22   lelong          x               %d x
 >>28   leshort         x               %d
 >14    leshort         128             PC bitmap, Windows NT/2000 format
 !:mime image/x-ms-bmp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/java 
new/file-5.16/magic/Magdir/java
--- old/file-5.15/magic/Magdir/java     2013-08-14 11:10:36.000000000 +0200
+++ new/file-5.16/magic/Magdir/java     2013-09-26 16:07:03.000000000 +0200
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------
-# $File: java,v 1.15 2013/08/14 09:10:36 christos Exp $
+# $File: java,v 1.16 2013/09/24 20:22:03 christos Exp $
 # Java ByteCode and Mach-O binaries (e.g., Mac OS X) use the
 # same magic number, 0xcafebabe, so they are both handled
 # in the entry called "cafebabe".
@@ -15,27 +15,6 @@
 0      belong          0xcececece      Java JCE KeyStore
 !:mime application/x-java-jce-keystore
 
-# Dalvik .dex format. http://retrodev.com/android/dexformat.html
-# From <[email protected]> "Mike Fleming"
-# Fixed to avoid regexec 17 errors on some dex files
-# From <[email protected]> "Tim Strazzere"
-0      string  dex\n
->0     regex   dex\n[0-9]{2}\0 Dalvik dex file
->4     string  >000                    version %s
-0      string  dey\n
->0     regex   dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
->4     string  >000                    version %s
-
 # Java source
 0      regex   ^import.*;$     Java source
 !:mime text/x-java
-
-# http://android.stackexchange.com/questions/23357/\
-# is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\
-# 23608#23608
-0      string  ANDROID\040BACKUP\n     Android Backup
->15    string  1\n                     \b, version 1
->17    string  0\n                     \b, uncompressed
->17    string  1\n                     \b, compressed
->19    string  none\n                  \b, unencrypted
->19    string  AES-256\n               \b, encrypted AES-256
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/linux 
new/file-5.16/magic/Magdir/linux
--- old/file-5.15/magic/Magdir/linux    2013-09-12 18:18:34.000000000 +0200
+++ new/file-5.16/magic/Magdir/linux    2013-11-20 00:18:15.000000000 +0100
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: linux,v 1.50 2013/06/26 14:48:31 christos Exp $
+# $File: linux,v 1.52 2013/11/19 23:18:15 christos Exp $
 # linux:  file(1) magic for Linux files
 #
 # Values for Linux/i386 binaries, from Daniel Quinlan <[email protected]>
@@ -103,7 +103,8 @@
 >>518  leshort         >0x1ff
 >>>529 byte            0               zImage,
 >>>529 byte            1               bzImage,
->>>(526.s+0x200) string        >\0             version %s,
+>>>526 lelong          >0
+>>>>(526.s+0x200) string       >\0     version %s,
 >>498  leshort         1               RO-rootFS,
 >>498  leshort         0               RW-rootFS,
 >>508  leshort         >0              root_dev 0x%X,
@@ -368,3 +369,26 @@
 >>>>>>>>16     ubyte           2       \b, archived
 >>>>>>>>8      ulelong&1       1       \b, sealed
 >>>>>>>>12     ulelong&1       1       \b, compressed
+
+# BCache backing and cache devices
+# From: Gabriel de Perthuis <[email protected]>
+0x1008         lequad          8
+>0x1018                string          
\xc6\x85\x73\xf6\x4e\x1a\x45\xca\x82\x65\xf5\x7f\x48\xba\x6d\x81        BCache
+>>0x1010       ulequad         0       cache device
+>>0x1010       ulequad         1       backing device
+>>0x1010       ulequad         3       cache device
+>>0x1010       ulequad         4       backing device
+>>0x1048       string          >0      \b, label "%.32s"
+>>0x1028       ubelong         x       \b, uuid %08x
+>>0x102c       ubeshort        x       \b-%04x
+>>0x102e       ubeshort        x       \b-%04x
+>>0x1030       ubeshort        x       \b-%04x
+>>0x1032       ubelong         x       \b-%08x
+>>0x1036       ubeshort        x       \b%04x
+>>0x1038       ubelong         x       \b, set uuid %08x
+>>0x103c       ubeshort        x       \b-%04x
+>>0x103e       ubeshort        x       \b-%04x
+>>0x1040       ubeshort        x       \b-%04x
+>>0x1042       ubelong         x       \b-%08x
+>>0x1046       ubeshort        x       \b%04x
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/macintosh 
new/file-5.16/magic/Magdir/macintosh
--- old/file-5.15/magic/Magdir/macintosh        2011-05-17 19:40:31.000000000 
+0200
+++ new/file-5.16/magic/Magdir/macintosh        2013-11-19 19:47:58.000000000 
+0100
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: macintosh,v 1.22 2011/05/17 17:40:31 rrt Exp $
+# $File: macintosh,v 1.23 2013/11/19 18:47:58 christos Exp $
 # macintosh description
 #
 # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
@@ -263,6 +263,9 @@
 0      string          $FL2            SPSS System File
 >24    string          x               %s
 
+0      string          $FL3            SPSS System File
+>24    string          x               %s
+
 # Macintosh filesystem data
 # From "Tom N Harris" <[email protected]>
 # Fixed HFS+ and Partition map magic: Ethan Benson <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/riff 
new/file-5.16/magic/Magdir/riff
--- old/file-5.15/magic/Magdir/riff     2013-02-06 15:18:52.000000000 +0100
+++ new/file-5.16/magic/Magdir/riff     2013-11-20 00:58:17.000000000 +0100
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: riff,v 1.23 2013/02/06 14:18:52 christos Exp $
+# $File: riff,v 1.24 2013/11/19 23:58:17 christos Exp $
 # riff:  file(1) magic for RIFF format
 # See
 #
@@ -55,6 +55,8 @@
 # Corel Draw Picture
 >8     string          CDRA            \b, Corel Draw Picture
 !:mime image/x-coreldraw
+>8     string          CDR6            \b, Corel Draw Picture, version 6
+!:mime image/x-coreldraw
 # AVI == Audio Video Interleave
 >8     string          AVI\040         \b, AVI
 !:mime video/x-msvideo
@@ -220,6 +222,7 @@
 >>24   belong          >0              %d Hz
 # Corel Draw Picture
 >8     string          CDRA            \b, Corel Draw Picture
+>8     string          CDR6            \b, Corel Draw Picture, version 6
 # AVI == Audio Video Interleave
 >8     string          AVI\040         \b, AVI
 # Animated Cursor format
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Magdir/xilinx 
new/file-5.16/magic/Magdir/xilinx
--- old/file-5.15/magic/Magdir/xilinx   2013-01-08 04:06:50.000000000 +0100
+++ new/file-5.16/magic/Magdir/xilinx   2013-11-20 00:15:13.000000000 +0100
@@ -1,38 +1,40 @@
 
 #------------------------------------------------------------------------------
-# $File: xilinx,v 1.5 2013/01/08 03:06:50 christos Exp $
+# $File: xilinx,v 1.6 2013/11/19 23:15:13 christos Exp $
 # This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
 # [email protected]
 # Got the info from FPGA-FAQ 0026
 #
+# Rewritten to use pstring/H instead of hardcoded lengths by O. Freyermuth, 
+# fixes at least reading of bitfiles from Spartan 2, 3, 6. 
+# http://www.fpga-faq.com/FAQ_Pages/0026_Tell_me_about_bit_files.htm
+#
 # First there is the sync header and its length
 0      beshort 0x0009
 >2     belong  =0x0ff00ff0
 >>&0   belong  =0x0ff00ff0
->>>&0  beshort =0x0000 
->>>>&0 pstring a       Xilinx BIT data
+>>>&0  byte    =0x00
+>>>&1   beshort =0x0001
+>>>&3  string  a       Xilinx BIT data
 # Next is a Pascal-style string with the NCD name. We want to capture that.
->>>>0x0F       pstring x       - from %s
-# It is followed by a NUL
->>>>>&1        byte    0x00
+>>>>&0    pstring/H    x       - from %s
 # And then 'b'
->>>>>&2        string b
-# With the part number:
-#>>>>>&5 string        4v      (Virtex4)
-#>>>>>&5 string  2v    (Virtex II
-#>>>>>>&0      string  !p      \b)
-#>>>>>>&0      string  p       Pro)
->>>>>&4        pstring x       - for %s
-# And then NUL / 'c' / Build Data / NUL / 'd' / Date / NUL / 'e' / Data Length
->>>>>>&1       byte    0x00
->>>>>>&2       string  c
->>>>>>&4       pstring x       - built %s
->>>>>>>&1      byte    0x00
->>>>>>>&2      string  d
->>>>>>>&4      pstring x       \b(%s)
->>>>>>>>&1     byte    0x00
->>>>>>>>&2     string  e
->>>>>>>>&4     belong  x       - data length 0x%lx
+>>>>>&1    string b
+# Then the model / part number: 
+>>>>>>&0   pstring/H    x       - for %s
+# Then 'c'
+>>>>>>>&1 string c
+# Then the build-date
+>>>>>>>>&0 pstring/H    x       - built %s
+# Then 'd'
+>>>>>>>>>&1   string d
+# Then the build-time
+>>>>>>>>>>&0  pstring/H x        \b(%s)
+# Then 'e'
+>>>>>>>>>>>&1  string e
+# And length of data
+>>>>>>>>>>>>&0 belong x          - data length 0x%lx
+
 # Raw bitstream files
-0      long    0xffffffff      
->&0    belong  0xaa995566      Xilinx RAW bitstream (.BIN)
+0      long    0xffffffff      
+>&0    belong  0xaa995566      Xilinx RAW bitstream (.BIN)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Makefile.am 
new/file-5.16/magic/Makefile.am
--- old/file-5.15/magic/Makefile.am     2013-08-26 17:54:22.000000000 +0200
+++ new/file-5.16/magic/Makefile.am     2013-10-29 18:50:01.000000000 +0100
@@ -1,5 +1,5 @@
 #
-# $File: Makefile.am,v 1.92 2013/08/26 15:54:22 christos Exp $
+# $File: Makefile.am,v 1.93 2013/09/24 20:22:03 christos Exp $
 #
 MAGIC_FRAGMENT_BASE = Magdir
 MAGIC_DIR = $(top_srcdir)/magic
@@ -17,6 +17,7 @@
 $(MAGIC_FRAGMENT_DIR)/alliant \
 $(MAGIC_FRAGMENT_DIR)/amanda \
 $(MAGIC_FRAGMENT_DIR)/amigaos \
+$(MAGIC_FRAGMENT_DIR)/android \
 $(MAGIC_FRAGMENT_DIR)/animation \
 $(MAGIC_FRAGMENT_DIR)/aout \
 $(MAGIC_FRAGMENT_DIR)/apl \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/magic/Makefile.in 
new/file-5.16/magic/Makefile.in
--- old/file-5.15/magic/Makefile.in     2013-09-24 17:22:11.000000000 +0200
+++ new/file-5.16/magic/Makefile.in     2013-12-01 20:23:28.000000000 +0100
@@ -198,7 +198,7 @@
 top_srcdir = @top_srcdir@
 
 #
-# $File: Makefile.am,v 1.92 2013/08/26 15:54:22 christos Exp $
+# $File: Makefile.am,v 1.93 2013/09/24 20:22:03 christos Exp $
 #
 MAGIC_FRAGMENT_BASE = Magdir
 MAGIC_DIR = $(top_srcdir)/magic
@@ -214,6 +214,7 @@
 $(MAGIC_FRAGMENT_DIR)/alliant \
 $(MAGIC_FRAGMENT_DIR)/amanda \
 $(MAGIC_FRAGMENT_DIR)/amigaos \
+$(MAGIC_FRAGMENT_DIR)/android \
 $(MAGIC_FRAGMENT_DIR)/animation \
 $(MAGIC_FRAGMENT_DIR)/aout \
 $(MAGIC_FRAGMENT_DIR)/apl \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/apprentice.c 
new/file-5.16/src/apprentice.c
--- old/file-5.15/src/apprentice.c      2013-09-12 17:57:32.000000000 +0200
+++ new/file-5.16/src/apprentice.c      2013-11-19 22:01:12.000000000 +0100
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.195 2013/09/12 15:57:32 christos Exp 
$")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.196 2013/11/19 21:01:12 christos Exp 
$")
 #endif /* lint */
 
 #include "magic.h"
@@ -603,6 +603,10 @@
                return -1;
        }
 
+#if 0
+       /*
+        * Always leave the database loaded
+        */
        if (action == FILE_LOAD)
                return 0;
 
@@ -610,8 +614,10 @@
                mlist_free(ms->mlist[i]);
                ms->mlist[i] = NULL;
        }
+#endif
 
        switch (action) {
+       case FILE_LOAD:
        case FILE_COMPILE:
        case FILE_CHECK:
        case FILE_LIST:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/compress.c new/file-5.16/src/compress.c
--- old/file-5.15/src/compress.c        2013-08-04 11:49:25.000000000 +0200
+++ new/file-5.16/src/compress.c        2013-11-18 18:54:58.000000000 +0100
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.71 2013/07/21 21:06:41 rrt Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.72 2013/11/18 17:54:58 christos Exp $")
 #endif
 
 #include "magic.h"
@@ -479,7 +479,7 @@
 #endif
                        free(*newch);
                        n = 0;
-                       newch[0] = '\0';
+                       *newch = NULL;
                        goto err;
                } else {
                        n = r;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/encoding.c new/file-5.16/src/encoding.c
--- old/file-5.15/src/encoding.c        2013-09-17 17:51:22.000000000 +0200
+++ new/file-5.16/src/encoding.c        2013-11-19 21:45:50.000000000 +0100
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: encoding.c,v 1.8 2013/09/17 15:51:22 christos Exp $")
+FILE_RCSID("@(#)$File: encoding.c,v 1.9 2013/11/19 20:45:50 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -73,7 +73,8 @@
 
        *type = "text";
        *ulen = 0;
-       *code = *code_mime = "unknown";
+       *code = "unknown";
+       *code_mime = "binary";
 
        mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
        if ((*ubuf = CAST(unichar *, calloc((size_t)1, mlen))) == NULL) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/fsmagic.c new/file-5.16/src/fsmagic.c
--- old/file-5.15/src/fsmagic.c 2013-09-10 21:57:14.000000000 +0200
+++ new/file-5.16/src/fsmagic.c 2013-12-01 20:22:13.000000000 +0100
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.68 2013/05/28 21:24:31 christos Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.71 2013/12/01 18:01:07 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -131,8 +131,7 @@
                if (file_printf(ms, "cannot open `%s' (%s)",
                    fn, strerror(errno)) == -1)
                        return -1;
-               ms->event_flags |= EVENT_HAD_ERR;
-               return -1;
+               return 0;
        }
 
        ret = 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/funcs.c new/file-5.16/src/funcs.c
--- old/file-5.15/src/funcs.c   2013-09-17 19:26:30.000000000 +0200
+++ new/file-5.16/src/funcs.c   2013-11-20 00:49:44.000000000 +0100
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.63 2013/09/03 08:31:48 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.64 2013/11/19 23:49:44 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -168,22 +168,18 @@
        size_t ulen;
        const char *code = NULL;
        const char *code_mime = "binary";
-       const char *type = NULL;
+       const char *type = "application/octet-stream";
+       const char *def = "data";
 
 
 
        if (nb == 0) {
-               if ((!mime || (mime & MAGIC_MIME_TYPE)) &&
-                   file_printf(ms, mime ? "application/x-empty" :
-                   "empty") == -1)
-                       return -1;
-               return 1;
+               def = "empty";
+               type = "application/x-empty";
+               goto simple;
        } else if (nb == 1) {
-               if ((!mime || (mime & MAGIC_MIME_TYPE)) &&
-                   file_printf(ms, mime ? "application/octet-stream" :
-                   "very short file (no magic)") == -1)
-                       return -1;
-               return 1;
+               def = "very short file (no magic)";
+               goto simple;
        }
 
        if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
@@ -278,10 +274,11 @@
                }
        }
 
+simple:
        /* give up */
        m = 1;
        if ((!mime || (mime & MAGIC_MIME_TYPE)) &&
-           file_printf(ms, mime ? "application/octet-stream" : "data") == -1) {
+           file_printf(ms, "%s", mime ? type : def) == -1) {
            rv = -1;
        }
  done:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/magic.c new/file-5.16/src/magic.c
--- old/file-5.15/src/magic.c   2013-09-10 21:57:14.000000000 +0200
+++ new/file-5.16/src/magic.c   2013-12-01 20:22:13.000000000 +0100
@@ -33,7 +33,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: magic.c,v 1.79 2013/09/03 08:54:47 christos Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.81 2013/11/29 15:42:51 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -373,8 +373,9 @@
                        pos = lseek(fd, (off_t)0, SEEK_CUR);
        } else {
                int flags = O_RDONLY|O_BINARY;
+               int okstat = stat(inname, &sb) == 0;
 
-               if (stat(inname, &sb) == 0 && S_ISFIFO(sb.st_mode)) {
+               if (okstat && S_ISFIFO(sb.st_mode)) {
 #ifdef O_NONBLOCK
                        flags |= O_NONBLOCK;
 #endif
@@ -383,7 +384,8 @@
 
                errno = 0;
                if ((fd = open(inname, flags)) < 0) {
-                       if (unreadable_info(ms, sb.st_mode, inname) == -1)
+                       if (okstat &&
+                           unreadable_info(ms, sb.st_mode, inname) == -1)
                                goto done;
                        rv = 0;
                        goto done;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/magic.h new/file-5.16/src/magic.h
--- old/file-5.15/src/magic.h   2013-09-24 17:19:10.000000000 +0200
+++ new/file-5.16/src/magic.h   2013-12-01 20:23:40.000000000 +0100
@@ -75,7 +75,7 @@
 #define        MAGIC_NO_CHECK_FORTRAN  0x000000 /* Don't check ascii/fortran */
 #define        MAGIC_NO_CHECK_TROFF    0x000000 /* Don't check ascii/troff */
 
-#define MAGIC_VERSION          514     /* This implementation */
+#define MAGIC_VERSION          516     /* This implementation */
 
 
 #ifdef __cplusplus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/readcdf.c new/file-5.16/src/readcdf.c
--- old/file-5.15/src/readcdf.c 2012-06-21 00:18:33.000000000 +0200
+++ new/file-5.16/src/readcdf.c 2013-10-29 19:30:45.000000000 +0100
@@ -26,7 +26,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.33 2012/06/20 21:52:36 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.35 2013/10/29 18:30:45 christos Exp $")
 #endif
 
 #include <stdlib.h>
@@ -40,6 +40,43 @@
 
 #define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
 
+static const struct nv {
+       const char *pattern;
+       const char *mime;
+} app2mime[] =  {
+       { "Word",                       "msword",               },
+       { "Excel",                      "vnd.ms-excel",         },
+       { "Powerpoint",                 "vnd.ms-powerpoint",    },
+       { "Crystal Reports",            "x-rpt",                },
+       { "Advanced Installer",         "vnd.ms-msi",           },
+       { "InstallShield",              "vnd.ms-msi",           },
+       { "Microsoft Patch Compiler",   "vnd.ms-msi",           },
+       { "NAnt",                       "vnd.ms-msi",           },
+       { "Windows Installer",          "vnd.ms-msi",           },
+       { NULL,                         NULL,                   },
+}, name2mime[] = {
+       { "WordDocument",               "msword",               },
+       { "PowerPoint",                 "vnd.ms-powerpoint",    },
+       { "DigitalSignature",           "vnd.ms-msi",           },
+       { NULL,                         NULL,                   },
+}, name2desc[] = {
+       { "WordDocument",               "Microsoft Office Word",},
+       { "PowerPoint",                 "Microsoft PowerPoint", },
+       { "DigitalSignature",           "Microsoft Installer",  },
+       { NULL,                         NULL,                   },
+};
+
+private const char *
+cdf_app_to_mime(const char *vbuf, const struct nv *nv)
+{
+       size_t i;
+
+       for (i = 0; nv[i].pattern != NULL; i++)
+               if (strstr(vbuf, nv[i].pattern) != NULL)
+                       return nv[i].mime;
+       return NULL;
+}
+
 private int
 cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
     size_t count)
@@ -109,18 +146,10 @@
                                                         return -1;
                                         }
                                 } else if (info[i].pi_id ==
-                                        CDF_PROPERTY_NAME_OF_APPLICATION) {
-                                        if (strstr(vbuf, "Word"))
-                                                str = "msword";
-                                        else if (strstr(vbuf, "Excel"))
-                                                str = "vnd.ms-excel";
-                                        else if (strstr(vbuf, "Powerpoint"))
-                                                str = "vnd.ms-powerpoint";
-                                        else if (strstr(vbuf,
-                                            "Crystal Reports"))
-                                                str = "x-rpt";
-                                }
-                        }
+                                   CDF_PROPERTY_NAME_OF_APPLICATION) {
+                                       str = cdf_app_to_mime(vbuf, app2mime);
+                               }
+                       }
                         break;
                 case CDF_FILETIME:
                         tp = info[i].pi_tp;
@@ -136,8 +165,9 @@
                                         char *c, *ec;
                                         cdf_timestamp_to_timespec(&ts, tp);
                                         c = cdf_ctime(&ts.tv_sec, tbuf);
-                                        if ((ec = strchr(c, '\n')) != NULL)
-                                                *ec = '\0';
+                                        if (c != NULL &&
+                                           (ec = strchr(c, '\n')) != NULL)
+                                               *ec = '\0';
 
                                         if (NOTMIME(ms) && file_printf(ms,
                                             ", %s: %s", buf, c) == -1)
@@ -277,26 +307,34 @@
         if ((i = cdf_file_summary_info(ms, &h, &scn)) < 0)
                 expn = "Can't expand summary_info";
        if (i == 0) {
-               const char *str = "vnd.ms-office";
+               const char *str = NULL;
                cdf_directory_t *d;
                char name[__arraycount(d->d_name)];
                size_t j, k;
                for (j = 0; j < dir.dir_len; j++) {
-                   d = &dir.dir_tab[j];
-                   for (k = 0; k < sizeof(name); k++)
-                       name[k] = (char)cdf_tole2(d->d_name[k]);
-                   if (strstr(name, "WordDocument") != 0) {
-                       str = "msword";
-                       break;
-                   }
-                   if (strstr(name, "PowerPoint") != 0) {
-                       str = "vnd.ms-powerpoint";
-                       break;
-                   }
+                       d = &dir.dir_tab[j];
+                       for (k = 0; k < sizeof(name); k++)
+                               name[k] = (char)cdf_tole2(d->d_name[k]);
+                       if (NOTMIME(ms))
+                               str = cdf_app_to_mime(name, name2desc);
+                       else
+                               str = cdf_app_to_mime(name, name2mime);
+                       if (str != NULL)
+                               break;
+               }
+               if (NOTMIME(ms)) {
+                       if (str != NULL) {
+                               if (file_printf(ms, "%s", str) == -1)
+                                       return -1;
+                               i = 1;
+                       }
+               } else {
+                       if (str == NULL)
+                               str = "vnd.ms-office";
+                       if (file_printf(ms, "application/%s", str) == -1)
+                               return -1;
+                       i = 1;
                }
-                if (file_printf(ms, "application/%s", str) == -1)
-                        return -1;
-               i = 1;
        }
         free(scn.sst_tab);
 out4:
@@ -308,21 +346,19 @@
 out1:
         free(sat.sat_tab);
 out0:
-        if (i != 1) {
-               if (i == -1) {
-                   if (NOTMIME(ms)) {
-                       if (file_printf(ms,
-                           "Composite Document File V2 Document") == -1)
-                           return -1;
-                       if (*expn)
-                           if (file_printf(ms, ", %s%s", corrupt, expn) == -1)
-                               return -1;
-                   } else {
-                       if (file_printf(ms, "application/CDFV2-corrupt") == -1)
-                           return -1;
-                   }
-               }
-                i = 1;
-        }
+       if (i == -1) {
+           if (NOTMIME(ms)) {
+               if (file_printf(ms,
+                   "Composite Document File V2 Document") == -1)
+                   return -1;
+               if (*expn)
+                   if (file_printf(ms, ", %s%s", corrupt, expn) == -1)
+                       return -1;
+           } else {
+               if (file_printf(ms, "application/CDFV2-corrupt") == -1)
+                   return -1;
+           }
+           i = 1;
+       }
         return i;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/readelf.c new/file-5.16/src/readelf.c
--- old/file-5.15/src/readelf.c 2013-09-20 02:39:43.000000000 +0200
+++ new/file-5.16/src/readelf.c 2013-11-05 16:44:01.000000000 +0100
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.98 2013/09/20 00:39:43 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.99 2013/11/05 15:44:01 christos Exp $")
 #endif
 
 #ifdef BUILTIN_ELF
@@ -344,6 +344,126 @@
 }
 #endif
 
+static void
+do_note_netbsd_version(struct magic_set *ms, int swap, void *v)
+{
+       uint32_t desc;
+       (void)memcpy(&desc, v, sizeof(desc));
+       desc = elf_getu32(swap, desc);
+
+       if (file_printf(ms, ", for NetBSD") == -1)
+               return;
+       /*
+        * The version number used to be stuck as 199905, and was thus
+        * basically content-free.  Newer versions of NetBSD have fixed
+        * this and now use the encoding of __NetBSD_Version__:
+        *
+        *      MMmmrrpp00
+        *
+        * M = major version
+        * m = minor version
+        * r = release ["",A-Z,Z[A-Z] but numeric]
+        * p = patchlevel
+        */
+       if (desc > 100000000U) {
+               uint32_t ver_patch = (desc / 100) % 100;
+               uint32_t ver_rel = (desc / 10000) % 100;
+               uint32_t ver_min = (desc / 1000000) % 100;
+               uint32_t ver_maj = desc / 100000000;
+
+               if (file_printf(ms, " %u.%u", ver_maj, ver_min) == -1)
+                       return;
+               if (ver_rel == 0 && ver_patch != 0) {
+                       if (file_printf(ms, ".%u", ver_patch) == -1)
+                               return;
+               } else if (ver_rel != 0) {
+                       while (ver_rel > 26) {
+                               if (file_printf(ms, "Z") == -1)
+                                       return;
+                               ver_rel -= 26;
+                       }
+                       if (file_printf(ms, "%c", 'A' + ver_rel - 1)
+                           == -1)
+                               return;
+               }
+       }
+}
+
+static void
+do_note_freebsd_version(struct magic_set *ms, int swap, void *v)
+{
+       uint32_t desc;
+
+       (void)memcpy(&desc, v, sizeof(desc));
+       desc = elf_getu32(swap, desc);
+       if (file_printf(ms, ", for FreeBSD") == -1)
+               return;
+
+       /*
+        * Contents is __FreeBSD_version, whose relation to OS
+        * versions is defined by a huge table in the Porter's
+        * Handbook.  This is the general scheme:
+        * 
+        * Releases:
+        *      Mmp000 (before 4.10)
+        *      Mmi0p0 (before 5.0)
+        *      Mmm0p0
+        * 
+        * Development branches:
+        *      Mmpxxx (before 4.6)
+        *      Mmp1xx (before 4.10)
+        *      Mmi1xx (before 5.0)
+        *      M000xx (pre-M.0)
+        *      Mmm1xx
+        * 
+        * M = major version
+        * m = minor version
+        * i = minor version increment (491000 -> 4.10)
+        * p = patchlevel
+        * x = revision
+        * 
+        * The first release of FreeBSD to use ELF by default
+        * was version 3.0.
+        */
+       if (desc == 460002) {
+               if (file_printf(ms, " 4.6.2") == -1)
+                       return;
+       } else if (desc < 460100) {
+               if (file_printf(ms, " %d.%d", desc / 100000,
+                   desc / 10000 % 10) == -1)
+                       return;
+               if (desc / 1000 % 10 > 0)
+                       if (file_printf(ms, ".%d", desc / 1000 % 10) == -1)
+                               return;
+               if ((desc % 1000 > 0) || (desc % 100000 == 0))
+                       if (file_printf(ms, " (%d)", desc) == -1)
+                               return;
+       } else if (desc < 500000) {
+               if (file_printf(ms, " %d.%d", desc / 100000,
+                   desc / 10000 % 10 + desc / 1000 % 10) == -1)
+                       return;
+               if (desc / 100 % 10 > 0) {
+                       if (file_printf(ms, " (%d)", desc) == -1)
+                               return;
+               } else if (desc / 10 % 10 > 0) {
+                       if (file_printf(ms, ".%d", desc / 10 % 10) == -1)
+                               return;
+               }
+       } else {
+               if (file_printf(ms, " %d.%d", desc / 100000,
+                   desc / 1000 % 100) == -1)
+                       return;
+               if ((desc / 100 % 10 > 0) ||
+                   (desc % 100000 / 100 == 0)) {
+                       if (file_printf(ms, " (%d)", desc) == -1)
+                               return;
+               } else if (desc / 10 % 10 > 0) {
+                       if (file_printf(ms, ".%d", desc / 10 % 10) == -1)
+                               return;
+               }
+       }
+}
+
 private size_t
 donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
     int clazz, int swap, size_t align, int *flags)
@@ -488,131 +608,41 @@
                            pax[i]) == -1)
                                return size;
                }
-               *flags |= FLAGS_DID_BUILD_ID;
        }
 
-       if (namesz == 7 && strcmp((char *)&nbuf[noff], "NetBSD") == 0 &&
-           xnh_type == NT_NETBSD_VERSION && descsz == 4) {
-               uint32_t desc;
-               (void)memcpy(&desc, &nbuf[doff], sizeof(desc));
-               desc = elf_getu32(swap, desc);
-
-               if (file_printf(ms, ", for NetBSD") == -1)
-                       return size;
-               /*
-                * The version number used to be stuck as 199905, and was thus
-                * basically content-free.  Newer versions of NetBSD have fixed
-                * this and now use the encoding of __NetBSD_Version__:
-                *
-                *      MMmmrrpp00
-                *
-                * M = major version
-                * m = minor version
-                * r = release ["",A-Z,Z[A-Z] but numeric]
-                * p = patchlevel
-                */
-               if (desc > 100000000U) {
-                       uint32_t ver_patch = (desc / 100) % 100;
-                       uint32_t ver_rel = (desc / 10000) % 100;
-                       uint32_t ver_min = (desc / 1000000) % 100;
-                       uint32_t ver_maj = desc / 100000000;
-
-                       if (file_printf(ms, " %u.%u", ver_maj, ver_min) == -1)
+       if (namesz == 7 && strcmp((char *)&nbuf[noff], "NetBSD") == 0) {
+               switch (xnh_type) {
+               case NT_NETBSD_VERSION:
+                       if (descsz == 4) {
+                               do_note_netbsd_version(ms, swap, &nbuf[doff]);
+                               *flags |= FLAGS_DID_NOTE;
                                return size;
-                       if (ver_rel == 0 && ver_patch != 0) {
-                               if (file_printf(ms, ".%u", ver_patch) == -1)
-                                       return size;
-                       } else if (ver_rel != 0) {
-                               while (ver_rel > 26) {
-                                       if (file_printf(ms, "Z") == -1)
-                                               return size;
-                                       ver_rel -= 26;
-                               }
-                               if (file_printf(ms, "%c", 'A' + ver_rel - 1)
-                                   == -1)
-                                       return size;
                        }
+                       break;
+               case NT_NETBSD_MARCH:
+                       if (file_printf(ms, ", compiled for: %.*s", (int)descsz,
+                           (const char *)&nbuf[doff]) == -1)
+                               return size;
+                       break;
+               case NT_NETBSD_CMODEL:
+                       if (file_printf(ms, ", compiler model: %.*s",
+                           (int)descsz, (const char *)&nbuf[doff]) == -1)
+                               return size;
+                       break;
+               default:
+                       if (file_printf(ms, ", note=%u", xnh_type) == -1)
+                               return size;
+                       break;
                }
-               *flags |= FLAGS_DID_NOTE;
                return size;
        }
 
-       if (namesz == 8 && strcmp((char *)&nbuf[noff], "FreeBSD") == 0 &&
-           xnh_type == NT_FREEBSD_VERSION && descsz == 4) {
-               uint32_t desc;
-               (void)memcpy(&desc, &nbuf[doff], sizeof(desc));
-               desc = elf_getu32(swap, desc);
-               if (file_printf(ms, ", for FreeBSD") == -1)
+       if (namesz == 8 && strcmp((char *)&nbuf[noff], "FreeBSD") == 0) {
+               if (xnh_type == NT_FREEBSD_VERSION && descsz == 4) {
+                       do_note_freebsd_version(ms, swap, &nbuf[doff]);
+                       *flags |= FLAGS_DID_NOTE;
                        return size;
-
-               /*
-                * Contents is __FreeBSD_version, whose relation to OS
-                * versions is defined by a huge table in the Porter's
-                * Handbook.  This is the general scheme:
-                * 
-                * Releases:
-                *      Mmp000 (before 4.10)
-                *      Mmi0p0 (before 5.0)
-                *      Mmm0p0
-                * 
-                * Development branches:
-                *      Mmpxxx (before 4.6)
-                *      Mmp1xx (before 4.10)
-                *      Mmi1xx (before 5.0)
-                *      M000xx (pre-M.0)
-                *      Mmm1xx
-                * 
-                * M = major version
-                * m = minor version
-                * i = minor version increment (491000 -> 4.10)
-                * p = patchlevel
-                * x = revision
-                * 
-                * The first release of FreeBSD to use ELF by default
-                * was version 3.0.
-                */
-               if (desc == 460002) {
-                       if (file_printf(ms, " 4.6.2") == -1)
-                               return size;
-               } else if (desc < 460100) {
-                       if (file_printf(ms, " %d.%d", desc / 100000,
-                           desc / 10000 % 10) == -1)
-                               return size;
-                       if (desc / 1000 % 10 > 0)
-                               if (file_printf(ms, ".%d", desc / 1000 % 10)
-                                   == -1)
-                                       return size;
-                       if ((desc % 1000 > 0) || (desc % 100000 == 0))
-                               if (file_printf(ms, " (%d)", desc) == -1)
-                                       return size;
-               } else if (desc < 500000) {
-                       if (file_printf(ms, " %d.%d", desc / 100000,
-                           desc / 10000 % 10 + desc / 1000 % 10) == -1)
-                               return size;
-                       if (desc / 100 % 10 > 0) {
-                               if (file_printf(ms, " (%d)", desc) == -1)
-                                       return size;
-                       } else if (desc / 10 % 10 > 0) {
-                               if (file_printf(ms, ".%d", desc / 10 % 10)
-                                   == -1)
-                                       return size;
-                       }
-               } else {
-                       if (file_printf(ms, " %d.%d", desc / 100000,
-                           desc / 1000 % 100) == -1)
-                               return size;
-                       if ((desc / 100 % 10 > 0) ||
-                           (desc % 100000 / 100 == 0)) {
-                               if (file_printf(ms, " (%d)", desc) == -1)
-                                       return size;
-                       } else if (desc / 10 % 10 > 0) {
-                               if (file_printf(ms, ".%d", desc / 10 % 10)
-                                   == -1)
-                                       return size;
-                       }
                }
-               *flags |= FLAGS_DID_NOTE;
-               return size;
        }
 
        if (namesz == 8 && strcmp((char *)&nbuf[noff], "OpenBSD") == 0 &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/file-5.15/src/readelf.h new/file-5.16/src/readelf.h
--- old/file-5.15/src/readelf.h 2013-09-20 02:27:59.000000000 +0200
+++ new/file-5.16/src/readelf.h 2013-11-05 16:41:56.000000000 +0100
@@ -272,6 +272,29 @@
 #define NT_NETBSD_PAX_ASLR             0x10    /* Force enable ASLR */
 #define NT_NETBSD_PAX_NOASLR           0x20    /* Force disable ASLR */
 
+/*
+ * NetBSD-specific note type: MACHINE_ARCH.
+ * There should be 1 NOTE per executable.
+ * name:       NetBSD\0
+ * namesz:     7
+ * desc:       string
+ * descsz:     variable
+ */
+#define NT_NETBSD_MARCH                5
+
+/*
+ * NetBSD-specific note type: COMPILER MODEL.
+ * There should be 1 NOTE per executable.
+ * name:       NetBSD\0
+ * namesz:     7
+ * desc:       string
+ * descsz:     variable
+ */
+#define NT_NETBSD_CMODEL       6
+
+#if !defined(ELFSIZE) && defined(ARCH_ELFSIZE)
+#define ELFSIZE ARCH_ELFSIZE
+#endif
 /* SunOS 5.x hardware/software capabilities */
 typedef struct {
        Elf32_Word      c_tag;

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to