]> Dogcows Code - chaz/tar/blob - tests/incr07.at
Fix the testsuite
[chaz/tar] / tests / incr07.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 # Test suite for GNU tar.
3 # Copyright 2009, 2013-2014 Free Software Foundation, Inc.
4 #
5 # GNU tar is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # GNU tar is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 AT_SETUP([incremental restores with -C])
19 AT_KEYWORDS([incremental extract incr07])
20
21 # Tar 1.26 had problems extracting from incremental restores when given
22 # the -C option. The code in incremen.c:try_purge_directory and
23 # misc.c:remove_any_file was using savedir(), which ignored eventual changes
24 # in the current working directory and caused the malfunctioning.
25 #
26 # The problem was reported by Piotr Rotter on 2013-03-22.
27 #
28 # This testcase is based on scripts provided by Piotr Rotter and Nathan
29 # Stratton Treadway.
30 #
31 # References: <514C8F56.90900@active24.pl>,
32 # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00036.html,
33 # <20130326181922.GZ3732@shire.ontko.com>,
34 # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00042.html,
35 # <20130327051828.GA3732@shire.ontko.com>,
36 # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00043.html,
37 # <20130327054957.GB3732@shire.ontko.com>,
38 # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00044.html
39
40 AT_TAR_CHECK([
41 mkdir dirA
42 echo 'a' > dirA/a
43 echo 'a' > dirA/b
44
45 decho C0
46 tar -g test.snar -vcf test.0.tar dirA
47
48 echo 'a' > dirA/c
49 decho C1
50 tar -g test.snar -vcf test.1.tar dirA
51
52 rm -f dirA/a
53 decho C2
54 tar -g test.snar -vcf test.2.tar dirA
55
56 mkdir ext
57 rm -rf dirA
58
59 decho E0
60 tar -g test.snar -vxf test.0.tar -C ext/
61 decho E1
62 tar -g test.snar -vxf test.1.tar -C ext/
63
64 decho E2
65 tar -g test.snar -vxf test.2.tar -C ext/
66
67 mkdir ext/dirA/dirB
68 touch ext/dirA/dirB/file
69
70 decho E3
71 tar -g test.snar -vxf test.2.tar -C ext/
72
73 echo FIN
74 test -d dirA && echo >&2 "toplevel dirA exists"
75 exit 0
76 ],
77 [0],
78 [C0
79 dirA/
80 dirA/a
81 dirA/b
82 C1
83 dirA/
84 dirA/c
85 C2
86 dirA/
87 E0
88 dirA/
89 dirA/a
90 dirA/b
91 E1
92 dirA/
93 dirA/c
94 E2
95 dirA/
96 tar: Deleting 'dirA/a'
97 E3
98 dirA/
99 tar: Deleting 'dirA/dirB'
100 FIN
101 ],
102 [C0
103 tar: dirA: Directory is new
104 C1
105 C2
106 E0
107 E1
108 E2
109 E3
110 ],[],[],[gnu, oldgnu, posix])
111
112 AT_CLEANUP
This page took 0.039832 seconds and 5 git commands to generate.