]> Dogcows Code - chaz/tar/blob - tests/incr07.at
Update copyright years.
[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 A
42 echo 'a' > A/a
43 echo 'a' > A/b
44
45 decho C0
46 tar -g test.snar -vcf test.0.tar A
47
48 echo 'a' > A/c
49 decho C1
50 tar -g test.snar -vcf test.1.tar A
51
52 rm -f A/a
53 decho C2
54 tar -g test.snar -vcf test.2.tar A
55
56 mkdir ext
57 rm -rf A
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/A/B
68 touch ext/A/B/file
69
70 decho E3
71 tar -g test.snar -vxf test.2.tar -C ext/
72
73 echo FIN
74 test -d A && echo >&2 "toplevel A exists"
75 exit 0
76 ],
77 [0],
78 [C0
79 A/
80 A/a
81 A/b
82 C1
83 A/
84 A/c
85 C2
86 A/
87 E0
88 A/
89 A/a
90 A/b
91 E1
92 A/
93 A/c
94 E2
95 A/
96 tar: Deleting 'A/a'
97 E3
98 A/
99 tar: Deleting 'A/B'
100 FIN
101 ],
102 [C0
103 tar: A: 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.033425 seconds and 4 git commands to generate.