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