]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- recognize .tar files by filename
authorwitekfl <witekfl@pld-linux.org>
Sat, 10 Nov 2007 10:29:10 +0000 (10:29 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-tar_as_secondary_source.patch -> 1.1

rpm-tar_as_secondary_source.patch [new file with mode: 0644]

diff --git a/rpm-tar_as_secondary_source.patch b/rpm-tar_as_secondary_source.patch
new file mode 100644 (file)
index 0000000..37962e6
--- /dev/null
@@ -0,0 +1,30 @@
+--- 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 <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <strings.h>
+ #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
This page took 0.084872 seconds and 4 git commands to generate.