summaryrefslogtreecommitdiff
path: root/testing/libarchive/libarchive-3.0.x-fix-mtree-writer.patch
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-09-21 00:28:31 -0700
committerroot <root@rshg054.dnsready.net>2012-09-21 00:28:31 -0700
commit7bcc3e9d12b9294024067ecaf8ab28a9fe83ab6c (patch)
treeb3960814ca09f169fed5fd65f01497cb38fc3cf4 /testing/libarchive/libarchive-3.0.x-fix-mtree-writer.patch
parent005a14f92ef5d35e4c47d970cb7e69367a835958 (diff)
Fri Sep 21 00:28:30 PDT 2012
Diffstat (limited to 'testing/libarchive/libarchive-3.0.x-fix-mtree-writer.patch')
-rw-r--r--testing/libarchive/libarchive-3.0.x-fix-mtree-writer.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/libarchive/libarchive-3.0.x-fix-mtree-writer.patch b/testing/libarchive/libarchive-3.0.x-fix-mtree-writer.patch
new file mode 100644
index 000000000..dbc89686a
--- /dev/null
+++ b/testing/libarchive/libarchive-3.0.x-fix-mtree-writer.patch
@@ -0,0 +1,34 @@
+--- a/libarchive/archive_write_set_format_mtree.c
++++ b/libarchive/archive_write_set_format_mtree.c
+@@ -887,6 +887,19 @@ write_entry(struct archive_write *a, struct mtree_entry *me)
+
+ archive_string_empty(&mtree->ebuf);
+ str = (mtree->indent)? &mtree->ebuf : &mtree->buf;
++
++ /* If the pathname does not have a path separator, we have to
++ * add "./" to the head of the pathename because mtree reader
++ * will suppose that it is v1(a.k.a classic) mtree format and
++ * change the directory unexpectedly and so it will make a wrong
++ * path. */
++ if (strchr(me->pathname, '/') == NULL &&
++ strcmp(me->pathname, ".") != 0) {
++ archive_strcat(str, "./");
++ }
++ /* mtree reader does not accept an absolute path. */
++ else if (me->pathname[0] == '/')
++ archive_strappend_char(str, '.');
+ mtree_quote(str, me->pathname);
+ keys = get_keys(mtree, me);
+ if ((keys & F_NLINK) != 0 &&
+--- a/libarchive/test/test_read_format_mtree.c
++++ b/libarchive/test/test_read_format_mtree.c
+@@ -37,7 +37,8 @@ test_read_format_mtree1(void)
+ * without relying on overflow. This assumes that long long
+ * is at least 64 bits. */
+ static const long long max_int64 = ((((long long)1) << 62) - 1) + (((long long)1) << 62);
+- time_t min_time, t;
++ time_t min_time;
++ volatile time_t t;
+
+ extract_reference_file(reffile);
+ \ No newline at end of file