# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Description: Tar 1.26 would remove wrong files when invoked with
-# --listed-incremental and -C
+# Description: ensure tar correctly respects -C option when deleting
+# files due to the --remove-files option.
+#
+# This case checks the use of a single relative-path -C option,
+# in --create/incremental mode.
+#
+# (Tar 1.26 would remove files in original working directory when called in
+# this manner. [It would follow the -C for archiving the files, but ignore it
+# for removing them afterwards.]
+#
# Reported by: Nathan Stratton Treadway <nathanst@ontko.com>
# References: <20130921171234.GG32256@shire.ontko.com>,
# http://lists.gnu.org/archive/html/bug-tar/2013-09/msg00028.html
+# )
-AT_SETUP([incremental and -C])
-AT_KEYWORDS([incremental create remove-files remfiles05])
+AT_SETUP([remove-files with -C:rel in -c/incr. mode])
+AT_KEYWORDS([create incremental remove-files remfiles04 remfiles04b])
AT_TAR_CHECK([
AT_SORT_PREREQ
mkdir foo
echo bar > bar
-echo foo/bar > foo/bar
-decho A
-find . | sort
-
-decho B
-tar -cvf foo.tar --listed-incremental=foo.snar --remove-files -C foo bar
-decho C
+echo foobar > foo/bar
+tar -cf foo.tar --incremental --remove-files -C foo bar
+echo A
find . | sort
],
[0],
.
./bar
./foo
-./foo/bar
-B
-bar
-C
-.
-./bar
-./foo
-./foo.snar
./foo.tar
-],
-[A
-B
-C
-],[],[],[gnu])
+],[],[],[],[gnu])
AT_CLEANUP