--- rpm-4.4.9/rpmio/macro.c.old 2007-11-10 10:29:08.000000000 +0100 +++ rpm-4.4.9/rpmio/macro.c 2007-11-10 10:37:25.000000000 +0100 @@ -21,6 +21,7 @@ #include #include #include +#include #define rpmError fprintf #define RPMERR_BADSPEC stderr #undef _ @@ -2106,6 +2107,7 @@ int isCompressed(const char * file, rpmC ssize_t nb; int rc = -1; unsigned char magic[13]; + char *end, *ext; *compressed = COMPRESSED_NOT; @@ -2131,6 +2133,11 @@ int isCompressed(const char * file, rpmC rc = 0; + /* Tar archives will be recognized by filename. */ + end = strchr(file, '\0'); + ext = end - 4; + if (ext > file && !strcasecmp(ext, ".tar")) return rc; + if (magic[0] == 'B' && magic[1] == 'Z') *compressed = COMPRESSED_BZIP2; else