SOURCES: rpm-tar_as_secondary_source.patch (NEW) - recognize .tar ...
witekfl
witekfl at pld-linux.org
Sat Nov 10 11:29:15 CET 2007
Author: witekfl Date: Sat Nov 10 10:29:15 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- recognize .tar files by filename
---- Files affected:
SOURCES:
rpm-tar_as_secondary_source.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/rpm-tar_as_secondary_source.patch
diff -u /dev/null SOURCES/rpm-tar_as_secondary_source.patch:1.1
--- /dev/null Sat Nov 10 11:29:15 2007
+++ SOURCES/rpm-tar_as_secondary_source.patch Sat Nov 10 11:29:10 2007
@@ -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
================================================================
More information about the pld-cvs-commit
mailing list