]> Dogcows Code - chaz/tar/blob - tests/rename03.at
83b0c182b8e5808a76fc0e57a40003ee9d4c2405
[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 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 2, 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 mkdir foo
28 genfile --file foo/file1
29 genfile --file foo/file2
30
31 mkdir foo/a
32 genfile --file foo/a/filea
33
34 mkdir foo/b
35 genfile --file foo/b/fileb
36
37 mkdir foo/c
38 genfile --file foo/c/filec
39
40 echo "First dump"
41 echo "First dump">&2
42 tar -g incr -cf arch.1 -v foo 2>tmperr
43 sort tmperr >&2
44
45 # Shuffle directories:
46 (cd foo
47 mv a $$
48 mv c a
49 mv b c
50 mv $$ b)
51
52 echo "Second dump"
53 echo "Second dump" >&2
54 tar -g incr -cf arch.2 -v foo 2>tmperr
55 sort tmperr >&2
56
57 tar xfg arch.1 /dev/null
58
59 echo "Begin directory listing 1"
60 find foo | sort
61 echo "End directory listing 1"
62
63 tar xfgv arch.2 /dev/null
64 echo Begin directory listing 2
65 find foo | sort
66 echo End directory listing 2
67 ],
68 [0],
69 [First dump
70 foo/
71 foo/a/
72 foo/b/
73 foo/c/
74 foo/file1
75 foo/file2
76 foo/a/filea
77 foo/b/fileb
78 foo/c/filec
79 Second dump
80 foo/
81 foo/a/
82 foo/b/
83 foo/c/
84 Begin directory listing 1
85 foo
86 foo/a
87 foo/a/filea
88 foo/b
89 foo/b/fileb
90 foo/c
91 foo/c/filec
92 foo/file1
93 foo/file2
94 End directory listing 1
95 foo/
96 foo/a/
97 foo/b/
98 foo/c/
99 Begin directory listing 2
100 foo
101 foo/a
102 foo/a/filec
103 foo/b
104 foo/b/filea
105 foo/c
106 foo/c/fileb
107 foo/file1
108 foo/file2
109 End directory listing 2
110 ],
111 [First dump
112 tar: foo/a: Directory is new
113 tar: foo/b: Directory is new
114 tar: foo/c: Directory is new
115 Second dump
116 tar: foo/a: Directory has been renamed from `foo/c'
117 tar: foo/b: Directory has been renamed from `foo/a'
118 tar: foo/c: Directory has been renamed from `foo/b'
119 ],
120 [],[],[gnu, oldgnu, posix])
121
122 AT_CLEANUP
123
124 # End of rename03.at
This page took 0.040836 seconds and 4 git commands to generate.