1# Process this file with autom4te to create testsuite. -*- Autotest -*-
2# Test suite for GNU tar.
3# Copyright 2016-2021 Free Software Foundation, Inc.
4#
5# This file is part of GNU tar.
6#
7# GNU tar is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3 of the License, or
10# (at your option) any later version.
11#
12# GNU tar is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20AT_SETUP([update with chdir])
21AT_KEYWORDS([update update03 chdir])
22
23# Tar <=1.29 failed to chdir when -u was used with -C
24# Reported by: Ivan Kalvachev <ikalvachev@gmail.com>
25# References: <CABA=pqfSq-4PJYp7W2ezGOz+fR2uh74AyA7kOeXJBzg2o-oQBA@mail.gmail.com>,
26#             http://lists.gnu.org/archive/html/bug-tar/2016-08/msg00003.html
27AT_TAR_CHECK([
28mkdir dir1
29mkdir dir2
30mkdir dir1/subdir1 dir2/subdir2
31genfile --file dir1/subdir1/a
32genfile --file dir2/subdir2/a
33echo Create
34tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2
35genfile --file dir1/subdir1/b
36genfile --file dir2/subdir2/c
37echo Update
38tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2
39],
40[0],
41[Create
42subdir1/
43subdir1/a
44subdir2/
45subdir2/a
46Update
47subdir1/b
48subdir2/c
49])
50
51AT_CLEANUP