ソースを参照

Import Debian version 4.20-3

Daniel Baumann 17 年 前
コミット
136f692b93
37 ファイル変更1396 行追加758 行削除
  1. 35 1
      debian/patches/00list
  2. 0 757
      debian/patches/01-conglomeration.dpatch
  3. 22 0
      debian/patches/101-magic-remove-awk.dpatch
  4. 41 0
      debian/patches/102-magic-remove-bzip.dpatch
  5. 31 0
      debian/patches/103-magic-remove-cgm.dpatch
  6. 47 0
      debian/patches/104-magic-remove-com.dpatch
  7. 55 0
      debian/patches/105-magic-remove-emf.dpatch
  8. 18 0
      debian/patches/106-magic-remove-msi.dpatch
  9. 26 0
      debian/patches/107-magic-remove-quicktime.dpatch
  10. 16 0
      debian/patches/201-magic-update-blender.dpatch
  11. 27 0
      debian/patches/202-magic-update-cow.dpatch
  12. 17 0
      debian/patches/203-magic-update-cracklib.dpatch
  13. 19 0
      debian/patches/204-magic-update-elf.dpatch
  14. 105 0
      debian/patches/205-magic-update-hp.dpatch
  15. 29 0
      debian/patches/206-magic-update-m4v.dpatch
  16. 21 0
      debian/patches/207-magic-update-perl.dpatch
  17. 19 0
      debian/patches/208-magic-update-sh.dpatch
  18. 33 0
      debian/patches/209-magic-update-spectrum.dpatch
  19. 20 0
      debian/patches/301-magic-add-adf.dpatch
  20. 18 0
      debian/patches/302-magic-add-ape.dpatch
  21. 62 0
      debian/patches/303-magic-add-clarion.dpatch
  22. 45 0
      debian/patches/304-magic-add-llvm.dpatch
  23. 60 0
      debian/patches/305-magic-add-lua.dpatch
  24. 22 0
      debian/patches/306-magic-add-lzma.dpatch
  25. 30 0
      debian/patches/307-magic-add-openrisc.dpatch
  26. 19 0
      debian/patches/308-magic-add-pe5.dpatch
  27. 17 0
      debian/patches/309-magic-add-pmenu.dpatch
  28. 18 0
      debian/patches/310-magic-add-scummvm.dpatch
  29. 24 0
      debian/patches/311-magic-add-snes.dpatch
  30. 20 0
      debian/patches/312-magic-add-subversion.dpatch
  31. 20 0
      debian/patches/313-magic-add-syslinux.dpatch
  32. 52 0
      debian/patches/901-file-elf.dpatch
  33. 36 0
      debian/patches/902-file-kfreebsd.dpatch
  34. 52 0
      debian/patches/903-file-localmagic.dpatch
  35. 19 0
      debian/patches/904-file-make.dpatch
  36. 140 0
      debian/patches/998-doc-manpages.dpatch
  37. 161 0
      debian/patches/999-conglomeration.dpatch

+ 35 - 1
debian/patches/00list

@@ -1 +1,35 @@
-01-conglomeration
+101-magic-remove-awk
+102-magic-remove-bzip
+103-magic-remove-cgm
+104-magic-remove-com
+105-magic-remove-emf
+106-magic-remove-msi
+107-magic-remove-quicktime
+201-magic-update-blender
+202-magic-update-cow
+203-magic-update-cracklib
+204-magic-update-elf
+205-magic-update-hp
+206-magic-update-m4v
+207-magic-update-perl
+208-magic-update-sh
+209-magic-update-spectrum
+301-magic-add-adf
+302-magic-add-ape
+303-magic-add-clarion
+304-magic-add-llvm
+305-magic-add-lua
+306-magic-add-lzma
+307-magic-add-openrisc
+308-magic-add-pe5
+309-magic-add-pmenu
+310-magic-add-scummvm
+311-magic-add-snes
+312-magic-add-subversion
+313-magic-add-syslinux
+901-file-elf
+902-file-kfreebsd
+903-file-localmagic
+904-file-make
+998-doc-manpages
+999-conglomeration

+ 0 - 757
debian/patches/01-conglomeration.dpatch

@@ -1,757 +0,0 @@
-#!/bin/sh /usr/share/dpatch/dpatch-run
-## 01-conglomeration.dpatch
-##
-## DP: Needs to be broken out (FIXME).
-
-@DPATCH@
-
-diff -Naur file-4.20.orig/doc/file.man file-4.20/doc/file.man
---- file-4.20.orig/doc/file.man	2007-01-25 21:05:46.000000000 +0000
-+++ file-4.20/doc/file.man	2007-03-27 12:23:14.000000000 +0000
-@@ -47,9 +47,8 @@
- or non-printable).
- Exceptions are well-known file formats (core files, tar archives)
- that are known to contain binary data.
--When modifying the file
--.Pa __MAGIC__
--or the program itself, make sure to
-+When adding local definitions to
-+.Pa /etc/magic ,
- .Em "preserve these keywords" .
- People depend on knowing that all the readable files in a directory
- have the word 
-@@ -99,12 +98,14 @@
- has been applied by extension to data files.
- Any file with some invariant identifier at a small fixed
- offset into the file can usually be described in this way.
--The information identifying these files is read from the compiled
-+The information identifying these files is read from
-+.Pa /etc/magic
-+and the compiled
- magic file
- .Pa __MAGIC__.mgc ,
- or 
- .Pa __MAGIC__
--if the compile file does not exist. In addition
-+if the compiled file does not exist. In addition
- .Nm
- will look in
- .Pa $HOME/.magic.mgc ,
-@@ -161,7 +162,8 @@
- archives).
- .Pp
- Any file that cannot be identified as having been written
--in any of the character sets listed above is simply said to be ``data''.
-+in any of the character sets listed above is simply said to be
-+.Dq data .
- .Sh OPTIONS
- .Bl -tag -width indent
- .It Fl b , -brief
-@@ -239,7 +241,12 @@
- .Dq FILES
- section, below).
- .It Fl k , -keep-going
--Don't stop at the first match, keep going.
-+Don't stop at the first match, keep going. Subsequent matches will be
-+prepended by
-+.Dq "\[rs]012\- ".
-+(If you want a newline, see 
-+.Dq "\-r"
-+option.)
- .It Fl L , -dereference
- option causes symlinks to be followed, as the like-named option in
- .Xr ls 1
-@@ -252,7 +259,8 @@
- This can be a single file, or a colon-separated list of files.
- If a compiled magic file is found alongside, it will be used instead.
- With the 
--.Fl i or 
-+.Fl i
-+or 
- .Fl "mime"
- option, the program adds
- .Dq .mime
-@@ -339,6 +347,11 @@
- and/or
- .Dq .mgc
- to the value of this variable as appropriate.
-+However,
-+.Pa file
-+has to exist in order for
-+.Pa file.mime
-+to be considered.
- The environment variable
- .Dv POSIXLY_CORRECT
- controls (on systems that support symbolic links), if
-@@ -413,12 +426,6 @@
- The order of entries in the magic file is significant.
- Depending on what system you are using, the order that
- they are put together may be incorrect.
--If your old
--.Nm
--command uses a magic file,
--keep the old magic file around for comparison purposes
--(rename it to 
--.Pa __MAGIC__.orig ).
- .Sh EXAMPLES
- .Bd -literal -offset indent 
- $ file file.c file /dev/{wd0a,hda}
-@@ -586,9 +593,17 @@
- The new support for multiple character codes makes it even slower.
- .Pp
- This manual page, and particularly this section, is too long.
-+.Sh RETURN CODE
-+.Nm
-+almost always returns 0. It returns a different code if it cannot open a file.
- .Sh AVAILABILITY
- You can obtain the original author's latest version by anonymous FTP
- on
- .Dv ftp.astron.com
- in the directory
- .Dv /pub/file/file-X.YZ.tar.gz
-+.Pp
-+This Debian version adds a number of new magix entries. It can be
-+obtained from every site carrying a Debian distribution (that is
-+.Dv ftp.debian.org
-+and mirrors).
-diff -Naur file-4.20.orig/doc/libmagic.man file-4.20/doc/libmagic.man
---- file-4.20.orig/doc/libmagic.man	2007-01-25 21:04:08.000000000 +0000
-+++ file-4.20/doc/libmagic.man	2007-03-27 12:23:14.000000000 +0000
-@@ -39,7 +39,7 @@
- .Nm magic_load
- .Nd Magic number recognition library.
- .Sh LIBRARY
--.Lb libmagic
-+.Lb libmagic1
- .Sh SYNOPSIS
- .In magic.h
- .Ft magic_t
-diff -Naur file-4.20.orig/doc/magic.man file-4.20/doc/magic.man
---- file-4.20.orig/doc/magic.man	2007-01-12 17:38:27.000000000 +0000
-+++ file-4.20/doc/magic.man	2007-03-27 12:23:14.000000000 +0000
-@@ -65,7 +65,7 @@
- .Dq c
- flag, specifies case insensitive matching: lowercase
- characters in the magic match both lower and upper case characters in the
--targer, whereas upper case characters in the magic, only much uppercase
-+target, whereas upper case characters in the magic, only much uppercase
- characters in the target.
- .It Dv pstring
- A pascal style string where the first byte is interpreted as the an
-diff -Naur file-4.20.orig/magic/Header file-4.20/magic/Header
---- file-4.20.orig/magic/Header	2000-08-05 17:36:46.000000000 +0000
-+++ file-4.20/magic/Header	2007-03-27 12:23:14.000000000 +0000
-@@ -1,5 +1,5 @@
--# Magic
- # Magic data for file(1) command.
--# Machine-generated from src/cmd/file/magdir/*; edit there only!
--# Format is described in magic(files), where:
--# files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID.
-+# Format is described in magic(5).
-+# Don't edit this file, edit /etc/magic or send your suggested inclusions to
-+# this file as a wishlist bug against file (using the reportbug utility).
-+
-diff -Naur file-4.20.orig/magic/Magdir/animation file-4.20/magic/Magdir/animation
---- file-4.20.orig/magic/Magdir/animation	2007-01-14 18:47:21.000000000 +0000
-+++ file-4.20/magic/Magdir/animation	2007-03-27 12:23:14.000000000 +0000
-@@ -14,11 +14,11 @@
- >12     string          cmov            \b movie (fast start, compressed header)
- >12     string          rmra            \b multiple URLs
- 4       string          mdat            Apple QuickTime movie (unoptimized)
--4       string          wide            Apple QuickTime movie (unoptimized)
--4       string          skip            Apple QuickTime movie (modified)
--4       string          free            Apple QuickTime movie (modified)
-+#4       string          wide            Apple QuickTime movie (unoptimized)
-+#4       string          skip            Apple QuickTime movie (modified)
-+#4       string          free            Apple QuickTime movie (modified)
- 4       string          idsc            Apple QuickTime image (fast start)
--4       string          idat            Apple QuickTime image (unoptimized)
-+#4       string          idat            Apple QuickTime image (unoptimized)
- 4       string          pckg            Apple QuickTime compressed archive
- 4	string/B	jP		JPEG 2000 image
- 4	string		ftyp		ISO Media
-diff -Naur file-4.20.orig/magic/Magdir/commands file-4.20/magic/Magdir/commands
---- file-4.20.orig/magic/Magdir/commands	2007-01-19 19:28:01.000000000 +0000
-+++ file-4.20/magic/Magdir/commands	2007-03-27 12:23:14.000000000 +0000
-@@ -28,7 +28,7 @@
- 0	string/b	#!\ /bin/awk		awk script text executable
- 0	string/b	#!\ /usr/bin/awk	awk script text executable
- # update to distinguish from *.vcf files
--0	regex		BEGIN[[:space:]]*[{]	awk script text
-+#0	regex		BEGIN[[:space:]]*[{]	awk script text
- 
- # AT&T Bell Labs' Plan 9 shell
- 0	string/b	#!\ /bin/rc	Plan 9 rc shell script text executable
-diff -Naur file-4.20.orig/magic/Magdir/compress file-4.20/magic/Magdir/compress
---- file-4.20.orig/magic/Magdir/compress	2006-03-02 22:10:26.000000000 +0000
-+++ file-4.20/magic/Magdir/compress	2007-03-27 12:23:14.000000000 +0000
-@@ -101,18 +101,18 @@
- 
- # bzip	a block-sorting file compressor
- #	by Julian Seward <sewardj@cs.man.ac.uk> and others
--#
--0	string		BZ		bzip compressed data
-->2	byte		x		\b, version: %c
-->3	string		=1		\b, compression block size 100k
-->3	string		=2		\b, compression block size 200k
-->3	string		=3		\b, compression block size 300k
-->3	string		=4		\b, compression block size 400k
-->3	string		=5		\b, compression block size 500k
-->3	string		=6		\b, compression block size 600k
-->3	string		=7		\b, compression block size 700k
-->3	string		=8		\b, compression block size 800k
-->3	string		=9		\b, compression block size 900k
-+# Disabled because it is too weak (MPi)
-+#0	string		BZ		bzip compressed data
-+#>2	byte		x		\b, version: %c
-+#>3	string		=1		\b, compression block size 100k
-+#>3	string		=2		\b, compression block size 200k
-+#>3	string		=3		\b, compression block size 300k
-+#>3	string		=4		\b, compression block size 400k
-+#>3	string		=5		\b, compression block size 500k
-+#>3	string		=6		\b, compression block size 600k
-+#>3	string		=7		\b, compression block size 700k
-+#>3	string		=8		\b, compression block size 800k
-+#>3	string		=9		\b, compression block size 900k
- 
- # lzop from <markus.oberhumer@jk.uni-linz.ac.at>
- 0	string		\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a	lzop compressed data
-diff -Naur file-4.20.orig/magic/Magdir/cracklib file-4.20/magic/Magdir/cracklib
---- file-4.20.orig/magic/Magdir/cracklib	2006-03-02 22:10:26.000000000 +0000
-+++ file-4.20/magic/Magdir/cracklib	2007-03-27 12:23:14.000000000 +0000
-@@ -9,5 +9,5 @@
- 0	belong	0x70775631	Cracklib password index, big endian
- >4	belong	>-1		(%i words)
- # really bellong 0x0000000070775631
--4	belong	0x70775631	Cracklib password index, big endian ("64-bit")
-+0	search/1	\0\0\0\0pwV1	Cracklib password index, big endian ("64-bit")
- >12	belong	>0		(%i words)
-diff -Naur file-4.20.orig/magic/Magdir/elf file-4.20/magic/Magdir/elf
---- file-4.20.orig/magic/Magdir/elf	2006-12-18 14:14:34.000000000 +0000
-+++ file-4.20/magic/Magdir/elf	2007-03-27 12:23:14.000000000 +0000
-@@ -51,7 +51,7 @@
- >>>>36  lelong&0xf0000000	0x20000000	MIPS-III
- >>>>36  lelong&0xf0000000	0x30000000	MIPS-IV
- >>>>36  lelong&0xf0000000	0x40000000	MIPS-V
-->>>>36  lelong&0xf0000000	0x60000000	MIPS32
-+>>>>36  lelong&0xf0000000	0x5fffffff	MIPS32
- >>>>36  lelong&0xf0000000	0x70000000	MIPS64
- >>>>36  lelong&0xf0000000	0x80000000	MIPS32 rel2
- >>>>36  lelong&0xf0000000	0x90000000	MIPS64 rel2
-diff -Naur file-4.20.orig/magic/Magdir/hp file-4.20/magic/Magdir/hp
---- file-4.20.orig/magic/Magdir/hp	2003-02-08 18:30:39.000000000 +0000
-+++ file-4.20/magic/Magdir/hp	2007-03-27 12:23:14.000000000 +0000
-@@ -203,33 +203,36 @@
- >8	long		>0		%d messages
- 
- # addendum to /etc/magic with HP-48sx file-types by phk@data.fls.dk 1jan92
--0	string		HPHP48-		HP48 binary
-->7	byte		>0		- Rev %c
-->8	beshort		0x1129		(ADR)
-->8	beshort		0x3329		(REAL)
-->8	beshort		0x5529		(LREAL)
-->8	beshort		0x7729		(COMPLX)
-->8	beshort		0x9d29		(LCOMPLX)
-->8	beshort		0xbf29		(CHAR)
-->8	beshort		0xe829		(ARRAY)
-->8	beshort		0x0a2a		(LNKARRAY)
-->8	beshort		0x2c2a		(STRING)
-->8	beshort		0x4e2a		(HXS)
-->8	beshort		0x742a		(LIST)
-->8	beshort		0x962a		(DIR)
-->8	beshort		0xb82a		(ALG)
-->8	beshort		0xda2a		(UNIT)
-->8	beshort		0xfc2a		(TAGGED)
-->8	beshort		0x1e2b		(GROB)
-->8	beshort		0x402b		(LIB)
-->8	beshort		0x622b		(BACKUP)
-->8	beshort		0x882b		(LIBDATA)
-->8	beshort		0x9d2d		(PROG)
-->8	beshort		0xcc2d		(CODE)
-->8	beshort		0x482e		(GNAME)
-->8	beshort		0x6d2e		(LNAME)
-->8	beshort		0x922e		(XLIB)
--0	string		%%HP:		HP48 text
-+0	string		HPHP4		HP
-+>5	string		8		48 binary
-+>5	string		9		49 binary
-+>7	byte		>64		- Rev %c
-+>8	leshort		0x2911		(ADR)
-+>8	leshort		0x2933		(REAL)
-+>8	leshort		0x2955		(LREAL)
-+>8	leshort		0x2977		(COMPLX)
-+>8	leshort		0x299d		(LCOMPLX)
-+>8	leshort		0x29bf		(CHAR)
-+>8	leshort		0x29e8		(ARRAY)
-+>8	leshort		0x2a0a		(LNKARRAY)
-+>8	leshort		0x2a2c		(STRING)
-+>8	leshort		0x2a4e		(HXS)
-+>8	leshort		0x2a74		(LIST)
-+>8	leshort		0x2a96		(DIR)
-+>8	leshort		0x2ab8		(ALG)
-+>8	leshort		0x2ada		(UNIT)
-+>8	leshort		0x2afc		(TAGGED)
-+>8	leshort		0x2b1e		(GROB)
-+>8	leshort		0x2b40		(LIB)
-+>8	leshort		0x2b62		(BACKUP)
-+>8	leshort		0x2b88		(LIBDATA)
-+>8	leshort		0x2d9d		(PROG)
-+>8	leshort		0x2dcc		(CODE)
-+>8	leshort		0x2e48		(GNAME)
-+>8	leshort		0x2e6d		(LNAME)
-+>8	leshort		0x2e92		(XLIB)
-+
-+0	string		%%HP:		HP text
- >6	string		T(0)		- T(0)
- >6	string		T(1)		- T(1)
- >6	string		T(2)		- T(2)
-@@ -240,6 +243,23 @@
- >14	string		F(.)		F(.);
- >14	string		F(,)		F(,);
- 
-+0	string		HP3		HP
-+>3	string		8		38
-+>3	string		9		39
-+>4	string		Bin		binary
-+>4	string		Asc		ASCII
-+>7	string		A		(Directory List)
-+>7	string		B		(Zaplet)
-+>7	string		C		(Note)
-+>7	string		D		(Program)
-+>7	string		E		(Variable)
-+>7	string		F		(List)
-+>7	string		G		(Matrix)
-+>7	string		H		(Library)
-+>7	string		I		(Target List)
-+>7	string		J		(ASCII Vector specification)
-+>7	string		K		(wildcard)
-+
- # hpBSD magic numbers
- 0	beshort		200		hp200 (68010) BSD
- >2	beshort		0407		impure binary
-@@ -390,6 +410,3 @@
- >>>>>>>>>0xC4	belong	33		- received SIGXCPU
- >>>>>>>>>0xC4	belong	34		- received SIGXFSZ
- 
--# From: AMAKAWA Shuhei <sa264@cam.ac.uk>
--0	string	HPHP49-			HP49 binary
--
-diff -Naur file-4.20.orig/magic/Magdir/images file-4.20/magic/Magdir/images
---- file-4.20.orig/magic/Magdir/images	2007-01-19 19:31:46.000000000 +0000
-+++ file-4.20/magic/Magdir/images	2007-03-27 12:23:14.000000000 +0000
-@@ -130,8 +130,8 @@
- # CGM image files
- 0	string		BEGMF		clear text Computer Graphics Metafile
- # XXX - questionable magic
--0	beshort&0xffe0	0x0020		binary Computer Graphics Metafile
--0	beshort		0x3020		character Computer Graphics Metafile
-+#0	beshort&0xffe0	0x0020		binary Computer Graphics Metafile
-+#0	beshort		0x3020		character Computer Graphics Metafile
- 
- # MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
- 0	string	yz	MGR bitmap, modern format, 8-bit aligned
-@@ -505,9 +505,6 @@
- # http://www.djvuzone.org/
- 0	string	AT&TFORM		DjVu Image file
- 
--# From: Jason Bacon <bacon@smithers.neuro.mcw.edu>
--0	beshort	0x3020			character Computer Graphics Metafile
--
- # From Marc Espie
- 0	lelong	20000630		OpenEXR image data
- 
-@@ -525,3 +522,10 @@
- # Xara (for a while: Corel Xara) is a graphic package, see
- # http://www.xara.com/ for Windows and as GPL application for
- 0	string	XARA\243\243	Xara graphics file
-+
-+# The boot loaders syslinux and isolinux use a RLE based image format
-+# called SLL16 to store splash screens.
-+0	lelong		0x1413f33d	Syslinux SLL16 image data,
-+>4	leshort		>0		%hd x
-+>6	leshort		>0		%hd
-+
-diff -Naur file-4.20.orig/magic/Magdir/msdos file-4.20/magic/Magdir/msdos
---- file-4.20.orig/magic/Magdir/msdos	2007-01-19 19:35:20.000000000 +0000
-+++ file-4.20/magic/Magdir/msdos	2007-03-27 12:23:14.000000000 +0000
-@@ -262,8 +262,9 @@
- # Uncommenting only the first two lines will cover about 2/3 of COM files,
- # but it isn't feasible to match all COM files since there must be at least
- # two dozen different one-byte "magics".
--0	byte		0xe9		DOS executable (COM)
-->0x1FE	leshort		0xAA55		\b, boot code
-+# Disabled one-byte magic (MPi)
-+#0	byte		0xe9		DOS executable (COM)
-+#>0x1FE	leshort		0xAA55		\b, boot code
- >6	string		SFX\ of\ LHarc	(%s)
- 0	belong	0xffffffff		DOS executable (device driver)
- #CMD640X2.SYS
-@@ -286,15 +287,16 @@
- >>77	string	>\x40			
- >>>77	string	<\x5B			
- >>>>77	string	x			\b, name: %.8s
--0	byte		0x8c		DOS executable (COM)
-+# Disabled one-byte magic (MPi)
-+#0	byte		0x8c		DOS executable (COM)
- # 0xeb conflicts with "sequent" magic
--0	byte		0xeb		DOS executable (COM)
-->0x1FE	leshort		0xAA55		\b, boot code
-->85	string		UPX		\b, UPX compressed
-->4	string		\ $ARX		\b, ARX self-extracting archive
-->4	string		\ $LHarc	\b, LHarc self-extracting archive
-->0x20e	string		SFX\ by\ LARC	\b, LARC self-extracting archive
--0	byte		0xb8		COM executable
-+#0	byte		0xeb		DOS executable (COM)
-+#>0x1FE	leshort		0xAA55		\b, boot code
-+#>85	string		UPX		\b, UPX compressed
-+#>4	string		\ $ARX		\b, ARX self-extracting archive
-+#>4	string		\ $LHarc	\b, LHarc self-extracting archive
-+#>0x20e	string		SFX\ by\ LARC	\b, LARC self-extracting archive
-+#0	byte		0xb8		COM executable
- # modified by Joerg Jenderek
- >1	lelong          !0x21cd4cff	for DOS
- # http://syslinux.zytor.com/comboot.php
-@@ -572,24 +574,25 @@
- >4	byte	=0x30			Offline database
- 
- 
--# Windows Enhanced Metafile (EMF)
--# See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp 
--# for further information. Note that "0 lelong 1" should be true i.e.
--# the first double word in the file should be 1. With the extended
--# syntax available by some file commands you could write:
--# 0 lelong 1
--# &40 ulelong 0x464D4520 Windows Enhanced Metafile (EMF) image data
--40	ulelong 0x464D4520	Windows Enhanced Metafile (EMF) image data
-->44	ulelong x		version 0x%x.
--# If the description has a length greater than zero, it exists and is 
--# found at offset (*64).
-->64	ulelong >0		Description available at offset 0x%x
-->>60	ulelong	>0		(length 0x%x)
--# Note it would be better to print out the description, which is found 
--# as below. Unfortunately the following only prints out the first couple
--# of characters instead of all the "description length"
--# number of characters -- indicated by the ulelong at offset 60.
-->>(64.l)  lestring16 >0 Description: %15.15s
-+# This is pure ASCII magic, "EMF " at position 40 (MPi)
-+## Windows Enhanced Metafile (EMF)
-+## See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp 
-+## for further information. Note that "0 lelong 1" should be true i.e.
-+## the first double word in the file should be 1. With the extended
-+## syntax available by some file commands you could write:
-+## 0 lelong 1
-+## &40 ulelong 0x464D4520 Windows Enhanced Metafile (EMF) image data
-+#40	ulelong 0x464D4520	Windows Enhanced Metafile (EMF) image data
-+#>44	ulelong x		version 0x%x.
-+## If the description has a length greater than zero, it exists and is 
-+## found at offset (*64).
-+#>64	ulelong >0		Description available at offset 0x%x
-+#>>60	ulelong	>0		(length 0x%x)
-+## Note it would be better to print out the description, which is found 
-+## as below. Unfortunately the following only prints out the first couple
-+## of characters instead of all the "description length"
-+## number of characters -- indicated by the ulelong at offset 60.
-+#>>(64.l)  lestring16 >0 Description: %15.15s
- 
- # From: Alex Beregszaszi <alex@fsn.hu>
- 0	string	COWD		VMWare3
-@@ -617,5 +620,6 @@
- 0	lelong	0x02468ace			Bochs Sparse disk image
- 
- # from http://filext.com by Derek M Jones <derek@knosof.co.uk>
--0	string	\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF	Microsoft Installer
-+# False positive with PPT
-+#0	string	\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF	Microsoft Installer
- 0	string	\320\317\021\340\241\261\032\341	Microsoft Office Document
-diff -Naur file-4.20.orig/magic/Magdir/perl file-4.20/magic/Magdir/perl
---- file-4.20.orig/magic/Magdir/perl	2007-03-01 23:20:19.000000000 +0000
-+++ file-4.20/magic/Magdir/perl	2007-03-27 12:23:14.000000000 +0000
-@@ -9,8 +9,8 @@
- 0	string		eval\ "exec\ /bin/perl		perl script text
- 0	string/b	#!\ /usr/bin/perl		perl script text executable
- 0	string		eval\ "exec\ /usr/bin/perl	perl script text
--0	string/b	#!\ /usr/local/bin/perl		perl script text
--0	string		eval\ "exec\ /usr/local/bin/perl	perl script text executable
-+0	string/b	#!\ /usr/local/bin/perl		perl script text executable
-+0	string		eval\ "exec\ /usr/local/bin/perl	perl script text
- 0	string		eval\ '(exit\ $?0)'\ &&\ eval\ 'exec	perl script text
- 
- 
-diff -Naur file-4.20.orig/magic/Magdir/revision file-4.20/magic/Magdir/revision
---- file-4.20.orig/magic/Magdir/revision	2003-05-25 23:04:55.000000000 +0000
-+++ file-4.20/magic/Magdir/revision	2007-03-27 12:23:14.000000000 +0000
-@@ -3,3 +3,9 @@
- # file(1) magic for revision control files
- # From Hendrik Scholz <hendrik@scholz.net>
- 0   string /1\ :pserver:    cvs password text file
-+
-+
-+# Subversion (SVN) dumps
-+# Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
-+0       string  SVN-fs-dump-format-version:     Subversion dumpfile
-+>28     string  >\0                             (version: %s)
-diff -Naur file-4.20.orig/magic/magic.local file-4.20/magic/magic.local
---- file-4.20.orig/magic/magic.local	1970-01-01 00:00:00.000000000 +0000
-+++ file-4.20/magic/magic.local	2007-03-27 12:23:14.000000000 +0000
-@@ -0,0 +1,3 @@
-+# Magic local data for file(1) command.
-+# Insert here your local magic data. Format is described in magic(5).
-+
-diff -Naur file-4.20.orig/magic/magic.mime file-4.20/magic/magic.mime
---- file-4.20.orig/magic/magic.mime	2007-01-25 22:10:35.000000000 +0000
-+++ file-4.20/magic/magic.mime	2007-03-27 12:23:14.000000000 +0000
-@@ -156,9 +156,7 @@
- 
- # Creative Labs AUDIO stuff
- #					Standard MIDI data
--0	string	MThd			audio/unknown
--#>9 	byte	>0			(format %d)
--#>11	byte	>1			using %d channels
-+0	string	MThd			audio/midi
- #					Creative Music (CMF) data
- 0	string	CTMF			audio/unknown
- #					SoundBlaster instrument data
-@@ -273,7 +271,7 @@
- 0       string          #!/usr/bin/awk          application/x-awk
- 0       string          #!\ /usr/bin/awk        application/x-awk
- # update to distinguish from *.vcf files by Joerg Jenderek: joerg dot jenderek at web dot de
--0	regex		BEGIN[[:space:]]*[{]	application/x-awk
-+#0	regex		BEGIN[[:space:]]*[{]	application/x-awk
- 
- # For Larry Wall's perl language.  The ``eval'' line recognizes an
- # outrageously clever hack for USG systems.
-@@ -298,7 +296,7 @@
- # because it tries to uncompress it to figure out what's inside.
- 
- # standard unix compress
--0	string		\037\235	application/x-compress
-+#0	string		\037\235	application/x-compress
- 
- # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
- 0       string          \037\213        application/x-gzip
-@@ -400,18 +398,15 @@
- #------------------------------------------------------------------------------
- # html:  file(1) magic for HTML (HyperText Markup Language) docs
- #
--# from Daniel Quinlan <quinlan@yggdrasil.com>
-+# from Michael Piefel <piefel@debian.org>
- #
--0	string		\<HEAD	text/html
--0	string		\<head	text/html
--0	string		\<TITLE	text/html
--0	string		\<title	text/html
--0       string          \<html	text/html
--0       string          \<HTML	text/html
-+0	string/cB	\<!DOCTYPE\ html	text/html
-+0	string/cb	\<head	text/html
-+0	string/cb	\<title	text/html
-+0       string/bc	\<html	text/html
- 0	string		\<!--	text/html
--0	string		\<h1	text/html
--0	string		\<H1	text/html
--0	string/c	\<!doctype\ html	text/html
-+0	string/c	\<h1	text/html
-+
- 
- #------------------------------------------------------------------------------
- # images:  file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
-@@ -474,7 +469,7 @@
- 0	beshort		0xffd8		image/jpeg
- 
- # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
--0	string		BM		image/bmp
-+0	string		BM		image/x-ms-bmp
- #>14	byte		12		(OS/2 1.x format)
- #>14	byte		64		(OS/2 2.x format)
- #>14	byte		40		(Windows 3.x format)
-@@ -706,8 +701,10 @@
- #------------------------------------------------------------------------------
- # Hierarchical Data Format, used to facilitate scientific data exchange
- # specifications at http://hdf.ncsa.uiuc.edu/
--0	belong		0x0e031301	Hierarchical Data Format (version 4) data
--0	string		\211HDF\r\n\032	Hierarchical Data Format (version 5) data
-+#Hierarchical Data Format (version 4) data
-+0	belong		0x0e031301		application/x-hdf
-+#Hierarchical Data Format (version 5) data
-+0	string		\211HDF\r\n\032		application/x-hdf
- 
- # Adobe Photoshop
- 0	string		8BPS			image/x-photoshop
-@@ -777,21 +774,25 @@
- # Debian has entries for the old PGP formats:
- # pgp:  file(1) magic for Pretty Good Privacy
- # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
--0       beshort         0x9900                  text/PGP key public ring
--0       beshort         0x9501                  text/PGP key security ring
--0       beshort         0x9500                  text/PGP key security ring
--0       beshort         0xa600                  text/PGP encrypted data
--0       string          -----BEGIN\040PGP       text/PGP armored data
-->15     string          PUBLIC\040KEY\040BLOCK- public key block
-->15     string          MESSAGE-                message
-->15     string          SIGNED\040MESSAGE-      signed message
-->15     string          PGP\040SIGNATURE-       signature
--0       beshort         0x8501                  data
-+#text/PGP key public ring
-+0	beshort		0x9900			application/pgp
-+#text/PGP key security ring
-+0	beshort		0x9501			application/pgp
-+#text/PGP key security ring
-+0	beshort		0x9500			application/pgp
-+#text/PGP encrypted data
-+0	beshort		0xa600			application/pgp-encrypted
-+#text/PGP armored data
-+##public key block
-+2	string	---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK-	application/pgp-keys
-+0	string	-----BEGIN\040PGP\40MESSAGE-			application/pgp
-+0	string	-----BEGIN\040PGP\40SIGNATURE-			application/pgp-signature
- #
- # GnuPG Magic:
--#
--0       beshort         0x9901                  text/GnuPG key public ring
--0       beshort         0x8501                  text/OpenPGP data
-+#text/GnuPG key public ring
-+0	beshort		0x9901			application/pgp
-+#text/OpenPGP data
-+0	beshort		0x8501			application/pgp-encrypted	
- 
- # flash:        file(1) magic for Macromedia Flash file format
- #
-@@ -951,3 +952,9 @@
- 
- # 
- 128	string		DICM		application/dicom
-+
-+# Gnumeric spreadsheet
-+# This entry is only semi-helpful, as Gnumeric compresses its files, so
-+# they will ordinarily reported as "compressed", but at least -z helps
-+39      string          =<gmr:Workbook           application/x-gnumeric
-+
-diff -Naur file-4.20.orig/src/Makefile.am file-4.20/src/Makefile.am
---- file-4.20.orig/src/Makefile.am	2007-01-12 17:40:53.000000000 +0000
-+++ file-4.20/src/Makefile.am	2007-03-27 12:23:14.000000000 +0000
-@@ -5,7 +5,7 @@
- 
- bin_PROGRAMS = file
- 
--AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
-+AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
- 
- libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
- 	compress.c is_tar.c readelf.c print.c fsmagic.c \
-diff -Naur file-4.20.orig/src/Makefile.in file-4.20/src/Makefile.in
---- file-4.20.orig/src/Makefile.in	2007-03-01 23:21:09.000000000 +0000
-+++ file-4.20/src/Makefile.in	2007-03-27 12:23:14.000000000 +0000
-@@ -196,7 +196,7 @@
- lib_LTLIBRARIES = libmagic.la
- include_HEADERS = magic.h
- EXTRA_DIST = test.c
--AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
-+AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
- libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
- 	compress.c is_tar.c readelf.c print.c fsmagic.c \
- 	funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c
-@@ -296,7 +296,7 @@
- 	done
- file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) 
- 	@rm -f file$(EXEEXT)
--	$(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD) $(LIBS)
-+	$(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD)
- 
- mostlyclean-compile:
- 	-rm -f *.$(OBJEXT)
-diff -Naur file-4.20.orig/src/file.c file-4.20/src/file.c
---- file-4.20.orig/src/file.c	2007-01-25 21:05:46.000000000 +0000
-+++ file-4.20/src/file.c	2007-03-27 12:23:14.000000000 +0000
-@@ -352,7 +352,7 @@
- 	}
- 
- 	magic_close(magic);
--	return 0;
-+	return magic->haderr ? -1 : 0;
- }
- 
- 
-diff -Naur file-4.20.orig/src/fsmagic.c file-4.20/src/fsmagic.c
---- file-4.20.orig/src/fsmagic.c	2007-01-12 17:40:53.000000000 +0000
-+++ file-4.20/src/fsmagic.c	2007-03-27 12:23:14.000000000 +0000
-@@ -92,7 +92,8 @@
- 		if (file_printf(ms, "cannot open `%s' (%s)",
- 		    fn, strerror(errno)) == -1)
- 			return -1;
--		return 1;
-+		ms->haderr++;
-+		return -1;
- 	}
- 
- 	if ((ms->flags & MAGIC_MIME) != 0) {
-diff -Naur file-4.20.orig/src/readelf.c file-4.20/src/readelf.c
---- file-4.20.orig/src/readelf.c	2007-01-18 05:45:35.000000000 +0000
-+++ file-4.20/src/readelf.c	2007-03-27 12:23:14.000000000 +0000
-@@ -396,6 +396,14 @@
- 			if (file_printf(ms, "Solaris") == -1)
- 				return size;
- 			break;
-+		case GNU_OS_KFREEBSD:
-+			if (file_printf(ms, "kFreeBSD") == -1)
-+				return size;
-+			break;
-+		case GNU_OS_KNETBSD:
-+			if (file_printf(ms, "kNetBSD") == -1)
-+				return size;
-+			break;
- 		default:
- 			if (file_printf(ms, "<unknown>") == -1)
- 				return size; 
-@@ -907,29 +915,30 @@
- 	off_t fsize;
- 	int flags = 0;
- 
--	/*
--	 * If we cannot seek, it must be a pipe, socket or fifo.
--	 */
--	if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
--		fd = file_pipe2file(ms, fd, buf, nbytes);
--
--	if (fstat(fd, &st) == -1) {
--  		file_badread(ms);
--		return -1;
--	}
--	fsize = st.st_size;
- 
- 	/*
- 	 * ELF executables have multiple section headers in arbitrary
- 	 * file locations and thus file(1) cannot determine it from easily.
- 	 * Instead we traverse thru all section headers until a symbol table
- 	 * one is found or else the binary is stripped.
-+	 * Return immediately if it's not ELF (so we avoid pipe2file unless needed).
- 	 */
- 	if (buf[EI_MAG0] != ELFMAG0
- 	    || (buf[EI_MAG1] != ELFMAG1 && buf[EI_MAG1] != OLFMAG1)
- 	    || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
- 	    return 0;
- 
-+	/*
-+	 * If we cannot seek, it must be a pipe, socket or fifo.
-+	 */
-+	if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
-+		fd = file_pipe2file(ms, fd, buf, nbytes);
-+
-+	if (fstat(fd, &st) == -1) {
-+  		file_badread(ms);
-+		return -1;
-+	}
-+	fsize = st.st_size;
- 
- 	class = buf[EI_CLASS];
- 
-diff -Naur file-4.20.orig/src/readelf.h file-4.20/src/readelf.h
---- file-4.20.orig/src/readelf.h	2007-01-12 17:40:53.000000000 +0000
-+++ file-4.20/src/readelf.h	2007-03-27 12:23:14.000000000 +0000
-@@ -232,5 +232,7 @@
- #define GNU_OS_LINUX	0
- #define GNU_OS_HURD	1
- #define GNU_OS_SOLARIS	2
-+#define GNU_OS_KFREEBSD	3
-+#define GNU_OS_KNETBSD	4
- 
- #endif

+ 22 - 0
debian/patches/101-magic-remove-awk.dpatch

@@ -0,0 +1,22 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 11-magic-remove-awk.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Remove AWK detection by regular expression testing just for 'BEGIN:';
+## DP: this caused a lot of false guesses (and problems with naughty programs
+## DP: reading other programs' files), this closes: #308305, #375403 and makes
+## DP: others disappear (for the time being, for example, it closes: #375722).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/commands file-4.20/magic/Magdir/commands
+--- file-4.20.orig/magic/Magdir/commands	2007-01-19 19:28:01.000000000 +0000
++++ file-4.20/magic/Magdir/commands	2007-03-27 12:23:14.000000000 +0000
+@@ -28,7 +28,7 @@
+ 0	string/b	#!\ /bin/awk		awk script text executable
+ 0	string/b	#!\ /usr/bin/awk	awk script text executable
+ # update to distinguish from *.vcf files
+-0	regex		BEGIN[[:space:]]*[{]	awk script text
++#0	regex		BEGIN[[:space:]]*[{]	awk script text
+ 
+ # AT&T Bell Labs' Plan 9 shell
+ 0	string/b	#!\ /bin/rc	Plan 9 rc shell script text executable

+ 41 - 0
debian/patches/102-magic-remove-bzip.dpatch

@@ -0,0 +1,41 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 12-magic-remove-bzip.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Disabled BZIP detection (closes: #277648).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/compress file-4.20/magic/Magdir/compress
+--- file-4.20.orig/magic/Magdir/compress	2006-03-02 22:10:26.000000000 +0000
++++ file-4.20/magic/Magdir/compress	2007-03-27 12:23:14.000000000 +0000
+@@ -101,18 +101,18 @@
+ 
+ # bzip	a block-sorting file compressor
+ #	by Julian Seward <sewardj@cs.man.ac.uk> and others
+-#
+-0	string		BZ		bzip compressed data
+->2	byte		x		\b, version: %c
+->3	string		=1		\b, compression block size 100k
+->3	string		=2		\b, compression block size 200k
+->3	string		=3		\b, compression block size 300k
+->3	string		=4		\b, compression block size 400k
+->3	string		=5		\b, compression block size 500k
+->3	string		=6		\b, compression block size 600k
+->3	string		=7		\b, compression block size 700k
+->3	string		=8		\b, compression block size 800k
+->3	string		=9		\b, compression block size 900k
++# Disabled because it is too weak (MPi)
++#0	string		BZ		bzip compressed data
++#>2	byte		x		\b, version: %c
++#>3	string		=1		\b, compression block size 100k
++#>3	string		=2		\b, compression block size 200k
++#>3	string		=3		\b, compression block size 300k
++#>3	string		=4		\b, compression block size 400k
++#>3	string		=5		\b, compression block size 500k
++#>3	string		=6		\b, compression block size 600k
++#>3	string		=7		\b, compression block size 700k
++#>3	string		=8		\b, compression block size 800k
++#>3	string		=9		\b, compression block size 900k
+ 
+ # lzop from <markus.oberhumer@jk.uni-linz.ac.at>
+ 0	string		\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a	lzop compressed data

+ 31 - 0
debian/patches/103-magic-remove-cgm.dpatch

@@ -0,0 +1,31 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 13-magic-remove-cgm.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: FIXME
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/images file-4.20/magic/Magdir/images
+--- file-4.20.orig/magic/Magdir/images	2007-01-19 19:31:46.000000000 +0000
++++ file-4.20/magic/Magdir/images	2007-03-27 12:23:14.000000000 +0000
+@@ -130,8 +130,8 @@
+ # CGM image files
+ 0	string		BEGMF		clear text Computer Graphics Metafile
+ # XXX - questionable magic
+-0	beshort&0xffe0	0x0020		binary Computer Graphics Metafile
+-0	beshort		0x3020		character Computer Graphics Metafile
++#0	beshort&0xffe0	0x0020		binary Computer Graphics Metafile
++#0	beshort		0x3020		character Computer Graphics Metafile
+ 
+ # MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
+ 0	string	yz	MGR bitmap, modern format, 8-bit aligned
+@@ -505,9 +505,6 @@
+ # http://www.djvuzone.org/
+ 0	string	AT&TFORM		DjVu Image file
+ 
+-# From: Jason Bacon <bacon@smithers.neuro.mcw.edu>
+-0	beshort	0x3020			character Computer Graphics Metafile
+-
+ # From Marc Espie
+ 0	lelong	20000630		OpenEXR image data
+ 

+ 47 - 0
debian/patches/104-magic-remove-com.dpatch

@@ -0,0 +1,47 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 14-magic-remove-com.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Disable one-byte magic for COM (closes: #393775, #339618).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/msdos file-4.20/magic/Magdir/msdos
+--- file-4.20.orig/magic/Magdir/msdos	2007-01-19 19:35:20.000000000 +0000
++++ file-4.20/magic/Magdir/msdos	2007-03-27 12:23:14.000000000 +0000
+@@ -262,8 +262,9 @@
+ # Uncommenting only the first two lines will cover about 2/3 of COM files,
+ # but it isn't feasible to match all COM files since there must be at least
+ # two dozen different one-byte "magics".
+-0	byte		0xe9		DOS executable (COM)
+->0x1FE	leshort		0xAA55		\b, boot code
++# Disabled one-byte magic (MPi)
++#0	byte		0xe9		DOS executable (COM)
++#>0x1FE	leshort		0xAA55		\b, boot code
+ >6	string		SFX\ of\ LHarc	(%s)
+ 0	belong	0xffffffff		DOS executable (device driver)
+ #CMD640X2.SYS
+@@ -286,15 +287,16 @@
+ >>77	string	>\x40			
+ >>>77	string	<\x5B			
+ >>>>77	string	x			\b, name: %.8s
+-0	byte		0x8c		DOS executable (COM)
++# Disabled one-byte magic (MPi)
++#0	byte		0x8c		DOS executable (COM)
+ # 0xeb conflicts with "sequent" magic
+-0	byte		0xeb		DOS executable (COM)
+->0x1FE	leshort		0xAA55		\b, boot code
+->85	string		UPX		\b, UPX compressed
+->4	string		\ $ARX		\b, ARX self-extracting archive
+->4	string		\ $LHarc	\b, LHarc self-extracting archive
+->0x20e	string		SFX\ by\ LARC	\b, LARC self-extracting archive
+-0	byte		0xb8		COM executable
++#0	byte		0xeb		DOS executable (COM)
++#>0x1FE	leshort		0xAA55		\b, boot code
++#>85	string		UPX		\b, UPX compressed
++#>4	string		\ $ARX		\b, ARX self-extracting archive
++#>4	string		\ $LHarc	\b, LHarc self-extracting archive
++#>0x20e	string		SFX\ by\ LARC	\b, LARC self-extracting archive
++#0	byte		0xb8		COM executable
+ # modified by Joerg Jenderek
+ >1	lelong          !0x21cd4cff	for DOS
+ # http://syslinux.zytor.com/comboot.php

+ 55 - 0
debian/patches/105-magic-remove-emf.dpatch

@@ -0,0 +1,55 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 15-magic-remove-emf.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Disabled EMF detection as it not only caused false positives, which might
+## DP: have been acceptible, but a segmentation fault (closes: #333502).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/msdos file-4.20/magic/Magdir/msdos
+--- file-4.20.orig/magic/Magdir/msdos	2007-01-19 19:35:20.000000000 +0000
++++ file-4.20/magic/Magdir/msdos	2007-03-27 12:23:14.000000000 +0000
+@@ -572,24 +574,25 @@
+ >4	byte	=0x30			Offline database
+ 
+ 
+-# Windows Enhanced Metafile (EMF)
+-# See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp 
+-# for further information. Note that "0 lelong 1" should be true i.e.
+-# the first double word in the file should be 1. With the extended
+-# syntax available by some file commands you could write:
+-# 0 lelong 1
+-# &40 ulelong 0x464D4520 Windows Enhanced Metafile (EMF) image data
+-40	ulelong 0x464D4520	Windows Enhanced Metafile (EMF) image data
+->44	ulelong x		version 0x%x.
+-# If the description has a length greater than zero, it exists and is 
+-# found at offset (*64).
+->64	ulelong >0		Description available at offset 0x%x
+->>60	ulelong	>0		(length 0x%x)
+-# Note it would be better to print out the description, which is found 
+-# as below. Unfortunately the following only prints out the first couple
+-# of characters instead of all the "description length"
+-# number of characters -- indicated by the ulelong at offset 60.
+->>(64.l)  lestring16 >0 Description: %15.15s
++# This is pure ASCII magic, "EMF " at position 40 (MPi)
++## Windows Enhanced Metafile (EMF)
++## See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp 
++## for further information. Note that "0 lelong 1" should be true i.e.
++## the first double word in the file should be 1. With the extended
++## syntax available by some file commands you could write:
++## 0 lelong 1
++## &40 ulelong 0x464D4520 Windows Enhanced Metafile (EMF) image data
++#40	ulelong 0x464D4520	Windows Enhanced Metafile (EMF) image data
++#>44	ulelong x		version 0x%x.
++## If the description has a length greater than zero, it exists and is 
++## found at offset (*64).
++#>64	ulelong >0		Description available at offset 0x%x
++#>>60	ulelong	>0		(length 0x%x)
++## Note it would be better to print out the description, which is found 
++## as below. Unfortunately the following only prints out the first couple
++## of characters instead of all the "description length"
++## number of characters -- indicated by the ulelong at offset 60.
++#>>(64.l)  lestring16 >0 Description: %15.15s
+ 
+ # From: Alex Beregszaszi <alex@fsn.hu>
+ 0	string	COWD		VMWare3

+ 18 - 0
debian/patches/106-magic-remove-msi.dpatch

@@ -0,0 +1,18 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 16-magic-remove-msi.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Disable second MS Installer entry (closes: #409895).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/msdos file-4.20/magic/Magdir/msdos
+--- file-4.20.orig/magic/Magdir/msdos	2007-01-19 19:35:20.000000000 +0000
++++ file-4.20/magic/Magdir/msdos	2007-03-27 12:23:14.000000000 +0000
+@@ -617,5 +620,6 @@
+ 0	lelong	0x02468ace			Bochs Sparse disk image
+ 
+ # from http://filext.com by Derek M Jones <derek@knosof.co.uk>
+-0	string	\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF	Microsoft Installer
++# False positive with PPT
++#0	string	\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF	Microsoft Installer
+ 0	string	\320\317\021\340\241\261\032\341	Microsoft Office Document

+ 26 - 0
debian/patches/107-magic-remove-quicktime.dpatch

@@ -0,0 +1,26 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 17-magic-remove-quicktime.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Disabled some QuickTime entries (ASCII words, closes: #366986, #308394).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/animation file-4.20/magic/Magdir/animation
+--- file-4.20.orig/magic/Magdir/animation	2007-01-14 18:47:21.000000000 +0000
++++ file-4.20/magic/Magdir/animation	2007-03-27 12:23:14.000000000 +0000
+@@ -14,11 +14,11 @@
+ >12     string          cmov            \b movie (fast start, compressed header)
+ >12     string          rmra            \b multiple URLs
+ 4       string          mdat            Apple QuickTime movie (unoptimized)
+-4       string          wide            Apple QuickTime movie (unoptimized)
+-4       string          skip            Apple QuickTime movie (modified)
+-4       string          free            Apple QuickTime movie (modified)
++#4       string          wide            Apple QuickTime movie (unoptimized)
++#4       string          skip            Apple QuickTime movie (modified)
++#4       string          free            Apple QuickTime movie (modified)
+ 4       string          idsc            Apple QuickTime image (fast start)
+-4       string          idat            Apple QuickTime image (unoptimized)
++#4       string          idat            Apple QuickTime image (unoptimized)
+ 4       string          pckg            Apple QuickTime compressed archive
+ 4	string/B	jP		JPEG 2000 image
+ 4	string		ftyp		ISO Media

+ 16 - 0
debian/patches/201-magic-update-blender.dpatch

@@ -0,0 +1,16 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 21-magic-update-blender.dpatch by Josh Babcock <jbabcock@atlantech.net>
+##
+## DP: Adds magic for Blender python scripts (Closes: #323291).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/blender file-4.20/magic/Magdir/blender
+--- file-4.20.orig/magic/Magdir/blender	2000-08-05 17:12:09.000000000 +0000
++++ file-4.20/magic/Magdir/blender	2007-03-27 16:28:58.000000000 +0000
+@@ -15,3 +15,5 @@
+ >9	byte	x		with version %c.
+ >10	byte	x		\b%c
+ >11	byte	x		\b%c
++
++0	string	#!BPY		Blender3D Python file

+ 27 - 0
debian/patches/202-magic-update-cow.dpatch

@@ -0,0 +1,27 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 22-magic-update-cow.dpatch by Matthew Palmer <mpalmer@debian.org>
+##
+## DP: Update COW magic from 2.0 to 3.0 (Closes: #283515, #319128).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/linux file-4.20/magic/Magdir/linux
+--- file-4.20.orig/magic/Magdir/linux	2006-11-25 18:36:10.000000000 +0000
++++ file-4.20/magic/Magdir/linux	2007-03-27 16:33:53.000000000 +0000
+@@ -109,10 +109,12 @@
+ 0	string	Begin3	Linux Software Map entry text
+ 0	string	Begin4	Linux Software Map entry text (new format)
+ 
+-# From Matt Zimmerman
+-0       belong  0x4f4f4f4d      User-mode Linux COW file
+->4      belong  x               \b, version %d
+->8      string  >\0             \b, backing file %s
++# From Matt Zimmerman, enhanced for v3 by Matthew Palmer
++0	belong	0x4f4f4f4d	User-mode Linux COW file
++>4	belong	<3		\b, version %d
++>>8	string	>\0		\b, backing file %s
++>4	belong	>2		\b, version %d
++>>32	string	>\0		\b, backing file %s
+ 
+ ############################################################################
+ # Linux kernel versions

+ 17 - 0
debian/patches/203-magic-update-cracklib.dpatch

@@ -0,0 +1,17 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 23-magic-update-cracklib.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Improved over-confident 64bit-cracklib rule (closes: #343504).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/cracklib file-4.20/magic/Magdir/cracklib
+--- file-4.20.orig/magic/Magdir/cracklib	2006-03-02 22:10:26.000000000 +0000
++++ file-4.20/magic/Magdir/cracklib	2007-03-27 12:23:14.000000000 +0000
+@@ -9,5 +9,5 @@
+ 0	belong	0x70775631	Cracklib password index, big endian
+ >4	belong	>-1		(%i words)
+ # really bellong 0x0000000070775631
+-4	belong	0x70775631	Cracklib password index, big endian ("64-bit")
++0	search/1	\0\0\0\0pwV1	Cracklib password index, big endian ("64-bit")
+ >12	belong	>0		(%i words)

+ 19 - 0
debian/patches/204-magic-update-elf.dpatch

@@ -0,0 +1,19 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 24-magic-update-elf.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: FIXME
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/elf file-4.20/magic/Magdir/elf
+--- file-4.20.orig/magic/Magdir/elf	2006-12-18 14:14:34.000000000 +0000
++++ file-4.20/magic/Magdir/elf	2007-03-27 12:23:14.000000000 +0000
+@@ -51,7 +51,7 @@
+ >>>>36  lelong&0xf0000000	0x20000000	MIPS-III
+ >>>>36  lelong&0xf0000000	0x30000000	MIPS-IV
+ >>>>36  lelong&0xf0000000	0x40000000	MIPS-V
+->>>>36  lelong&0xf0000000	0x60000000	MIPS32
++>>>>36  lelong&0xf0000000	0x5fffffff	MIPS32
+ >>>>36  lelong&0xf0000000	0x70000000	MIPS64
+ >>>>36  lelong&0xf0000000	0x80000000	MIPS32 rel2
+ >>>>36  lelong&0xf0000000	0x90000000	MIPS64 rel2

+ 105 - 0
debian/patches/205-magic-update-hp.dpatch

@@ -0,0 +1,105 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 25-magic-update-hp.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Updated HP 38/39/40/48/49 magic (closes: #326680).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/hp file-4.20/magic/Magdir/hp
+--- file-4.20.orig/magic/Magdir/hp	2003-02-08 18:30:39.000000000 +0000
++++ file-4.20/magic/Magdir/hp	2007-03-27 12:23:14.000000000 +0000
+@@ -203,33 +203,36 @@
+ >8	long		>0		%d messages
+ 
+ # addendum to /etc/magic with HP-48sx file-types by phk@data.fls.dk 1jan92
+-0	string		HPHP48-		HP48 binary
+->7	byte		>0		- Rev %c
+->8	beshort		0x1129		(ADR)
+->8	beshort		0x3329		(REAL)
+->8	beshort		0x5529		(LREAL)
+->8	beshort		0x7729		(COMPLX)
+->8	beshort		0x9d29		(LCOMPLX)
+->8	beshort		0xbf29		(CHAR)
+->8	beshort		0xe829		(ARRAY)
+->8	beshort		0x0a2a		(LNKARRAY)
+->8	beshort		0x2c2a		(STRING)
+->8	beshort		0x4e2a		(HXS)
+->8	beshort		0x742a		(LIST)
+->8	beshort		0x962a		(DIR)
+->8	beshort		0xb82a		(ALG)
+->8	beshort		0xda2a		(UNIT)
+->8	beshort		0xfc2a		(TAGGED)
+->8	beshort		0x1e2b		(GROB)
+->8	beshort		0x402b		(LIB)
+->8	beshort		0x622b		(BACKUP)
+->8	beshort		0x882b		(LIBDATA)
+->8	beshort		0x9d2d		(PROG)
+->8	beshort		0xcc2d		(CODE)
+->8	beshort		0x482e		(GNAME)
+->8	beshort		0x6d2e		(LNAME)
+->8	beshort		0x922e		(XLIB)
+-0	string		%%HP:		HP48 text
++0	string		HPHP4		HP
++>5	string		8		48 binary
++>5	string		9		49 binary
++>7	byte		>64		- Rev %c
++>8	leshort		0x2911		(ADR)
++>8	leshort		0x2933		(REAL)
++>8	leshort		0x2955		(LREAL)
++>8	leshort		0x2977		(COMPLX)
++>8	leshort		0x299d		(LCOMPLX)
++>8	leshort		0x29bf		(CHAR)
++>8	leshort		0x29e8		(ARRAY)
++>8	leshort		0x2a0a		(LNKARRAY)
++>8	leshort		0x2a2c		(STRING)
++>8	leshort		0x2a4e		(HXS)
++>8	leshort		0x2a74		(LIST)
++>8	leshort		0x2a96		(DIR)
++>8	leshort		0x2ab8		(ALG)
++>8	leshort		0x2ada		(UNIT)
++>8	leshort		0x2afc		(TAGGED)
++>8	leshort		0x2b1e		(GROB)
++>8	leshort		0x2b40		(LIB)
++>8	leshort		0x2b62		(BACKUP)
++>8	leshort		0x2b88		(LIBDATA)
++>8	leshort		0x2d9d		(PROG)
++>8	leshort		0x2dcc		(CODE)
++>8	leshort		0x2e48		(GNAME)
++>8	leshort		0x2e6d		(LNAME)
++>8	leshort		0x2e92		(XLIB)
++
++0	string		%%HP:		HP text
+ >6	string		T(0)		- T(0)
+ >6	string		T(1)		- T(1)
+ >6	string		T(2)		- T(2)
+@@ -240,6 +243,23 @@
+ >14	string		F(.)		F(.);
+ >14	string		F(,)		F(,);
+ 
++0	string		HP3		HP
++>3	string		8		38
++>3	string		9		39
++>4	string		Bin		binary
++>4	string		Asc		ASCII
++>7	string		A		(Directory List)
++>7	string		B		(Zaplet)
++>7	string		C		(Note)
++>7	string		D		(Program)
++>7	string		E		(Variable)
++>7	string		F		(List)
++>7	string		G		(Matrix)
++>7	string		H		(Library)
++>7	string		I		(Target List)
++>7	string		J		(ASCII Vector specification)
++>7	string		K		(wildcard)
++
+ # hpBSD magic numbers
+ 0	beshort		200		hp200 (68010) BSD
+ >2	beshort		0407		impure binary
+@@ -390,6 +410,3 @@
+ >>>>>>>>>0xC4	belong	33		- received SIGXCPU
+ >>>>>>>>>0xC4	belong	34		- received SIGXFSZ
+ 
+-# From: AMAKAWA Shuhei <sa264@cam.ac.uk>
+-0	string	HPHP49-			HP49 binary
+-

+ 29 - 0
debian/patches/206-magic-update-m4v.dpatch

@@ -0,0 +1,29 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 26-magic-update-m4v.dpatch by Nigel McNie <nigel@mcnie.name>
+##
+## DP: Detect m4v files as m4v instead of mp4 (Closes: #384018).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/animation file-4.20/magic/Magdir/animation
+--- file-4.20.orig/magic/Magdir/animation	2007-01-14 18:47:21.000000000 +0000
++++ file-4.20/magic/Magdir/animation	2007-03-27 15:42:27.000000000 +0000
+@@ -36,6 +36,7 @@
+ >8	string		mmp4		\b, MPEG v4 system, 3GPP Mobile
+ >8	string		avc1		\b, MPEG v4 system, 3GPP JVT AVC
+ >8	string/B	M4A		\b, MPEG v4 system, iTunes AAC-LC
++>8	string/B	M4V		\b, MPEG v4 system, iTunes AVC-LC
+ >8	string/B	M4P		\b, MPEG v4 system, iTunes AES encrypted
+ >8	string/B	M4B		\b, MPEG v4 system, iTunes bookmarked
+ >8	string/B	qt		\b, Apple QuickTime movie
+diff -Naur file-4.20.orig/magic/magic.mime file-4.20/magic/magic.mime
+--- file-4.20.orig/magic/magic.mime	2007-01-25 22:10:35.000000000 +0000
++++ file-4.20/magic/magic.mime	2007-03-27 15:42:27.000000000 +0000
+@@ -643,6 +643,7 @@
+ >8      string          avc1          video/3gpp
+ >8	string		mmp4	      video/mp4
+ >8	string/B	M4A	      audio/mp4
++>8	string/B	M4V	      video/mp4
+ >8	string/B	qt	      video/quicktime
+ # The contributor claims:
+ #   I couldn't find a real magic number for these, however, this

+ 21 - 0
debian/patches/207-magic-update-perl.dpatch

@@ -0,0 +1,21 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 27-magic-update-perl.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Make Perl script entries consistent (closes: #394523).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/perl file-4.20/magic/Magdir/perl
+--- file-4.20.orig/magic/Magdir/perl	2007-03-01 23:20:19.000000000 +0000
++++ file-4.20/magic/Magdir/perl	2007-03-27 12:23:14.000000000 +0000
+@@ -9,8 +9,8 @@
+ 0	string		eval\ "exec\ /bin/perl		perl script text
+ 0	string/b	#!\ /usr/bin/perl		perl script text executable
+ 0	string		eval\ "exec\ /usr/bin/perl	perl script text
+-0	string/b	#!\ /usr/local/bin/perl		perl script text
+-0	string		eval\ "exec\ /usr/local/bin/perl	perl script text executable
++0	string/b	#!\ /usr/local/bin/perl		perl script text executable
++0	string		eval\ "exec\ /usr/local/bin/perl	perl script text
+ 0	string		eval\ '(exit\ $?0)'\ &&\ eval\ 'exec	perl script text
+ 
+ 

+ 19 - 0
debian/patches/208-magic-update-sh.dpatch

@@ -0,0 +1,19 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 28-magic-update-sh.dpatch by Mark Hindley <mark@hindley.org.uk>
+##
+## DP: Changing sh identifier from Bourne to POSIX (Closes: #368613).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/commands file-4.20/magic/Magdir/commands
+--- file-4.20.orig/magic/Magdir/commands	2007-01-19 19:28:01.000000000 +0000
++++ file-4.20/magic/Magdir/commands	2007-03-27 15:48:37.000000000 +0000
+@@ -3,7 +3,7 @@
+ # commands:  file(1) magic for various shells and interpreters
+ #
+ 0	string		:			shell archive or script for antique kernel text
+-0	string/b	#!\ /bin/sh		Bourne shell script text executable
++0	string/b	#!\ /bin/sh		POSIX shell script text executable
+ 0	string/b	#!\ /bin/csh		C shell script text executable
+ # korn shell magic, sent by George Wu, gwu@clyde.att.com
+ 0	string/b	#!\ /bin/ksh		Korn shell script text executable

+ 33 - 0
debian/patches/209-magic-update-spectrum.dpatch

@@ -0,0 +1,33 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 29-magic-update-spectrum.dpatch by Philip Kendall <pak21@srcf.ucam.org>
+##
+## DP: Adding additional magics (Closes: #296202).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/spectrum file-4.20/magic/Magdir/spectrum
+--- file-4.20.orig/magic/Magdir/spectrum	2003-05-23 21:05:59.000000000 +0000
++++ file-4.20/magic/Magdir/spectrum	2007-03-27 16:55:24.000000000 +0000
+@@ -31,14 +31,19 @@
+ # TZX tape images
+ 0      string          ZXTape!\x1a     Spectrum .TZX data
+ >8     byte            x               version %d
+->9     byte            x               .%d
++>9     byte            x               \b.%d
+ 
+ # RZX input recording files
+ 0      string          RZX!            Spectrum .RZX data
+ >4     byte            x               version %d
+->5     byte            x               .%d
++>5     byte            x               \b.%d
+ 
+-# And three sorts of disk image
++# Floppy disk images
+ 0      string          MV\ -\ CPCEMU\ Disk-Fil Amstrad/Spectrum .DSK data
+ 0      string          MV\ -\ CPC\ format\ Dis Amstrad/Spectrum DU54 .DSK data
+ 0      string          EXTENDED\ CPC\ DSK\ Fil Amstrad/Spectrum Extended .DSK data
++0      string          SINCLAIR        Spectrum .SCL Betadisk image
++
++# Hard disk images
++0      string          RS-IDE\x1a      Spectrum .HDF hard disk image
++>7     byte            x               \b, version 0x%02x

+ 20 - 0
debian/patches/301-magic-add-adf.dpatch

@@ -0,0 +1,20 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 301-magic-add-adf.dpatch by Nicolas Chauvat <nicolas.chauvat@logilab.fr>
+##
+## DP: New magic for the CGNS Advnaced Data Format (Closes: #242644).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/database file-4.20/magic/Magdir/database
+--- file-4.20.orig/magic/Magdir/database	2007-01-22 06:40:00.000000000 +0000
++++ file-4.20/magic/Magdir/database	2007-03-27 17:29:50.000000000 +0000
+@@ -210,3 +210,9 @@
+ 16	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
+ 17	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
+ 18	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
++
++#----------------------------------------------------------------------
++# ADF: file(1) magic for Advanced Data Format (ADF) databases
++#
++# Computational Fluid Dynamics (see http://www.grc.nasa.gov/WWW/cgns/adf)
++>0	string		@(#)ADF\ Database	CGNS Advanced Data Format

+ 18 - 0
debian/patches/302-magic-add-ape.dpatch

@@ -0,0 +1,18 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 31-magic-add-ape.dpatch by Robert Millan <rmh@aybabtu.com>
+##
+## DP: New magic for the Monkey's audio format (Closes: #334862).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/audio file-4.20/magic/Magdir/audio
+--- file-4.20.orig/magic/Magdir/audio	2007-01-19 19:26:35.000000000 +0000
++++ file-4.20/magic/Magdir/audio	2007-03-27 16:22:03.000000000 +0000
+@@ -552,3 +552,7 @@
+ # http://download.ncl.ie/doc/api/ie/ncl/media/music/IMelody.html
+ # http://www.wx800.com/msg/download/irda/iMelody.pdf
+ 0	string	BEGIN:IMELODY	iMelody Ringtone Format
++
++# From: Robert Millan <rmh@aybabtu.com>
++# Monkey's Audio <http://www.monkeysaudio.com/>
++0	string	MAC\		Monkey's Audio file

+ 62 - 0
debian/patches/303-magic-add-clarion.dpatch

@@ -0,0 +1,62 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 302-magic-add-clarion.dpatch by Julien Blache <jblache@debian.org>
+##
+## DP: New magic for the Clarion files (Closes: #282680).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/clarion file-4.20/magic/Magdir/clarion
+--- file-4.20.orig/magic/Magdir/clarion	1970-01-01 00:00:00.000000000 +0000
++++ file-4.20/magic/Magdir/clarion	2007-03-27 17:07:02.000000000 +0000
+@@ -0,0 +1,29 @@
++#
++# Magic numbers for the Clarion Personal/Professional Developer (v2 and above) files
++#
++# Julien BLACHE <jb@jblache.org>
++#
++
++#### Database and associated files
++
++### Database files
++## signature
++0	leshort		0x3343	Clarion Personal/Professional Developer (v2 and above) data file
++## interesting attributes
++>2	leshort		&0x0001	\b, locked
++>2	leshort		&0x0004	\b, encrypted
++>2	leshort		&0x0008	\b, memo file exists
++>2	leshort		&0x0010	\b, compressed
++>2	leshort		&0x0040	\b, read only
++## number of records
++>5	lelong		x	\b, %ld records
++
++### Memo files
++0	leshort		0x334d	Clarion Personal/Professional Developer (v2 and above) memo data
++
++### Key/Index files
++## No magic ? :(
++
++
++#### Help files
++0	leshort		0x49e0	Clarion Personal/Professional Developer (v2 and above) help data
+diff -Naur file-4.20.orig/magic/Makefile.am file-4.20/magic/Makefile.am
+--- file-4.20.orig/magic/Makefile.am	2006-11-25 18:36:10.000000000 +0000
++++ file-4.20/magic/Makefile.am	2007-03-27 17:07:26.000000000 +0000
+@@ -60,6 +60,7 @@
+ Magdir/cisco \
+ Magdir/citrus \
+ Magdir/claris \
++Magdir/clarion \
+ Magdir/clipper \
+ Magdir/cracklib \
+ Magdir/spec \
+diff -Naur file-4.20.orig/magic/Makefile.in file-4.20/magic/Makefile.in
+--- file-4.20.orig/magic/Makefile.in	2007-03-01 23:21:09.000000000 +0000
++++ file-4.20/magic/Makefile.in	2007-03-27 17:07:32.000000000 +0000
+@@ -200,6 +200,7 @@
+ Magdir/cisco \
+ Magdir/citrus \
+ Magdir/claris \
++Magdir/clarion \
+ Magdir/clipper \
+ Magdir/cracklib \
+ Magdir/spec \

+ 45 - 0
debian/patches/304-magic-add-llvm.dpatch

@@ -0,0 +1,45 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 33-magic-add-llvm.dpatch by Al Stone <ahs3@debian.org>
+##
+## DP: New magic for the LLVM byte-codes (Closes: #293427).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/llvm file-4.20/magic/Magdir/llvm
+--- file-4.20.orig/magic/Magdir/llvm	1970-01-01 00:00:00.000000000 +0000
++++ file-4.20/magic/Magdir/llvm	2007-03-27 17:52:42.000000000 +0000
+@@ -0,0 +1,12 @@
++
++#------------------------------------------------------------------------------
++# llvm:  file(1) magic for LLVM byte-codes
++#
++# Send additions to Al Stone <ahs3@fc.hp.com>
++# Source: http://llvm.cs.uiuc.edu/docs/BytecodeFormat.html#signature
++#
++0	string	llvm	LLVM byte-codes, uncompressed
++0	string	llvc0	LLVM byte-codes, null compression
++0	string	llvc1	LLVM byte-codes, gzip compression
++0	string	llvc2	LLVM byte-codes, bzip2 compression
++
+diff -Naur file-4.20.orig/magic/Makefile.am file-4.20/magic/Makefile.am
+--- file-4.20.orig/magic/Makefile.am	2007-03-27 17:53:20.000000000 +0000
++++ file-4.20/magic/Makefile.am	2007-03-27 17:52:42.000000000 +0000
+@@ -115,6 +115,7 @@
+ Magdir/lif \
+ Magdir/linux \
+ Magdir/lisp \
++Magdir/llvm \
+ Magdir/mach \
+ Magdir/macintosh \
+ Magdir/magic \
+diff -Naur file-4.20.orig/magic/Makefile.in file-4.20/magic/Makefile.in
+--- file-4.20.orig/magic/Makefile.in	2007-03-27 17:53:20.000000000 +0000
++++ file-4.20/magic/Makefile.in	2007-03-27 17:52:42.000000000 +0000
+@@ -255,6 +255,7 @@
+ Magdir/lif \
+ Magdir/linux \
+ Magdir/lisp \
++Magdir/llvm \
+ Magdir/mach \
+ Magdir/macintosh \
+ Magdir/magic \

+ 60 - 0
debian/patches/305-magic-add-lua.dpatch

@@ -0,0 +1,60 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 32-magic-add-lua.dpatch by Reuben Thomas <rrt@sc3d.org>
+##
+## DP: New magic for the Lua scripting language (Closes: #394524).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/lua file-4.20/magic/Magdir/lua
+--- file-4.20.orig/magic/Magdir/lua	1970-01-01 00:00:00.000000000 +0000
++++ file-4.20/magic/Magdir/lua	2007-03-27 17:56:43.000000000 +0000
+@@ -0,0 +1,10 @@
++
++#------------------------------------------------------------------------------
++# lua:  file(1) magic for Lua
++#
++# From: Reuben Thomas <rrt@sc3d.org>
++0	string/b	#!\ /usr/bin/lua	Lua script text executable
++0	string/b	#!\ /usr/local/bin/lua	Lua script text executable
++0	string		#!/usr/bin/env\ lua	Lua script text executable
++0	string		#!\ /usr/bin/env\ lua	Lua script text executable
++
+diff -Naur file-4.20.orig/magic/Makefile.am file-4.20/magic/Makefile.am
+--- file-4.20.orig/magic/Makefile.am	2007-03-27 17:56:21.000000000 +0000
++++ file-4.20/magic/Makefile.am	2007-03-27 17:56:57.000000000 +0000
+@@ -116,6 +116,7 @@
+ Magdir/linux \
+ Magdir/lisp \
+ Magdir/llvm \
++Magdir/lua \
+ Magdir/mach \
+ Magdir/macintosh \
+ Magdir/magic \
+diff -Naur file-4.20.orig/magic/Makefile.in file-4.20/magic/Makefile.in
+--- file-4.20.orig/magic/Makefile.in	2007-03-27 17:56:21.000000000 +0000
++++ file-4.20/magic/Makefile.in	2007-03-27 17:57:03.000000000 +0000
+@@ -256,6 +256,7 @@
+ Magdir/linux \
+ Magdir/lisp \
+ Magdir/llvm \
++Magdir/lua \
+ Magdir/mach \
+ Magdir/macintosh \
+ Magdir/magic \
+diff -Naur file-4.20.orig/magic/magic.mime file-4.20/magic/magic.mime
+--- file-4.20.orig/magic/magic.mime	2007-03-27 17:56:21.000000000 +0000
++++ file-4.20/magic/magic.mime	2007-03-27 17:56:43.000000000 +0000
+@@ -288,6 +288,13 @@
+ 0       string          #!\ /usr/local/bin/perl         application/x-perl
+ 0       string          eval\ "exec\ /usr/local/bin/perl application/x-perl
+ 
++# For the Lua scripting language (http://www.lua.org/)
++# Reuben Thomas <rrt@sc3d.org>
++0	string/B	#!\ /usr/bin/lua		application/x-lua
++0	string/B	#!\ /usr/local/bin/lua		application/x-lua
++0	string		#!/usr/bin/env\ lua		application/x-lua
++0	string		#!\ /usr/bin/env\ lua		application/x-lua
++
+ #------------------------------------------------------------------------------
+ # compress:  file(1) magic for pure-compression formats (no archives)
+ #

+ 22 - 0
debian/patches/306-magic-add-lzma.dpatch

@@ -0,0 +1,22 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 33-magic-add-lzma.dpatch by Robert Millan <rmh@aybabtu.com>
+##
+## DP: New magic for the LZMA compression format (Closes: #364260).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/compress file-4.20/magic/Magdir/compress
+--- file-4.20.orig/magic/Magdir/compress	2006-03-02 22:10:26.000000000 +0000
++++ file-4.20/magic/Magdir/compress	2007-03-27 15:54:00.000000000 +0000
+@@ -174,6 +174,11 @@
+ >6	byte		x			version %d
+ >7	byte		x			\b.%d
+ 
++# LZMA (7-zip sister format)
++# http://www.7-zip.org/sdk.html
++#
++0	string		]\000\000\200\000\377\377\377\377\377\377\377\377	LZMA compressed data
++
+ # AFX compressed files (Wolfram Kleff)
+ 2	string		-afx-		AFX compressed file data
+ 

+ 30 - 0
debian/patches/307-magic-add-openrisc.dpatch

@@ -0,0 +1,30 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 34-magic-add-openrisc.dpatch by Robert Millan <rmh@aybabtu.com>
+##
+## DP: New magic for OpenRISC binary format (Closes: #316076).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/elf file-4.20/magic/Magdir/elf
+--- file-4.20.orig/magic/Magdir/elf	2006-12-18 14:14:34.000000000 +0000
++++ file-4.20/magic/Magdir/elf	2007-03-27 16:47:26.000000000 +0000
+@@ -99,6 +99,9 @@
+ >>18	leshort		62		x86-64,
+ >>18	leshort		75		Digital VAX,
+ >>18	leshort		88		Renesas M32R,
++>>18	leshort		92		OpenRISC,
++>>18	leshort		0x3426		OpenRISC (obsolete),
++>>18	leshort		0x8472		OpenRISC (obsolete),
+ >>18	leshort		94		Tensilica Xtensa,
+ >>18	leshort		97		NatSemi 32k,
+ >>18	leshort		0x9026		Alpha (unofficial),
+@@ -193,6 +196,9 @@
+ >>18	beshort		73		Cray NV1,
+ >>18	beshort		75		Digital VAX,
+ >>18	beshort		88		Renesas M32R,
++>>18	leshort		92		OpenRISC,
++>>18	leshort		0x3426		OpenRISC (obsolete),
++>>18	leshort		0x8472		OpenRISC (obsolete),
+ >>18	beshort		94		Tensilica Xtensa,
+ >>18	beshort		97		NatSemi 32k,
+ >>18	beshort		0x9026		Alpha (unofficial),

+ 19 - 0
debian/patches/308-magic-add-pe5.dpatch

@@ -0,0 +1,19 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 34-magic-add-pe5.dpatch by Simon Horman <horms@debian.org>
+##
+## DP: New magic for the Ulead Photo Explorer5 image format (Closes: #339397).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/images file-4.20/magic/Magdir/images
+--- file-4.20.orig/magic/Magdir/images	2007-01-19 19:31:46.000000000 +0000
++++ file-4.20/magic/Magdir/images	2007-03-27 16:14:16.000000000 +0000
+@@ -525,3 +525,8 @@
+ # Xara (for a while: Corel Xara) is a graphic package, see
+ # http://www.xara.com/ for Windows and as GPL application for
+ 0	string	XARA\243\243	Xara graphics file
++
++# From: Simon Horman <horms@debian.org>
++# Ulead Photo Explorer5 (.pe5)
++# Source: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
++0	string	IIO2H		Ulead Photo Explorer5

+ 17 - 0
debian/patches/309-magic-add-pmenu.dpatch

@@ -0,0 +1,17 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 309-magic-add-pmenu.dpatch by Edward Betts <edward@debian.org>
+##
+## DP: New magic for pmenu (Closes: #38543).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/commands file-4.20/magic/Magdir/commands
+--- file-4.20.orig/magic/Magdir/commands	2007-01-19 19:28:01.000000000 +0000
++++ file-4.20/magic/Magdir/commands	2007-03-27 17:40:20.000000000 +0000
+@@ -54,3 +54,6 @@
+ 0	string		Zend\x00		PHP script Zend Optimizer data
+ 
+ 0	string		$!			DCL command file
++
++# pdmenu
++0	string		#!/usr/bin/pdmenu	Pdmenu configuration file text

+ 18 - 0
debian/patches/310-magic-add-scummvm.dpatch

@@ -0,0 +1,18 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 308-magic-add-scummvm.dpatch by Sven Hartge <debian@ds9.argh.org>
+##
+## DP: New magic for scummVM savegame files (Closes: #263488).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/console file-4.20/magic/Magdir/console
+--- file-4.20.orig/magic/Magdir/console	2007-03-01 20:17:26.000000000 +0000
++++ file-4.20/magic/Magdir/console	2007-03-27 17:20:57.000000000 +0000
+@@ -168,3 +168,7 @@
+ # From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
+ 0	string		GBS		Nintendo Gameboy Music/Audio Data
+ 12	string		GameBoy\ Music\ Module	Nintendo Gameboy Music Module
++
++# From Sven Hartge <debian@ds9.argh.org>
++0	string		SCVM		scummVM savegame
++>12	string		>\0		"%s"

+ 24 - 0
debian/patches/311-magic-add-snes.dpatch

@@ -0,0 +1,24 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 35-magic-add-snes.dpatch by Josh Triplett <josh@freedesktop.org>
+##
+## DP: New magic for SNES SPC700 sound files (Closes: #410847).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/audio file-4.20/magic/Magdir/audio
+--- file-4.20.orig/magic/Magdir/audio	2007-01-19 19:26:35.000000000 +0000
++++ file-4.20/magic/Magdir/audio	2007-03-27 15:25:56.000000000 +0000
+@@ -268,6 +268,13 @@
+ >122	byte&0x1	=1		PAL
+ >122	byte&0x1	=0		NTSC
+ 
++# SNES SPC700 sound files
++>&0	string	0.30	\b, version %s
++>>0x23	byte	0x1B	\b, without ID666 tag
++>>0x23	byte	0x1A	\b, with ID666 tag
++>>>0x2E	string	>\0	\b, song "%.32s"
++>>>0x4E	string	>\0	\b, game "%.32s"
++
+ # Impulse tracker module (audio/x-it)
+ 0	string		IMPM		Impulse Tracker module sound data -
+ >4	string		>\0		"%s"

+ 20 - 0
debian/patches/312-magic-add-subversion.dpatch

@@ -0,0 +1,20 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 36-magic-add-subversion.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: New magic for SVN dumps (closes: #256652).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/revision file-4.20/magic/Magdir/revision
+--- file-4.20.orig/magic/Magdir/revision	2003-05-25 23:04:55.000000000 +0000
++++ file-4.20/magic/Magdir/revision	2007-03-27 12:23:14.000000000 +0000
+@@ -3,3 +3,9 @@
+ # file(1) magic for revision control files
+ # From Hendrik Scholz <hendrik@scholz.net>
+ 0   string /1\ :pserver:    cvs password text file
++
++
++# Subversion (SVN) dumps
++# Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
++0       string  SVN-fs-dump-format-version:     Subversion dumpfile
++>28     string  >\0                             (version: %s)

+ 20 - 0
debian/patches/313-magic-add-syslinux.dpatch

@@ -0,0 +1,20 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 37-magic-add-syslinux.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: FIXME
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/Magdir/images file-4.20/magic/Magdir/images
+--- file-4.20.orig/magic/Magdir/images	2007-03-27 17:58:55.000000000 +0000
++++ file-4.20/magic/Magdir/images	2007-03-27 17:59:58.000000000 +0000
+@@ -527,3 +527,9 @@
+ # Ulead Photo Explorer5 (.pe5)
+ # Source: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
+ 0	string	IIO2H		Ulead Photo Explorer5
++
++# The boot loaders syslinux and isolinux use a RLE based image format
++# called SLL16 to store splash screens.
++0	lelong	0x1413f33d	Syslinux SLL16 image data,
++>4	leshort	>0		%hd x
++>6	leshort	>0		%hd

+ 52 - 0
debian/patches/901-file-elf.dpatch

@@ -0,0 +1,52 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 91-file-elf.dpatch by Alessandro Rubini <rubini@gnudd.com>
+##
+## DP: Revert ELF file-reading (closes: #345089).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/src/readelf.c file-4.20/src/readelf.c
+--- file-4.20.orig/src/readelf.c	2007-01-18 05:45:35.000000000 +0000
++++ file-4.20/src/readelf.c	2007-03-27 12:23:14.000000000 +0000
+@@ -907,29 +915,30 @@
+ 	off_t fsize;
+ 	int flags = 0;
+ 
+-	/*
+-	 * If we cannot seek, it must be a pipe, socket or fifo.
+-	 */
+-	if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
+-		fd = file_pipe2file(ms, fd, buf, nbytes);
+-
+-	if (fstat(fd, &st) == -1) {
+-  		file_badread(ms);
+-		return -1;
+-	}
+-	fsize = st.st_size;
+ 
+ 	/*
+ 	 * ELF executables have multiple section headers in arbitrary
+ 	 * file locations and thus file(1) cannot determine it from easily.
+ 	 * Instead we traverse thru all section headers until a symbol table
+ 	 * one is found or else the binary is stripped.
++	 * Return immediately if it's not ELF (so we avoid pipe2file unless needed).
+ 	 */
+ 	if (buf[EI_MAG0] != ELFMAG0
+ 	    || (buf[EI_MAG1] != ELFMAG1 && buf[EI_MAG1] != OLFMAG1)
+ 	    || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
+ 	    return 0;
+ 
++	/*
++	 * If we cannot seek, it must be a pipe, socket or fifo.
++	 */
++	if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
++		fd = file_pipe2file(ms, fd, buf, nbytes);
++
++	if (fstat(fd, &st) == -1) {
++  		file_badread(ms);
++		return -1;
++	}
++	fsize = st.st_size;
+ 
+ 	class = buf[EI_CLASS];
+ 

+ 36 - 0
debian/patches/902-file-kfreebsd.dpatch

@@ -0,0 +1,36 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 92-file-kfreebsd.dpatch by Robert Millan <rmh@aybabtu.com>
+##
+## DP: Detect GNU/kFreeBSD binaries (closes: #307475).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/src/readelf.c file-4.20/src/readelf.c
+--- file-4.20.orig/src/readelf.c	2007-01-18 05:45:35.000000000 +0000
++++ file-4.20/src/readelf.c	2007-03-27 12:23:14.000000000 +0000
+@@ -396,6 +396,14 @@
+ 			if (file_printf(ms, "Solaris") == -1)
+ 				return size;
+ 			break;
++		case GNU_OS_KFREEBSD:
++			if (file_printf(ms, "kFreeBSD") == -1)
++				return size;
++			break;
++		case GNU_OS_KNETBSD:
++			if (file_printf(ms, "kNetBSD") == -1)
++				return size;
++			break;
+ 		default:
+ 			if (file_printf(ms, "<unknown>") == -1)
+ 				return size; 
+diff -Naur file-4.20.orig/src/readelf.h file-4.20/src/readelf.h
+--- file-4.20.orig/src/readelf.h	2007-01-12 17:40:53.000000000 +0000
++++ file-4.20/src/readelf.h	2007-03-27 12:23:14.000000000 +0000
+@@ -232,5 +232,7 @@
+ #define GNU_OS_LINUX	0
+ #define GNU_OS_HURD	1
+ #define GNU_OS_SOLARIS	2
++#define GNU_OS_KFREEBSD	3
++#define GNU_OS_KNETBSD	4
+ 
+ #endif

+ 52 - 0
debian/patches/903-file-localmagic.dpatch

@@ -0,0 +1,52 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 93-magic-local.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: No longer includes Localstuff in /usr/share/misc/magic. Local definitions
+## DP: should go to /etc/magic.
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/magic.local file-4.20/magic/magic.local
+--- file-4.20.orig/magic/magic.local	1970-01-01 00:00:00.000000000 +0000
++++ file-4.20/magic/magic.local	2007-03-27 12:23:14.000000000 +0000
+@@ -0,0 +1,3 @@
++# Magic local data for file(1) command.
++# Insert here your local magic data. Format is described in magic(5).
++
+diff -Naur file-4.20.orig/src/Makefile.am file-4.20/src/Makefile.am
+--- file-4.20.orig/src/Makefile.am	2007-01-12 17:40:53.000000000 +0000
++++ file-4.20/src/Makefile.am	2007-03-27 12:23:14.000000000 +0000
+@@ -5,7 +5,7 @@
+ 
+ bin_PROGRAMS = file
+ 
+-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
++AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
+ 
+ libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
+ 	compress.c is_tar.c readelf.c print.c fsmagic.c \
+diff -Naur file-4.20.orig/src/Makefile.in file-4.20/src/Makefile.in
+--- file-4.20.orig/src/Makefile.in	2007-03-01 23:21:09.000000000 +0000
++++ file-4.20/src/Makefile.in	2007-03-27 12:23:14.000000000 +0000
+@@ -196,7 +196,7 @@
+ lib_LTLIBRARIES = libmagic.la
+ include_HEADERS = magic.h
+ EXTRA_DIST = test.c
+-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
++AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
+ libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
+ 	compress.c is_tar.c readelf.c print.c fsmagic.c \
+ 	funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c
+diff -Naur file-4.20.orig/magic/Header file-4.20/magic/Header
+--- file-4.20.orig/magic/Header	2000-08-05 17:36:46.000000000 +0000
++++ file-4.20/magic/Header	2007-03-27 12:23:14.000000000 +0000
+@@ -1,5 +1,5 @@
+-# Magic
+ # Magic data for file(1) command.
+-# Machine-generated from src/cmd/file/magdir/*; edit there only!
+-# Format is described in magic(files), where:
+-# files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID.
++# Format is described in magic(5).
++# Don't edit this file, edit /etc/magic or send your suggested inclusions to
++# this file as a wishlist bug against file (using the reportbug utility).
++

+ 19 - 0
debian/patches/904-file-make.dpatch

@@ -0,0 +1,19 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 94-file-make.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: FIXME
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/src/Makefile.in file-4.20/src/Makefile.in
+--- file-4.20.orig/src/Makefile.in	2007-03-01 23:21:09.000000000 +0000
++++ file-4.20/src/Makefile.in	2007-03-27 12:23:14.000000000 +0000
+@@ -296,7 +296,7 @@
+ 	done
+ file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) 
+ 	@rm -f file$(EXEEXT)
+-	$(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD) $(LIBS)
++	$(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD)
+ 
+ mostlyclean-compile:
+ 	-rm -f *.$(OBJEXT)

+ 140 - 0
debian/patches/998-doc-manpages.dpatch

@@ -0,0 +1,140 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 95-doc-manpages.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: FIXME
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/doc/file.man file-4.20/doc/file.man
+--- file-4.20.orig/doc/file.man	2007-01-25 21:05:46.000000000 +0000
++++ file-4.20/doc/file.man	2007-03-27 12:23:14.000000000 +0000
+@@ -47,9 +47,8 @@
+ or non-printable).
+ Exceptions are well-known file formats (core files, tar archives)
+ that are known to contain binary data.
+-When modifying the file
+-.Pa __MAGIC__
+-or the program itself, make sure to
++When adding local definitions to
++.Pa /etc/magic ,
+ .Em "preserve these keywords" .
+ People depend on knowing that all the readable files in a directory
+ have the word 
+@@ -99,12 +98,14 @@
+ has been applied by extension to data files.
+ Any file with some invariant identifier at a small fixed
+ offset into the file can usually be described in this way.
+-The information identifying these files is read from the compiled
++The information identifying these files is read from
++.Pa /etc/magic
++and the compiled
+ magic file
+ .Pa __MAGIC__.mgc ,
+ or 
+ .Pa __MAGIC__
+-if the compile file does not exist. In addition
++if the compiled file does not exist. In addition
+ .Nm
+ will look in
+ .Pa $HOME/.magic.mgc ,
+@@ -161,7 +162,8 @@
+ archives).
+ .Pp
+ Any file that cannot be identified as having been written
+-in any of the character sets listed above is simply said to be ``data''.
++in any of the character sets listed above is simply said to be
++.Dq data .
+ .Sh OPTIONS
+ .Bl -tag -width indent
+ .It Fl b , -brief
+@@ -239,7 +241,12 @@
+ .Dq FILES
+ section, below).
+ .It Fl k , -keep-going
+-Don't stop at the first match, keep going.
++Don't stop at the first match, keep going. Subsequent matches will be
++prepended by
++.Dq "\[rs]012\- ".
++(If you want a newline, see 
++.Dq "\-r"
++option.)
+ .It Fl L , -dereference
+ option causes symlinks to be followed, as the like-named option in
+ .Xr ls 1
+@@ -252,7 +259,8 @@
+ This can be a single file, or a colon-separated list of files.
+ If a compiled magic file is found alongside, it will be used instead.
+ With the 
+-.Fl i or 
++.Fl i
++or 
+ .Fl "mime"
+ option, the program adds
+ .Dq .mime
+@@ -339,6 +347,11 @@
+ and/or
+ .Dq .mgc
+ to the value of this variable as appropriate.
++However,
++.Pa file
++has to exist in order for
++.Pa file.mime
++to be considered.
+ The environment variable
+ .Dv POSIXLY_CORRECT
+ controls (on systems that support symbolic links), if
+@@ -413,12 +426,6 @@
+ The order of entries in the magic file is significant.
+ Depending on what system you are using, the order that
+ they are put together may be incorrect.
+-If your old
+-.Nm
+-command uses a magic file,
+-keep the old magic file around for comparison purposes
+-(rename it to 
+-.Pa __MAGIC__.orig ).
+ .Sh EXAMPLES
+ .Bd -literal -offset indent 
+ $ file file.c file /dev/{wd0a,hda}
+@@ -586,9 +593,17 @@
+ The new support for multiple character codes makes it even slower.
+ .Pp
+ This manual page, and particularly this section, is too long.
++.Sh RETURN CODE
++.Nm
++almost always returns 0. It returns a different code if it cannot open a file.
+ .Sh AVAILABILITY
+ You can obtain the original author's latest version by anonymous FTP
+ on
+ .Dv ftp.astron.com
+ in the directory
+ .Dv /pub/file/file-X.YZ.tar.gz
++.Pp
++This Debian version adds a number of new magix entries. It can be
++obtained from every site carrying a Debian distribution (that is
++.Dv ftp.debian.org
++and mirrors).
+diff -Naur file-4.20.orig/doc/libmagic.man file-4.20/doc/libmagic.man
+--- file-4.20.orig/doc/libmagic.man	2007-01-25 21:04:08.000000000 +0000
++++ file-4.20/doc/libmagic.man	2007-03-27 12:23:14.000000000 +0000
+@@ -39,7 +39,7 @@
+ .Nm magic_load
+ .Nd Magic number recognition library.
+ .Sh LIBRARY
+-.Lb libmagic
++.Lb libmagic1
+ .Sh SYNOPSIS
+ .In magic.h
+ .Ft magic_t
+diff -Naur file-4.20.orig/doc/magic.man file-4.20/doc/magic.man
+--- file-4.20.orig/doc/magic.man	2007-01-12 17:38:27.000000000 +0000
++++ file-4.20/doc/magic.man	2007-03-27 12:23:14.000000000 +0000
+@@ -65,7 +65,7 @@
+ .Dq c
+ flag, specifies case insensitive matching: lowercase
+ characters in the magic match both lower and upper case characters in the
+-targer, whereas upper case characters in the magic, only much uppercase
++target, whereas upper case characters in the magic, only much uppercase
+ characters in the target.
+ .It Dv pstring
+ A pascal style string where the first byte is interpreted as the an

+ 161 - 0
debian/patches/999-conglomeration.dpatch

@@ -0,0 +1,161 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 99-conglomeration.dpatch by Michael Piefel <piefel@debian.org>
+##
+## DP: Needs to be broken out (FIXME).
+
+@DPATCH@
+
+diff -Naur file-4.20.orig/magic/magic.mime file-4.20/magic/magic.mime
+--- file-4.20.orig/magic/magic.mime	2007-01-25 22:10:35.000000000 +0000
++++ file-4.20/magic/magic.mime	2007-03-27 12:23:14.000000000 +0000
+@@ -156,9 +156,7 @@
+ 
+ # Creative Labs AUDIO stuff
+ #					Standard MIDI data
+-0	string	MThd			audio/unknown
+-#>9 	byte	>0			(format %d)
+-#>11	byte	>1			using %d channels
++0	string	MThd			audio/midi
+ #					Creative Music (CMF) data
+ 0	string	CTMF			audio/unknown
+ #					SoundBlaster instrument data
+@@ -273,7 +271,7 @@
+ 0       string          #!/usr/bin/awk          application/x-awk
+ 0       string          #!\ /usr/bin/awk        application/x-awk
+ # update to distinguish from *.vcf files by Joerg Jenderek: joerg dot jenderek at web dot de
+-0	regex		BEGIN[[:space:]]*[{]	application/x-awk
++#0	regex		BEGIN[[:space:]]*[{]	application/x-awk
+ 
+ # For Larry Wall's perl language.  The ``eval'' line recognizes an
+ # outrageously clever hack for USG systems.
+@@ -298,7 +296,7 @@
+ # because it tries to uncompress it to figure out what's inside.
+ 
+ # standard unix compress
+-0	string		\037\235	application/x-compress
++#0	string		\037\235	application/x-compress
+ 
+ # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
+ 0       string          \037\213        application/x-gzip
+@@ -400,18 +398,15 @@
+ #------------------------------------------------------------------------------
+ # html:  file(1) magic for HTML (HyperText Markup Language) docs
+ #
+-# from Daniel Quinlan <quinlan@yggdrasil.com>
++# from Michael Piefel <piefel@debian.org>
+ #
+-0	string		\<HEAD	text/html
+-0	string		\<head	text/html
+-0	string		\<TITLE	text/html
+-0	string		\<title	text/html
+-0       string          \<html	text/html
+-0       string          \<HTML	text/html
++0	string/cB	\<!DOCTYPE\ html	text/html
++0	string/cb	\<head	text/html
++0	string/cb	\<title	text/html
++0       string/bc	\<html	text/html
+ 0	string		\<!--	text/html
+-0	string		\<h1	text/html
+-0	string		\<H1	text/html
+-0	string/c	\<!doctype\ html	text/html
++0	string/c	\<h1	text/html
++
+ 
+ #------------------------------------------------------------------------------
+ # images:  file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
+@@ -474,7 +469,7 @@
+ 0	beshort		0xffd8		image/jpeg
+ 
+ # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
+-0	string		BM		image/bmp
++0	string		BM		image/x-ms-bmp
+ #>14	byte		12		(OS/2 1.x format)
+ #>14	byte		64		(OS/2 2.x format)
+ #>14	byte		40		(Windows 3.x format)
+@@ -706,8 +701,10 @@
+ #------------------------------------------------------------------------------
+ # Hierarchical Data Format, used to facilitate scientific data exchange
+ # specifications at http://hdf.ncsa.uiuc.edu/
+-0	belong		0x0e031301	Hierarchical Data Format (version 4) data
+-0	string		\211HDF\r\n\032	Hierarchical Data Format (version 5) data
++#Hierarchical Data Format (version 4) data
++0	belong		0x0e031301		application/x-hdf
++#Hierarchical Data Format (version 5) data
++0	string		\211HDF\r\n\032		application/x-hdf
+ 
+ # Adobe Photoshop
+ 0	string		8BPS			image/x-photoshop
+@@ -777,21 +774,25 @@
+ # Debian has entries for the old PGP formats:
+ # pgp:  file(1) magic for Pretty Good Privacy
+ # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
+-0       beshort         0x9900                  text/PGP key public ring
+-0       beshort         0x9501                  text/PGP key security ring
+-0       beshort         0x9500                  text/PGP key security ring
+-0       beshort         0xa600                  text/PGP encrypted data
+-0       string          -----BEGIN\040PGP       text/PGP armored data
+->15     string          PUBLIC\040KEY\040BLOCK- public key block
+->15     string          MESSAGE-                message
+->15     string          SIGNED\040MESSAGE-      signed message
+->15     string          PGP\040SIGNATURE-       signature
+-0       beshort         0x8501                  data
++#text/PGP key public ring
++0	beshort		0x9900			application/pgp
++#text/PGP key security ring
++0	beshort		0x9501			application/pgp
++#text/PGP key security ring
++0	beshort		0x9500			application/pgp
++#text/PGP encrypted data
++0	beshort		0xa600			application/pgp-encrypted
++#text/PGP armored data
++##public key block
++2	string	---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK-	application/pgp-keys
++0	string	-----BEGIN\040PGP\40MESSAGE-			application/pgp
++0	string	-----BEGIN\040PGP\40SIGNATURE-			application/pgp-signature
+ #
+ # GnuPG Magic:
+-#
+-0       beshort         0x9901                  text/GnuPG key public ring
+-0       beshort         0x8501                  text/OpenPGP data
++#text/GnuPG key public ring
++0	beshort		0x9901			application/pgp
++#text/OpenPGP data
++0	beshort		0x8501			application/pgp-encrypted	
+ 
+ # flash:        file(1) magic for Macromedia Flash file format
+ #
+@@ -951,3 +952,9 @@
+ 
+ # 
+ 128	string		DICM		application/dicom
++
++# Gnumeric spreadsheet
++# This entry is only semi-helpful, as Gnumeric compresses its files, so
++# they will ordinarily reported as "compressed", but at least -z helps
++39      string          =<gmr:Workbook           application/x-gnumeric
++
+diff -Naur file-4.20.orig/src/file.c file-4.20/src/file.c
+--- file-4.20.orig/src/file.c	2007-01-25 21:05:46.000000000 +0000
++++ file-4.20/src/file.c	2007-03-27 12:23:14.000000000 +0000
+@@ -352,7 +352,7 @@
+ 	}
+ 
+ 	magic_close(magic);
+-	return 0;
++	return magic->haderr ? -1 : 0;
+ }
+ 
+ 
+diff -Naur file-4.20.orig/src/fsmagic.c file-4.20/src/fsmagic.c
+--- file-4.20.orig/src/fsmagic.c	2007-01-12 17:40:53.000000000 +0000
++++ file-4.20/src/fsmagic.c	2007-03-27 12:23:14.000000000 +0000
+@@ -92,7 +92,8 @@
+ 		if (file_printf(ms, "cannot open `%s' (%s)",
+ 		    fn, strerror(errno)) == -1)
+ 			return -1;
+-		return 1;
++		ms->haderr++;
++		return -1;
+ 	}
+ 
+ 	if ((ms->flags & MAGIC_MIME) != 0) {