Blame SOURCES/file-localmagic.patch

89be67
From f25107f625e88726e8ae9d4963573b5a0dda8f4c Mon Sep 17 00:00:00 2001
89be67
From: Jan Kaluza <hanzz.k@gmail.com>
89be67
Date: Thu, 15 Dec 2011 16:15:41 +0100
89be67
Subject: [PATCH] localmagic
89be67
89be67
---
89be67
 src/Makefile.am |    2 +-
89be67
 src/Makefile.in |    2 +-
89be67
 2 files changed, 2 insertions(+), 2 deletions(-)
89be67
89be67
diff --git a/src/Makefile.am b/src/Makefile.am
89be67
index cba64ac..5e48dff 100644
89be67
--- a/src/Makefile.am
89be67
+++ b/src/Makefile.am
89be67
@@ -1,4 +1,4 @@
89be67
-MAGIC = $(pkgdatadir)/magic
89be67
+MAGIC = /etc/magic:$(pkgdatadir)/magic
89be67
 lib_LTLIBRARIES = libmagic.la
89be67
 include_HEADERS = magic.h
89be67
 
89be67
diff --git a/magic/magic.local b/magic/magic.local
89be67
new file mode 100644
89be67
index 0000000..283a863
89be67
--- /dev/null
89be67
+++ b/magic/magic.local
89be67
@@ -0,0 +1,3 @@
89be67
+# Magic local data for file(1) command.
89be67
+# Insert here your local magic data. Format is described in magic(5).
89be67
+
89be67
 
89be67
diff --git a/src/Makefile.in b/src/Makefile.in
89be67
index 39b1703..3dd92d8 100644
89be67
--- a/src/Makefile.in
89be67
+++ b/src/Makefile.in
89be67
@@ -240,7 +240,7 @@ target_alias = @target_alias@
89be67
 top_build_prefix = @top_build_prefix@
89be67
 top_builddir = @top_builddir@
89be67
 top_srcdir = @top_srcdir@
89be67
-MAGIC = $(pkgdatadir)/magic
89be67
+MAGIC = /etc/magic:$(pkgdatadir)/magic
89be67
 lib_LTLIBRARIES = libmagic.la
89be67
 include_HEADERS = magic.h
89be67
 AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
89be67
diff --git a/src/apprentice.c b/src/apprentice.c
89be67
index b330669..0490642 100644
89be67
--- a/src/apprentice.c
89be67
+++ b/src/apprentice.c
89be67
@@ -281,7 +281,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action,
89be67
 
89be67
 #ifndef COMPILE_ONLY
89be67
 	if ((rv = apprentice_map(ms, &magic, &nmagic, fn)) == -1) {
89be67
-		if (ms->flags & MAGIC_CHECK)
89be67
+		if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
89be67
 			file_magwarn(ms, "using regular magic file `%s'", fn);
89be67
 		rv = apprentice_load(ms, &magic, &nmagic, fn, action);
89be67
 		if (rv != 0)
89be67
89be67
-- 
89be67
1.7.7.4
89be67