0001-file-localmagic.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. Authors:
  2. Michael Piefel <piefel@debian.org>,
  3. Judit Foglszinger <fgrfgr@freenet.de>
  4. Description:
  5. No longer includes Localstuff in /usr/share/misc/magic, local definitions
  6. should go to /etc/magic.
  7. Index: file-5.14/magic/Header
  8. ===================================================================
  9. --- file-5.14.orig/magic/Header 2010-12-15 03:06:49.000000000 +0000
  10. +++ file-5.14/magic/Header 2013-05-06 17:41:20.000000000 +0000
  11. @@ -1,5 +1,6 @@
  12. # Magic data for file(1) command.
  13. -# Format is described in magic(files), where:
  14. -# files is 5 on V7 and BSD, 4 on SV, and ?? on SVID.
  15. +# Format is described in in magic(5).
  16. # Don't edit this file, edit /etc/magic or send your magic improvements
  17. -# to the maintainers, at file@mx.gw.com
  18. +# to the upstream maintainers, at file@mx.gw.com
  19. +# or send your suggested inclusions
  20. +# as a wishlist bug against file (using the reportbug utility).
  21. Index: file-5.14/magic/magic.local
  22. ===================================================================
  23. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  24. +++ file-5.14/magic/magic.local 2013-05-06 17:41:20.000000000 +0000
  25. @@ -0,0 +1,3 @@
  26. +# Magic local data for file(1) command.
  27. +# Insert here your local magic data. Format is described in magic(5).
  28. +
  29. Index: file-5.14/src/apprentice.c
  30. ===================================================================
  31. --- file-5.14.orig/src/apprentice.c 2013-03-21 17:45:14.000000000 +0000
  32. +++ file-5.14/src/apprentice.c 2013-05-06 17:41:20.000000000 +0000
  33. @@ -419,7 +419,7 @@
  34. #ifndef COMPILE_ONLY
  35. map = apprentice_map(ms, fn);
  36. if (map == NULL) {
  37. - if (ms->flags & MAGIC_CHECK)
  38. + if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
  39. file_magwarn(ms, "using regular magic file `%s'", fn);
  40. map = apprentice_load(ms, fn, action);
  41. if (map == NULL)
  42. Index: file-5.14/src/Makefile.am
  43. ===================================================================
  44. --- file-5.14.orig/src/Makefile.am 2013-03-21 17:45:14.000000000 +0000
  45. +++ file-5.14/src/Makefile.am 2013-05-06 17:41:20.000000000 +0000
  46. @@ -4,7 +4,7 @@
  47. bin_PROGRAMS = file
  48. -AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
  49. +AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
  50. AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@
  51. libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
  52. Index: file-5.14/src/Makefile.in
  53. ===================================================================
  54. --- file-5.14.orig/src/Makefile.in 2013-03-21 17:51:39.000000000 +0000
  55. +++ file-5.14/src/Makefile.in 2013-05-06 17:41:20.000000000 +0000
  56. @@ -282,7 +282,7 @@
  57. MAGIC = $(pkgdatadir)/magic
  58. lib_LTLIBRARIES = libmagic.la
  59. include_HEADERS = magic.h
  60. -AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
  61. +AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
  62. AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@
  63. libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
  64. encoding.c compress.c is_tar.c readelf.c print.c fsmagic.c \