re-mark 1.29b-2 as not yet uploaded (merge madness!)
[debian/tar] / tests / rename03.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright 2006-2007, 2009, 2013-2014, 2016 Free Software Foundation,
5 # Inc.
6
7 # This file is part of GNU tar.
8
9 # GNU tar is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
13
14 # GNU tar is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
22 # Description: Handling of cyclic renames in incremental archives.
23
24 AT_SETUP([cyclic renames])
25 AT_KEYWORDS([incremental rename rename03 cyclic-rename])
26
27 AT_TAR_CHECK([
28 AT_SORT_PREREQ
29
30 mkdir foo
31 genfile --file foo/file1
32 genfile --file foo/file2
33
34 mkdir foo/a
35 genfile --file foo/a/filea
36
37 mkdir foo/b
38 genfile --file foo/b/fileb
39
40 mkdir foo/c
41 genfile --file foo/c/filec
42
43 sleep 1
44
45 echo "First dump"
46 echo "First dump">&2
47 tar -g incr -cf arch.1 -v foo 2>tmperr
48 sort tmperr >&2
49
50 # Shuffle directories:
51 (cd foo
52 mv a $$
53 mv c a
54 mv b c
55 mv $$ b)
56
57 echo "Second dump"
58 echo "Second dump" >&2
59 tar -g incr -cf arch.2 -v foo 2>tmperr
60 sort tmperr >&2
61
62 tar xfg arch.1 /dev/null --warning=no-timestamp
63
64 echo "Begin directory listing 1"
65 find foo | sort
66 echo "End directory listing 1"
67
68 tar xfgv arch.2 /dev/null --warning=no-timestamp
69 echo Begin directory listing 2
70 find foo | sort
71 echo End directory listing 2
72 ],
73 [0],
74 [First dump
75 foo/
76 foo/a/
77 foo/b/
78 foo/c/
79 foo/file1
80 foo/file2
81 foo/a/filea
82 foo/b/fileb
83 foo/c/filec
84 Second dump
85 foo/
86 foo/a/
87 foo/b/
88 foo/c/
89 Begin directory listing 1
90 foo
91 foo/a
92 foo/a/filea
93 foo/b
94 foo/b/fileb
95 foo/c
96 foo/c/filec
97 foo/file1
98 foo/file2
99 End directory listing 1
100 foo/
101 foo/a/
102 foo/b/
103 foo/c/
104 Begin directory listing 2
105 foo
106 foo/a
107 foo/a/filec
108 foo/b
109 foo/b/filea
110 foo/c
111 foo/c/fileb
112 foo/file1
113 foo/file2
114 End directory listing 2
115 ],
116 [First dump
117 tar: foo/a: Directory is new
118 tar: foo/b: Directory is new
119 tar: foo/c: Directory is new
120 tar: foo: Directory is new
121 Second dump
122 tar: foo/a: Directory has been renamed from 'foo/c'
123 tar: foo/b: Directory has been renamed from 'foo/a'
124 tar: foo/c: Directory has been renamed from 'foo/b'
125 ],
126 [],[],[gnu, oldgnu, posix])
127
128 AT_CLEANUP
129
130 # End of rename03.at