tar: tar xf foo.tar dir/dir did not extract all subdirs.
authorDenis Vlasenko <vda.linux@googlemail.com>
Sat, 2 Sep 2006 18:40:10 +0000 (18:40 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sat, 2 Sep 2006 18:40:10 +0000 (18:40 -0000)
Added testsuite entry for this

archival/libunarchive/find_list_entry.c
testsuite/README
testsuite/tar/tar-extracts-all-subdirs [new file with mode: 0644]

index 49bdd2d098ccec15353e2751a5fd6eba7489a65f..57ffec6ec06b17047eda0bf6e6aa83f72cbe0c36 100644 (file)
@@ -13,7 +13,7 @@
 const llist_t *find_list_entry(const llist_t *list, const char *filename)
 {
        while (list) {
-               if (fnmatch(list->data, filename, 0) == 0) {
+               if (fnmatch(list->data, filename, FNM_LEADING_DIR) == 0) {
                        return (list);
                }
                list = list->link;
index 40439bfe8cbf6208088c898ac7cfec30e3595e0e..377f20ef8ecf7eb2e9c626c96f1b3a01ef5ebdf9 100644 (file)
@@ -1,3 +1,6 @@
+Update: doesn't work as described. Try "make check" from parent dir...
+* * *
+
 To run the test suite, change to this directory and run "./runtest".  It will
 run all of the test cases, and list those with unexpected outcomes.  Adding the
 -v option will cause it to show expected outcomes as well.  To only run the test
diff --git a/testsuite/tar/tar-extracts-all-subdirs b/testsuite/tar/tar-extracts-all-subdirs
new file mode 100644 (file)
index 0000000..886c37c
--- /dev/null
@@ -0,0 +1,12 @@
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+mkdir -p foo/{1,2,3}
+mkdir -p foo/1/{10,11}
+mkdir -p foo/1/10/{100,101,102}
+tar cf foo.tar -C foo .
+rm -rf foo/*
+busybox tar xf foo.tar -C foo ./1/10
+find foo | sort >logfile.bb
+rm -rf foo/*
+tar xf foo.tar -C foo ./1/10
+find foo | sort >logfile.gnu
+cmp logfile.gnu logfile.bb