1# Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3# Test suite for GNU tar.
4# Copyright 2008-2021 Free Software Foundation, Inc.
5
6# This file is part of GNU tar.
7
8# GNU tar is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 3 of the License, or
11# (at your option) any later version.
12
13# GNU tar is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21# Description: Up to version 1.20, when storing a record for renamed
22# directory in an incremental archive, tar incorrectly flagged all its
23# subdirectories as renamed, which led to problems at archive extraction.
24# References: <00a401c8ecc0$56b7ef30$6a17a8c0@inti.com>
25# Reported by: Enric Hernandez <ehernandez@notariado.org>
26
27AT_SETUP([renamed directory containing subdirectories])
28AT_KEYWORDS([incremental rename04 rename])
29
30AT_TAR_CHECK([
31AT_SORT_PREREQ
32
33decho Creating directory structure
34mkdir directory
35mkdir directory/subdir
36genfile --file=directory/file
37
38decho Creating initial archive
39tar -cf archive.1 -g db.1 directory
40
41decho Renaming
42mv directory dir
43
44decho Creating incremental archive
45cp db.1 db.2
46tar -cf archive.2 -g db.2 dir
47
48mv dir orig
49
50decho First restore
51tar -xf archive.1 -g db.1
52find directory | sort
53
54decho Second restore
55tar -xf archive.2 -g db.2
56find dir | sort
57],
58[0],
59[Creating directory structure
60Creating initial archive
61Renaming
62Creating incremental archive
63First restore
64directory
65directory/file
66directory/subdir
67Second restore
68dir
69dir/subdir
70],
71[Creating directory structure
72Creating initial archive
73Renaming
74Creating incremental archive
75First restore
76Second restore
77],[],[],[gnu, oldgnu, posix])
78
79AT_CLEANUP
80
81# End of rename04.at
82