]> Dogcows Code - chaz/tar/blob - tests/incr07.at
Take into account chdir_fd when extracting from incremental dumps.
[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 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 mkdir ext/A/B
65 touch ext/A/B/file
66
67 decho E2
68 tar -g test.snar -vxf test.2.tar -C ext/
69
70 echo FIN
71 test -d A && echo >&2 "toplevel A exists"
72 exit 0
73 ],
74 [0],
75 [C0
76 A/
77 A/a
78 A/b
79 C1
80 A/
81 A/c
82 C2
83 A/
84 E0
85 A/
86 A/a
87 A/b
88 E1
89 A/
90 A/c
91 E2
92 A/
93 tar: Deleting 'A/a'
94 tar: Deleting 'A/B'
95 FIN
96 ],
97 [C0
98 tar: A: Directory is new
99 C1
100 C2
101 E0
102 E1
103 E2
104 ],[],[],[gnu, oldgnu, posix])
105
106 AT_CLEANUP
This page took 0.040508 seconds and 4 git commands to generate.