Use system magic file for file classification.

- use whatever magic_load() uses by default
- remove unused rpm.magic file
This commit is contained in:
Panu Matilainen 2007-08-27 11:17:03 +03:00
parent de9061b214
commit 646d09ef9b
3 changed files with 3 additions and 27 deletions

View File

@ -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

View File

@ -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. */
}

View File

@ -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