--- rpm-4.5/rpmio/macro.c~ 2008-06-10 02:08:37.000000000 +0300 +++ rpm-4.5/rpmio/macro.c 2008-06-10 02:08:59.476044991 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include #include #define rpmError fprintf #define rpmIsVerbose() (0) @@ -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