0001-file-localmagic.patch 2.3 KB

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