Debian Codegraph @

tests/rename06.at

raw
1 # Test suite for GNU tar.
2 # Copyright 2020-2023 Free Software Foundation, Inc.
3 #
4 # This file is part of GNU tar.
5 #
6 # GNU tar 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 3 of the License, or
9 # (at your option) any later version.
10 #
11 # GNU tar 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, see <http://www.gnu.org/licenses/>.
18
19 AT_SETUP([chained renames])
20 AT_KEYWORDS([incremental rename06 rename])
21
22 # Description: test whether chained renames are processed correctly
23 # during the incremental archive creation. Tar 1.32.90 failed to
24 # encode them.
25 # Reported by: Deweloper <[email protected]>
26 # References: <[email protected]>,
27 # https://lists.gnu.org/archive/html/bug-tar/2020-02/msg00008.html
28
29 AT_TAR_CHECK([
30 AT_SORT_PREREQ
31 decho Creating directory structure
32 mkdir test test/d1 test/d2
33 genfile --file test/d1/file1
34 genfile --file test/d2/file2
35
36 decho First dump
37 tar -c -g 0.snar -C test -f backup0.tar .
38
39 decho Altering directory structure
40 genfile --file test/d2/file3
41 mv test/d1 test/d3
42 mv test/d2 test/d1
43
44 decho Second dump
45 cp 0.snar 1.snar
46 tar -vc -g 1.snar -C test -f backup1.tar .
47
48 mkdir test1
49
50 decho First extract
51 tar -C test1 -x -g /dev/null -f backup0.tar
52
53 decho Second extract
54 tar -C test1 -x -g /dev/null -f backup1.tar
55
56 decho Resulting directory
57 find test1 | sort
58 ],
59 [0],
60 [Creating directory structure
61 First dump
62 Altering directory structure
63 Second dump
64 ./
65 ./d1/
66 ./d3/
67 ./d1/file3
68 First extract
69 Second extract
70 Resulting directory
71 test1
72 test1/d1
73 test1/d1/file2
74 test1/d1/file3
75 test1/d3
76 test1/d3/file1
77 ],
78 [Creating directory structure
79 First dump
80 Altering directory structure
81 Second dump
82 tar: ./d1: Directory has been renamed from './d2'
83 tar: ./d3: Directory has been renamed from './d1'
84 First extract
85 Second extract
86 Resulting directory
87 ],[],[],[gnu, oldgnu, posix])
88 AT_CLEANUP