]> Dogcows Code - chaz/tar/blob - tests/listed02.at
Do not create useless directory
[chaz/tar] / tests / listed02.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA
19 # 02111-1307, USA.
20
21 # Check if listed-incremental backups work for files moved from one directory
22 # to another.
23 # Based on a script by Martin Simmons <ZYHYLCRMZPRP@spammotel.com>
24 # References:
25 # <20040626230315.163AA1D148@cpc5-cmbg1-6-0-cust208.cmbg.cable.ntl.com>
26 # http://lists.gnu.org/archive/html/bug-tar/2004-06/msg00028.html
27
28 AT_SETUP([working --listed])
29 AT_KEYWORDS([listed02])
30
31 AT_TAR_CHECK([
32
33 echo Create directories
34 mkdir tart
35 sleep 1
36 mkdir tart/c0
37 sleep 1
38 mkdir tart/c1
39 sleep 1
40
41 for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
42 do
43 echo File $file > $file
44 sleep 1
45 done
46
47 sleep 1
48 echo Creating main archive
49 tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart || exit 1
50
51 sleep 1
52 echo Modifying filesystem
53 rm tart/a1
54 mv tart/b1 tart/b2
55 mv tart/c1 tart/c2
56 touch tart/c2/ca3
57
58 echo Directory contents
59 find tart|sort 2>/dev/null
60
61 sleep 1
62 echo Creating incremental archive
63 cp -p tart.incr1 tart.incr2
64 tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
65
66 sleep 1
67
68 rm -rf tart/*
69 echo Extracting main archive
70 tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
71 echo Extracting incremental archive
72 # This command should produce three messages about deletion
73 # of the existing files, that may appear in any order. Piping
74 # to sort makes sure we don't depend on any particular ordering.
75 tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
76
77 echo Final files:
78 find tart|sort 2>/dev/null
79 ],
80 [0],
81 [Create directories
82 Creating main archive
83 tart/
84 tart/c0/
85 tart/c1/
86 tart/a1
87 tart/b1
88 tart/c0/cq1
89 tart/c0/cq2
90 tart/c1/ca1
91 tart/c1/ca2
92 Modifying filesystem
93 Directory contents
94 tart
95 tart/b2
96 tart/c0
97 tart/c0/cq1
98 tart/c0/cq2
99 tart/c2
100 tart/c2/ca1
101 tart/c2/ca2
102 tart/c2/ca3
103 Creating incremental archive
104 tart/
105 tart/c0/
106 tart/c2/
107 tart/b2
108 tart/c2/ca1
109 tart/c2/ca2
110 tart/c2/ca3
111 Extracting main archive
112 tart/
113 tart/c0/
114 tart/c1/
115 tart/a1
116 tart/b1
117 tart/c0/cq1
118 tart/c0/cq2
119 tart/c1/ca1
120 tart/c1/ca2
121 Extracting incremental archive
122 tar: Deleting `tart/a1'
123 tar: Deleting `tart/b1'
124 tar: Deleting `tart/c1'
125 tart/
126 tart/b2
127 tart/c0/
128 tart/c2/
129 tart/c2/ca1
130 tart/c2/ca2
131 tart/c2/ca3
132 Final files:
133 tart
134 tart/b2
135 tart/c0
136 tart/c0/cq1
137 tart/c0/cq2
138 tart/c2
139 tart/c2/ca1
140 tart/c2/ca2
141 tart/c2/ca3
142 ],
143 [tar: tart/c0: Directory is new
144 tar: tart/c1: Directory is new
145 tar: tart/c2: Directory is new
146 ],
147 [],[],[gnu, oldgnu])
148
149 AT_CLEANUP
This page took 0.0417 seconds and 5 git commands to generate.