0001-file-localmagic.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. --- a/magic/Header
  8. +++ b/magic/Header
  9. @@ -1,5 +1,6 @@
  10. # Magic data for file(1) command.
  11. -# Format is described in magic(files), where:
  12. -# files is 5 on V7 and BSD, 4 on SV, and ?? on SVID.
  13. +# Format is described in in magic(5).
  14. # Don't edit this file, edit /etc/magic or send your magic improvements
  15. -# to the maintainers, at file@mx.gw.com
  16. +# to the upstream maintainers, at file@mx.gw.com
  17. +# or send your suggested inclusions
  18. +# as a wishlist bug against file (using the reportbug utility).
  19. --- /dev/null
  20. +++ b/magic/magic.local
  21. @@ -0,0 +1,3 @@
  22. +# Magic local data for file(1) command.
  23. +# Insert here your local magic data. Format is described in magic(5).
  24. +
  25. --- a/src/apprentice.c
  26. +++ b/src/apprentice.c
  27. @@ -448,7 +448,7 @@
  28. #ifndef COMPILE_ONLY
  29. map = apprentice_map(ms, fn);
  30. if (map == NULL) {
  31. - if (ms->flags & MAGIC_CHECK)
  32. + if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
  33. file_magwarn(ms, "using regular magic file `%s'", fn);
  34. map = apprentice_load(ms, fn, action);
  35. if (map == NULL)
  36. --- a/src/Makefile.am
  37. +++ b/src/Makefile.am
  38. @@ -4,7 +4,7 @@
  39. bin_PROGRAMS = file
  40. -AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
  41. +AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
  42. AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@
  43. libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
  44. --- a/src/Makefile.in
  45. +++ b/src/Makefile.in
  46. @@ -329,7 +329,7 @@
  47. MAGIC = $(pkgdatadir)/magic
  48. lib_LTLIBRARIES = libmagic.la
  49. include_HEADERS = magic.h
  50. -AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
  51. +AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
  52. AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@
  53. libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
  54. encoding.c compress.c is_tar.c readelf.c print.c fsmagic.c \