]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
In iso9660 writer and xar writer, always overwrite the existing file in the file...
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 14 Jul 2011 13:39:47 +0000 (09:39 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 14 Jul 2011 13:39:47 +0000 (09:39 -0400)
which file has the same name; it is better that front-end applications such as tar decide
how they handle that case.

SVN-Revision: 3480

libarchive/archive_write_set_format_iso9660.c
libarchive/archive_write_set_format_xar.c

index 62c039d22e53a6cdb36f4c2bd61c5a0ef942e0ca..6bd530e1e5d37c244ef723354dfc471e9ece24d6 100644 (file)
@@ -5676,13 +5676,12 @@ same_entry:
                *isoentpp = NULL;
                return (ARCHIVE_FAILED);
        }
-       if (archive_entry_mtime(f1->entry) <
-           archive_entry_mtime(f2->entry) || np->virtual) {
-               /* Swap file entries. */
-               np->file = f2;
-               isoent->file = f1;
-               np->virtual = 0;
-       }
+
+       /* Swap file entries. */
+       np->file = f2;
+       isoent->file = f1;
+       np->virtual = 0;
+
        _isoent_free(isoent);
        *isoentpp = np;
        return (ARCHIVE_OK);
index 53489e1c3ea1c11ff788f895e5208220c1ba19d9..6e0567d2a08e1d240c6cea6057aa45865e560507 100644 (file)
@@ -2196,6 +2196,7 @@ file_tree(struct archive_write *a, struct file **filepp)
 #endif
        struct xar *xar = (struct xar *)a->format_data;
        struct file *dent, *file, *np;
+       struct archive_entry *ent;
        const char *fn, *p;
        int l;
 
@@ -2348,16 +2349,13 @@ same_entry:
                *filepp = NULL;
                return (ARCHIVE_FAILED);
        }
-       if (archive_entry_mtime(np->entry) <
-           archive_entry_mtime(file->entry) || np->virtual) {
-               /* Swap files. */
-               struct archive_entry *ent;
 
-               ent = np->entry;
-               np->entry = file->entry;
-               file->entry = ent;
-               np->virtual = 0;
-       }
+       /* Swap files. */
+       ent = np->entry;
+       np->entry = file->entry;
+       file->entry = ent;
+       np->virtual = 0;
+
        file_free(file);
        *filepp = np;
        return (ARCHIVE_OK);