1# Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3# Test suite for GNU tar.
4# Copyright 2006-2021 Free Software Foundation, Inc.
5
6# This file is part of GNU tar.
7
8# GNU tar is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 3 of the License, or
11# (at your option) any later version.
12
13# GNU tar is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21# Description: Incremental archives should be able to handle directories
22# moved between directory hierarchies.
23
24AT_SETUP([move between hierarchies])
25AT_KEYWORDS([incremental rename rename02])
26
27AT_TAR_CHECK([
28AT_SORT_PREREQ
29mkdir foo
30genfile --file foo/file1
31genfile --file foo/file2
32mkdir foo/bar
33genfile --file foo/bar/file.r
34mkdir foo/bar/baz
35genfile --file foo/bar/baz/file.z
36
37sleep 1
38
39echo "Creating base archive"
40tar -g incr -cf arch.1 -v foo
41
42mv foo/bar/baz foo
43
44echo "Creating incremental archive"
45tar -g incr -cf arch.2 -v foo
46
47mv foo old
48
49tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr
50sort tmperr >&2
51
52echo "Begin directory listing 1"
53find foo | sort
54echo "End directory listing 1"
55
56tar xfgv arch.2 /dev/null --warning=no-timestamp
57echo Begin directory listing 2
58find foo | sort
59echo End directory listing 2
60],
61[0],
62[Creating base archive
63foo/
64foo/bar/
65foo/bar/baz/
66foo/file1
67foo/file2
68foo/bar/file.r
69foo/bar/baz/file.z
70Creating incremental archive
71foo/
72foo/bar/
73foo/baz/
74Begin directory listing 1
75foo
76foo/bar
77foo/bar/baz
78foo/bar/baz/file.z
79foo/bar/file.r
80foo/file1
81foo/file2
82End directory listing 1
83foo/
84foo/bar/
85foo/baz/
86Begin directory listing 2
87foo
88foo/bar
89foo/bar/file.r
90foo/baz
91foo/baz/file.z
92foo/file1
93foo/file2
94End directory listing 2
95],
96[tar: foo: Directory is new
97tar: foo/bar: Directory is new
98tar: foo/bar/baz: Directory is new
99tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
100],
101[],[],[gnu, oldgnu, posix])
102
103AT_CLEANUP
104
105# End of rename02.at
106