Blame SOURCES/file-localmagic.patch

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