]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Adjust this test slightly so it doesn't depend on a
authorTim Kientzle <kientzle@gmail.com>
Sun, 11 Apr 2010 00:10:58 +0000 (20:10 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sun, 11 Apr 2010 00:10:58 +0000 (20:10 -0400)
particular order of traversing the directory.

In particular, this test almost passes against
GNU tar 1.23.  The difference being that GNU tar
considers it an error when a hardlink cannot
be extracted because the target was erased by
--strip-components and bsdtar does not consider
this an error.  Both extract the same files;
the only difference is that GNU tar emits
some error messages and exits with an error
status, while bsdtar exits with success.

SVN-Revision: 2224

tar/test/test_strip_components.c

index 2db07d61999bf4b2fe7bf7f9a059ef794095a977..f50d18d46563b425f9adc35557cd55c052e27fa2 100644 (file)
@@ -41,7 +41,7 @@ DEFINE_TEST(test_strip_components)
        }
        assertChdir("..");
 
-       assertEqualInt(0, systemf("%s -cf test.tar d0", testprog));
+       assertEqualInt(0, systemf("%s -cf test.tar d0/l1 d0/s1 d0/d1", testprog));
 
        assertMakeDir("target", 0755);
        assertEqualInt(0, systemf("%s -x -C target --strip-components 2 "
@@ -70,18 +70,11 @@ DEFINE_TEST(test_strip_components)
         * which these three names get archived.  If d0/l1 is first,
         * none of the three can be restored.  If either of the longer
         * names are first, then the two longer ones can both be
-        * restored.
+        * restored.  Note that the "tar -cf" command above explicitly
+        * lists d0/l1 before d0/d1.
         *
-        * The tree-walking code used by bsdtar always visits files
-        * before subdirectories, so bsdtar's behavior is fortunately
-        * deterministic:  d0/l1 will always get stored first and the
-        * other two will be stored as hardlinks to d0/l1.  Since
-        * d0/l1 can't be extracted, none of these three will be
-        * extracted.
-        *
-        * It may be worth extending this test to force a particular
-        * archiving order so as to exercise both of the cases described
-        * above.
+        * It may be worth extending this test to exercise other
+        * archiving orders.
         *
         * Of course, this is all totally different for cpio and newc
         * formats because the hardlink management is different.