Files
tar/tests/remfiles05.at
Sergey Poznyakoff b41b004638 Improve tar_getcwd
* src/common.h (tar_getcwd): Return pointer is const.
* src/misc.c (wd) <cwd>: New member.
(chdir_arg): Initialize cwd.
(tar_getcwd): Use cwd member to cache the result.  Take into
account absolute pathnames,
(normalize_filename): Don't free the value
returned from tar_getcwd.
* src/names.c (name_next_elt): Remove leftover call chdir().
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.

* tests/incr08.at: New testcase.
* tests/remfiles04.at: New testcase.
* tests/remfiles05.at: New testcase.
* tests/remfiles06.at: New testcase.
* tests/remfiles07.at: New testcase.
2013-09-25 16:04:21 +03:00

61 lines
1.4 KiB
Plaintext

# Process this file with autom4te to create testsuite. -*- Autotest -*-
# Test suite for GNU tar.
# Copyright 2013 Free Software Foundation, Inc.
#
# 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/>.
# Description: Tar 1.26 would remove wrong files when invoked with
# --listed-incremental and -C
# 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_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
find . | sort
],
[0],
[A
.
./bar
./foo
./foo/bar
B
bar
C
.
./bar
./foo
./foo.snar
./foo.tar
],
[A
B
C
],[],[],[gnu])
AT_CLEANUP