0001-file-localmagic.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Description:
  2. No longer includes Localstuff in /usr/share/misc/magic, local definitions
  3. should go to /etc/magic.
  4. Author:
  5. Michael Piefel <piefel@debian.org>,
  6. Judit Foglszinger <fgrfgr@freenet.de>
  7. Forwarded: no
  8. Last-Update: 2015-08-23
  9. --- a/magic/Header
  10. +++ b/magic/Header
  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. --- /dev/null
  22. +++ b/magic/magic.local
  23. @@ -0,0 +1,3 @@
  24. +# Magic local data for file(1) command.
  25. +# Insert here your local magic data. Format is described in magic(5).
  26. +
  27. --- a/src/apprentice.c
  28. +++ b/src/apprentice.c
  29. @@ -450,7 +450,7 @@
  30. #ifndef COMPILE_ONLY
  31. map = apprentice_map(ms, fn);
  32. if (map == NULL) {
  33. - if (ms->flags & MAGIC_CHECK)
  34. + if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
  35. file_magwarn(ms, "using regular magic file `%s'", fn);
  36. map = apprentice_load(ms, fn, action);
  37. if (map == NULL)
  38. --- a/src/Makefile.am
  39. +++ b/src/Makefile.am
  40. @@ -4,7 +4,7 @@
  41. bin_PROGRAMS = file
  42. -AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
  43. +AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
  44. AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@
  45. libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
  46. --- a/src/Makefile.in
  47. +++ b/src/Makefile.in
  48. @@ -341,7 +341,7 @@
  49. MAGIC = $(pkgdatadir)/magic
  50. lib_LTLIBRARIES = libmagic.la
  51. include_HEADERS = magic.h
  52. -AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
  53. +AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
  54. AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@
  55. libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
  56. encoding.c compress.c is_tar.c readelf.c print.c fsmagic.c \