From 646d09ef9b949d5cb03f9e844d9572823541e179 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 27 Aug 2007 11:17:03 +0300 Subject: [PATCH] Use system magic file for file classification. - use whatever magic_load() uses by default - remove unused rpm.magic file --- Makefile.am | 3 +-- build/rpmfc.c | 6 ++---- rpm.magic | 21 --------------------- 3 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 rpm.magic diff --git a/Makefile.am b/Makefile.am index c52eb587c..ef66b34dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,8 +4,7 @@ LINT = splint EXTRA_DIST = CHANGES ChangeLog CREDITS Doxyheader GROUPS INSTALL \ autodeps autogen.sh \ - config.site db db3/configure installplatform platform* \ - rpm.magic + config.site db db3/configure installplatform platform* SUBDIRS = po misc @WITH_DB_SUBDIR@ lua rpmio rpmdb lib build python tools scripts doc . tests diff --git a/build/rpmfc.c b/build/rpmfc.c index 0017af335..42525645a 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -1227,7 +1227,6 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv, int_16 * fmode) int fcolor; int xx; /*@observer@*/ - static const char * magicfile = "/usr/lib/rpm/magic"; int msflags = MAGIC_CHECK; /* XXX MAGIC_COMPRESS flag? */ magic_t ms = NULL; @@ -1252,11 +1251,10 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv, int_16 * fmode) assert(ms != NULL); /* XXX figger a proper return path. */ } - xx = magic_load(ms, magicfile); + xx = magic_load(ms, NULL); if (xx == -1) { xx = RPMERR_EXEC; - rpmError(xx, _("magic_load(ms, \"%s\") failed: %s\n"), - magicfile, magic_error(ms)); + rpmError(xx, _("magic_load failed: %s\n"), magic_error(ms)); assert(xx != -1); /* XXX figger a proper return path. */ } diff --git a/rpm.magic b/rpm.magic deleted file mode 100644 index 01a9b5483..000000000 --- a/rpm.magic +++ /dev/null @@ -1,21 +0,0 @@ -#------------------------------------------------------------------------------ -# -# RPM: file(1) magic for Red Hat Packages -# -0 beshort 0xedab ->2 beshort 0xeedb RPM ->>4 byte x v%d ->>6 beshort 0 bin ->>6 beshort 1 src ->>8 beshort 1 i386 ->>8 beshort 2 Alpha ->>8 beshort 3 Sparc ->>8 beshort 4 MIPS big endian ->>8 beshort 5 PowerPC ->>8 beshort 6 68000 ->>8 beshort 7 SGI ->>8 beshort 8 RS6000 ->>8 beshort 10 Sparc 64bit ->>8 beshort 11 MIPS little endian ->>8 beshort 12 ARM ->>10 string x %s