]> Dogcows Code - chaz/tar/commitdiff
Fix interaction of various --exclude-tag options with --listed-incremental.
authorSergey Poznyakoff <gray@gnu.org.ua>
Sun, 10 Mar 2013 09:29:04 +0000 (11:29 +0200)
committerSergey Poznyakoff <gray@gnu.org.ua>
Tue, 12 Mar 2013 21:08:53 +0000 (23:08 +0200)
* src/incremen.c (procdir): Set directory->tagfile in
the exclusion_tag_contents case.
(makedumpdir): Mark all entries as ignored if directory->tagfile
is set.
Free new_dump before returning.
(maketagdumpdir): New function.
(scan_directory): If directory->children is set to
NO_CHILDREN and directory->tagfile is set, create a
dumpdir consisting of the tagfile only.

* tests/exclude08.at: New testcase.
* tests/exclude09.at: New testcase.
* tests/exclude10.at: New testcase.
* tests/exclude11.at: New testcase.
* tests/exclude12.at: New testcase.
* tests/exclude13.at: New testcase.
* tests/exclude14.at: New testcase.
* tests/exclude15.at: New testcase.
* tests/exclude16.at: New testcase.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Include new tests.
* tests/atlocal.in (mkexcltest): New function.
* tests/chtype.at: Update keywords.
* tests/filerem01.at: Likewise.
* tests/filerem02.at: Likewise.
* tests/incremental.at: Likewise.
* tests/multiv04.at: Likewise.

18 files changed:
src/incremen.c
tests/Makefile.am
tests/atlocal.in
tests/chtype.at
tests/exclude08.at [new file with mode: 0644]
tests/exclude09.at [new file with mode: 0644]
tests/exclude10.at [new file with mode: 0644]
tests/exclude11.at [new file with mode: 0644]
tests/exclude12.at [new file with mode: 0644]
tests/exclude13.at [new file with mode: 0644]
tests/exclude14.at [new file with mode: 0644]
tests/exclude15.at [new file with mode: 0644]
tests/exclude16.at [new file with mode: 0644]
tests/filerem01.at
tests/filerem02.at
tests/incremental.at
tests/multiv04.at
tests/testsuite.at

index 1d20c4465cab872f08816aa6d463bda41b81f61c..557df3090d502ce0074121f8501c4eb44af3a072 100644 (file)
@@ -609,6 +609,7 @@ procdir (const char *name_buffer, struct tar_stat_info *st,
          exclusion_tag_warning (name_buffer, tag_file_name,
                                 _("contents not dumped"));
          directory->children = NO_CHILDREN;
+         directory->tagfile = tag_file_name;
          break;
 
        case exclusion_tag_under:
@@ -680,15 +681,13 @@ makedumpdir (struct directory *directory, const char *dir)
       if (loc)
        {
          if (directory->tagfile)
-           *new_dump_ptr = strcmp (directory->tagfile, array[i]) == 0 ?
-                               ' ' : 'I';
+           *new_dump_ptr = 'I';
          else
            *new_dump_ptr = ' ';
          new_dump_ptr++;
        }
       else if (directory->tagfile)
-       *new_dump_ptr++ = strcmp (directory->tagfile, array[i]) == 0 ?
-                              ' ' : 'I';
+       *new_dump_ptr++ = 'I';
       else
        *new_dump_ptr++ = 'Y'; /* New entry */
 
@@ -699,9 +698,26 @@ makedumpdir (struct directory *directory, const char *dir)
   *new_dump_ptr = 0;
   directory->idump = directory->dump;
   directory->dump = dumpdir_create0 (new_dump, NULL);
+  free (new_dump);
   free (array);
 }
 
+/* Create a dumpdir containing only one entry: that for the
+   tagfile. */
+static void
+maketagdumpdir (struct directory *directory)
+{
+  size_t len = strlen (directory->tagfile) + 1;
+  char *new_dump = xmalloc (len + 2);
+  new_dump[0] = 'Y';
+  memcpy (new_dump + 1, directory->tagfile, len);
+  new_dump[len + 1] = 0;
+
+  directory->idump = directory->dump;
+  directory->dump = dumpdir_create0 (new_dump, NULL);
+  free (new_dump);
+}
+
 /* Recursively scan the directory identified by ST.  */
 struct directory *
 scan_directory (struct tar_stat_info *st)
@@ -729,86 +745,94 @@ scan_directory (struct tar_stat_info *st)
 
   nbuf = namebuf_create (dir);
 
-  if (dirp && directory->children != NO_CHILDREN)
+  if (dirp)
     {
-      char *entry;     /* directory entry being scanned */
-      struct dumpdir_iter *itr;
-
-      makedumpdir (directory, dirp);
-
-      for (entry = dumpdir_first (directory->dump, 1, &itr);
-          entry;
-          entry = dumpdir_next (itr))
+      if (directory->children != NO_CHILDREN)
        {
-         char *full_name = namebuf_name (nbuf, entry + 1);
-
-         if (*entry == 'I') /* Ignored entry */
-           *entry = 'N';
-         else if (excluded_name (full_name))
-           *entry = 'N';
-         else
-           {
-             int fd = st->fd;
-             void (*diag) (char const *) = 0;
-             struct tar_stat_info stsub;
-             tar_stat_init (&stsub);
+         char *entry;  /* directory entry being scanned */
+         struct dumpdir_iter *itr;
 
-             if (fd < 0)
-               {
-                 errno = - fd;
-                 diag = open_diag;
-               }
-             else if (fstatat (fd, entry + 1, &stsub.stat, fstatat_flags) != 0)
-               diag = stat_diag;
-             else if (S_ISDIR (stsub.stat.st_mode))
-               {
-                 int subfd = subfile_open (st, entry + 1, open_read_flags);
-                 if (subfd < 0)
-                   diag = open_diag;
-                 else
-                   {
-                     stsub.fd = subfd;
-                     if (fstat (subfd, &stsub.stat) != 0)
-                       diag = stat_diag;
-                   }
-               }
+         makedumpdir (directory, dirp);
 
-             if (diag)
-               {
-                 file_removed_diag (full_name, false, diag);
-                 *entry = 'N';
-               }
-             else if (S_ISDIR (stsub.stat.st_mode))
-               {
-                 int pd_flag = 0;
-                 if (!recursion_option)
-                   pd_flag |= PD_FORCE_CHILDREN | NO_CHILDREN;
-                 else if (directory->children == ALL_CHILDREN)
-                   pd_flag |= PD_FORCE_CHILDREN | ALL_CHILDREN;
-                 *entry = 'D';
-
-                 stsub.parent = st;
-                 procdir (full_name, &stsub, pd_flag, entry);
-                 restore_parent_fd (&stsub);
-               }
-             else if (one_file_system_option && device != stsub.stat.st_dev)
+         for (entry = dumpdir_first (directory->dump, 1, &itr);
+              entry;
+              entry = dumpdir_next (itr))
+           {
+             char *full_name = namebuf_name (nbuf, entry + 1);
+             
+             if (*entry == 'I') /* Ignored entry */
                *entry = 'N';
-             else if (*entry == 'Y')
-               /* New entry, skip further checks */;
-             /* FIXME: if (S_ISHIDDEN (stat_data.st_mode))?? */
-             else if (OLDER_STAT_TIME (stsub.stat, m)
-                      && (!after_date_option
-                          || OLDER_STAT_TIME (stsub.stat, c)))
+             else if (excluded_name (full_name))
                *entry = 'N';
              else
-               *entry = 'Y';
+               {
+                 int fd = st->fd;
+                 void (*diag) (char const *) = 0;
+                 struct tar_stat_info stsub;
+                 tar_stat_init (&stsub);
 
-             tar_stat_destroy (&stsub);
+                 if (fd < 0)
+                   {
+                     errno = - fd;
+                     diag = open_diag;
+                   }
+                 else if (fstatat (fd, entry + 1, &stsub.stat,
+                                   fstatat_flags) != 0)
+                   diag = stat_diag;
+                 else if (S_ISDIR (stsub.stat.st_mode))
+                   {
+                     int subfd = subfile_open (st, entry + 1,
+                                               open_read_flags);
+                     if (subfd < 0)
+                       diag = open_diag;
+                     else
+                       {
+                         stsub.fd = subfd;
+                         if (fstat (subfd, &stsub.stat) != 0)
+                           diag = stat_diag;
+                       }
+                   }
+                 
+                 if (diag)
+                   {
+                     file_removed_diag (full_name, false, diag);
+                     *entry = 'N';
+                   }
+                 else if (S_ISDIR (stsub.stat.st_mode))
+                   {
+                     int pd_flag = 0;
+                     if (!recursion_option)
+                       pd_flag |= PD_FORCE_CHILDREN | NO_CHILDREN;
+                     else if (directory->children == ALL_CHILDREN)
+                       pd_flag |= PD_FORCE_CHILDREN | ALL_CHILDREN;
+                     *entry = 'D';
+                     
+                     stsub.parent = st;
+                     procdir (full_name, &stsub, pd_flag, entry);
+                     restore_parent_fd (&stsub);
+                   }
+                 else if (one_file_system_option &&
+                          device != stsub.stat.st_dev)
+                   *entry = 'N';
+                 else if (*entry == 'Y')
+                   /* New entry, skip further checks */;
+                 /* FIXME: if (S_ISHIDDEN (stat_data.st_mode))?? */
+                 else if (OLDER_STAT_TIME (stsub.stat, m)
+                          && (!after_date_option
+                              || OLDER_STAT_TIME (stsub.stat, c)))
+                   *entry = 'N';
+                 else
+                   *entry = 'Y';
+                 
+                 tar_stat_destroy (&stsub);
+               }
            }
+         free (itr);
        }
-      free (itr);
+      else if (directory->tagfile)
+       maketagdumpdir (directory);
     }
-
+  
   namebuf_free (nbuf);
 
   free (dirp);
index 320d78fd973807e880c19e62a768a0dcbcaa6df7..500de899796aff2289d9af5ffa444f3871edaee3 100644 (file)
@@ -65,6 +65,15 @@ TESTSUITE_AT = \
  exclude05.at\
  exclude06.at\
  exclude07.at\
+ exclude08.at\
+ exclude09.at\
+ exclude10.at\
+ exclude11.at\
+ exclude12.at\
+ exclude13.at\
+ exclude14.at\
+ exclude15.at\
+ exclude16.at\
  extrac01.at\
  extrac02.at\
  extrac03.at\
index b10397a53366656018319cd677f5c0bd8465f509..2bef145d70e85ed2e4b2c3e0ea51038402402092 100644 (file)
@@ -49,3 +49,11 @@ decho() {
   echo $*
   echo >&2 $*
 }
+
+mkexcltest() {
+  mkdir $1 $1/subdir
+  genfile --file=$1/top-level-file
+  genfile --file=$1/subdir/excludeme
+  genfile --file=$1/subdir/subdir-file
+}
+  
\ No newline at end of file
index cebd6cf6d69caf331ac6aceb0259d5256b2d8be6..e5b5876ee8dcdc99c96c6712a1416ccb7d707eb5 100644 (file)
@@ -25,7 +25,7 @@
 # References: <200605101232.25031.bugreport@wkleff.intergenia.de>
 
 AT_SETUP([changed file types in incrementals])
-AT_KEYWORDS([incremental chtype])
+AT_KEYWORDS([incremental listed chtype])
 
 AT_TAR_CHECK([
 AT_SORT_PREREQ
diff --git a/tests/exclude08.at b/tests/exclude08.at
new file mode 100644 (file)
index 0000000..ccd26c9
--- /dev/null
@@ -0,0 +1,53 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag option alone works
+# as expected, i.e. excludes the contents of the directory containing
+# the tag, but preserves the directory and the tag itself.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag option])
+AT_KEYWORDS([exclude exclude-tag exclude08])
+
+AT_TAR_CHECK([
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest
+],
+[0],
+[etest/
+etest/subdir/
+etest/subdir/excludeme
+etest/top-level-file
+],
+[tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+])
+
+AT_CLEANUP
+
diff --git a/tests/exclude09.at b/tests/exclude09.at
new file mode 100644 (file)
index 0000000..6ccfb18
--- /dev/null
@@ -0,0 +1,56 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag option works
+# as expected whe used together with --listed-incremental, i.e. excludes
+# the contents of the directory containing the tag, but preserves the
+# directory and the tag itself.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+AT_SETUP([--exclude-tag option and --listed-incremental])
+AT_KEYWORDS([exclude exclude-tag listed incremental exclude09])
+
+AT_TAR_CHECK([
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest
+],
+[0],
+[etest/
+etest/subdir/
+etest/top-level-file
+etest/subdir/excludeme
+],
+[tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+],[],[],[gnu])
+
+AT_CLEANUP
+
diff --git a/tests/exclude10.at b/tests/exclude10.at
new file mode 100644 (file)
index 0000000..c95cb53
--- /dev/null
@@ -0,0 +1,72 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag option works
+# as expected when used in conjunction with --listed-incremental.
+# If the exclusion tag is created after the level 0 dump, the level
+# 1 dump must skip the affected subdirectory and any previously-included
+# files within it, but preserve the directory and the tag itself.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag option in incremental pass])
+AT_KEYWORDS([exclude exclude-tag listed incremental exclude10])
+
+AT_TAR_CHECK([
+mkexcltest etest
+rm etest/subdir/excludeme
+decho "# Level 0"
+tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest
+touch etest/subdir/excludeme
+touch etest/subdir/otherfile
+
+decho "# Level 1"
+cp snar-0 snar-1
+tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest
+],
+[0],
+[# Level 0
+etest/
+etest/subdir/
+etest/top-level-file
+etest/subdir/subdir-file
+# Level 1
+etest/
+etest/subdir/
+etest/subdir/excludeme
+],
+[# Level 0
+tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+# Level 1
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+],[],[],[gnu])
+
+AT_CLEANUP
+
diff --git a/tests/exclude11.at b/tests/exclude11.at
new file mode 100644 (file)
index 0000000..6b5ef51
--- /dev/null
@@ -0,0 +1,52 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies that the --exclude-tag-under option alone works
+# as expected, i.e. excludes the contents of the directory containing
+# the tag and the tag itself, but preserves the directory.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag-under option])
+AT_KEYWORDS([exclude exclude-tag exclude-tag-under exclude11])
+
+AT_TAR_CHECK([
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest
+],
+[0],
+[etest/
+etest/subdir/
+etest/top-level-file
+],
+[tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+])
+
+AT_CLEANUP
+
diff --git a/tests/exclude12.at b/tests/exclude12.at
new file mode 100644 (file)
index 0000000..7121f07
--- /dev/null
@@ -0,0 +1,55 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag-under option works
+# as expected whe used together with --listed-incremental, i.e. excludes
+# the contents of the directory containing the tag and the tag file, but
+# preserves the directory itself.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag-under and --listed-incremental])
+AT_KEYWORDS([exclude exclude-tag exclude-tag-under listed incremental exclude12])
+
+AT_TAR_CHECK([
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest
+],
+[0],
+[etest/
+etest/subdir/
+etest/top-level-file
+],
+[tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+],[],[],[gnu])
+
+AT_CLEANUP
+
diff --git a/tests/exclude13.at b/tests/exclude13.at
new file mode 100644 (file)
index 0000000..4a36076
--- /dev/null
@@ -0,0 +1,72 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag-under option works
+# as expected when used in conjunction with --listed-incremental.
+# If the exclusion tag is created after the level 0 dump, the level
+# 1 dump must skip the affected subdirectory and any previously-included
+# files within it, including the tag file, but preserve the directory
+# itself.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag-under option in incremental pass])
+AT_KEYWORDS([exclude exclude-tag exclude-tag-under listed incremental exclude13])
+
+AT_TAR_CHECK([
+mkexcltest etest
+rm etest/subdir/excludeme
+decho "# Level 0"
+tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest
+touch etest/subdir/excludeme
+touch etest/subdir/otherfile
+
+decho "# Level 1"
+cp snar-0 snar-1
+tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest
+],
+[0],
+[# Level 0
+etest/
+etest/subdir/
+etest/top-level-file
+etest/subdir/subdir-file
+# Level 1
+etest/
+etest/subdir/
+],
+[# Level 0
+tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+# Level 1
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+],[],[],[gnu])
+
+AT_CLEANUP
+
diff --git a/tests/exclude14.at b/tests/exclude14.at
new file mode 100644 (file)
index 0000000..9032366
--- /dev/null
@@ -0,0 +1,51 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag-all option alone works
+# as expected, i.e. excludes entire directory containing the tag, including
+# any files located under it.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag-all option])
+AT_KEYWORDS([exclude exclude-tag exclude-tag-all exclude14])
+
+AT_TAR_CHECK([
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest
+],
+[0],
+[etest/
+etest/top-level-file
+],
+[tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
+])
+
+AT_CLEANUP
+
diff --git a/tests/exclude15.at b/tests/exclude15.at
new file mode 100644 (file)
index 0000000..2c98c35
--- /dev/null
@@ -0,0 +1,53 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag-all option works
+# as expected whe used together with --listed-incremental, i.e. excludes
+# excludes entire directory containing the tag.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag-all and --listed-incremental])
+AT_KEYWORDS([exclude exclude-tag exclude-tag-all listed incremental exclude15])
+
+AT_TAR_CHECK([
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest
+],
+[0],
+[etest/
+etest/top-level-file
+],
+[tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped
+],[],[],[gnu])
+
+AT_CLEANUP
+
diff --git a/tests/exclude16.at b/tests/exclude16.at
new file mode 100644 (file)
index 0000000..5254ef8
--- /dev/null
@@ -0,0 +1,70 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+#
+# Test suite for GNU tar.
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The --exclude-tag options interacted incorrectly with --listed-incremental
+# since their very inception.  The testcases exclude08 through exclude16
+# verify that --exclude-tag operates consistently whether or not
+# --listed-incremental option is given.
+#
+# This testcase verifies whether the --exclude-tag-all option works
+# as expected whe used together with --listed-incremental.  If the
+# exclusion tag is created after the level 0 dump, the level 1 dump
+# must skip the entire affected subdirectory and any previously-included
+# files within it.
+#
+# Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
+# Last-Affected-Version: 1.26
+# References: <20120528140419.GT2654@shire.ontko.com>,
+#   <20130311210006.GA3732@shire.ontko.com>,
+#   http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html
+
+AT_SETUP([--exclude-tag-all option in incremental pass])
+AT_KEYWORDS([exclude exclude-tag exclude-tag-all listed incremental exclude16])
+
+AT_TAR_CHECK([
+mkexcltest etest
+rm etest/subdir/excludeme
+decho "# Level 0"
+tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest
+touch etest/subdir/excludeme
+touch etest/subdir/otherfile
+
+decho "# Level 1"
+cp snar-0 snar-1
+tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest
+],
+[0],
+[# Level 0
+etest/
+etest/subdir/
+etest/top-level-file
+etest/subdir/subdir-file
+# Level 1
+etest/
+],
+[# Level 0
+tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+# Level 1
+tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped
+],[],[],[gnu])
+
+AT_CLEANUP
+
index 56628f0f14bea900be0f416ea134a88384c7c8f8..1c2c519c8c82990d9b46fdd04a52adeb7831d5d7 100644 (file)
@@ -34,7 +34,7 @@
 #
 
 AT_SETUP([file removed as we read it (ca. 22 seconds)])
-AT_KEYWORDS([create incremental filechange filerem filerem01])
+AT_KEYWORDS([create incremental listed filechange filerem filerem01])
 
 AT_TAR_CHECK([
 mkdir dir
index 37b9bee0df3fda9decf04eb9a8e5acd3fac12371..60f55585fc33a7200c966bc050cb30287f070882 100644 (file)
@@ -24,7 +24,7 @@
 # in the command line.
 
 AT_SETUP([toplevel file removed (ca. 24 seconds)])
-AT_KEYWORDS([create incremental filechange filerem filerem02])
+AT_KEYWORDS([create incremental listed filechange filerem filerem02])
 
 AT_TAR_CHECK([
 mkdir dir
index bd7dcd8aade81ea6e594f93ffc225ac8a8816a6b..19e376b835ddd1d9a3de32c45b99325859c0254d 100644 (file)
@@ -21,7 +21,7 @@
 # A directory older than the listed entry was skipped completely.
 
 AT_SETUP([incremental])
-AT_KEYWORDS([incremental incr00])
+AT_KEYWORDS([incremental listed incr00])
 
 AT_TAR_CHECK([
 mkdir structure
index 6d552fd93db63825d4b8bc871afc379490fc4495..e781d85afb80090a14dc2ee8994fac1395194883 100644 (file)
@@ -34,7 +34,7 @@
 # 3. Test the created multi-volume archive.
 
 AT_SETUP([split directory members in a MV archive])
-AT_KEYWORDS([multivolume multiv incremental multiv04])
+AT_KEYWORDS([multivolume multiv incremental listed multiv04])
 
 AT_TAR_CHECK([
 
index 37a4bd6e1a427a31422c12912dff9d223721c75b..1de7d305ee5c1cd740b7c5ea23e7034a174d80c8 100644 (file)
@@ -210,6 +210,15 @@ m4_include([exclude04.at])
 m4_include([exclude05.at])
 m4_include([exclude06.at])
 m4_include([exclude07.at])
+m4_include([exclude08.at])
+m4_include([exclude09.at])
+m4_include([exclude10.at])
+m4_include([exclude11.at])
+m4_include([exclude12.at])
+m4_include([exclude13.at])
+m4_include([exclude14.at])
+m4_include([exclude15.at])
+m4_include([exclude16.at])
 
 m4_include([delete01.at])
 m4_include([delete02.at])
This page took 0.04732 seconds and 4 git commands to generate.