1# Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3# Test suite for GNU tar.
4# Copyright (C) 2006 Free Software Foundation, Inc.
5
6# This program 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 2, or (at your option)
9# any later version.
10
11# This program 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, write to the Free Software
18# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19# 02110-1301, USA.
20
21# Description: Incremental restore malfunctions if an archive member
22# changes type before restoration, e.g. from directory to file or vice
23# versa.
24# Reported by: Wolfram Kleff <bugreport@wkleff.intergenia.de>
25# References: <200605101232.25031.bugreport@wkleff.intergenia.de>
26
27AT_SETUP([changed file types in incrementals])
28AT_KEYWORDS([incremental chtype])
29
30AT_TAR_CHECK([
31AT_SORT_PREREQ
32AT_TAR_MKHIER([directory/b/c],[x])
33mkdir directory/a
34genfile --file directory/a/a
35
36echo First backup
37tar --create --file=archive.1 --listed-incremental=db.1 directory
38
39sleep 2
40
41# Remove directory b and create a file with this name.
42# Previous versions were not able to restore over this file.
43rm -r directory/b
44genfile --file directory/b
45genfile --file directory/a/b
46
47echo Second backup
48tar --create --file=archive.2 --listed-incremental=db.2 directory
49
50# Delete a
51rm -r directory
52
53echo Restore archive.1
54tar -xf archive.1 --listed-incremental=/dev/null
55echo Restore archive.2
56tar -xf archive.2 --listed-incremental=/dev/null
57find directory | sort
58],
59[0],
60[First backup
61Second backup
62Restore archive.1
63Restore archive.2
64directory
65directory/a
66directory/a/a
67directory/a/b
68directory/b
69],[],[],[],[gnu, oldgnu, posix])
70
71AT_CLEANUP
72
73# End of chtype.at
74