1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright 2004-2019 Free Software Foundation, Inc.
6 # This file is part of GNU tar.
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.
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.
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/>.
21 # Check if listed-incremental backups work for files moved from one directory
23 # Based on a script by Martin Simmons <ZYHYLCRMZPRP@spammotel.com>
25 # <20040626230315.163AA1D148@cpc5-cmbg1-6-0-cust208.cmbg.cable.ntl.com>
26 # http://lists.gnu.org/archive/html/bug-tar/2004-06/msg00028.html
28 AT_SETUP([working --listed])
29 AT_KEYWORDS([listed incremental listed02])
34 echo Create directories
43 for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
45 echo File $file > $file
50 echo Creating main archive
51 echo >&2 "Creating main archive"
52 tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
54 # The above prints two lines to stderr announcing the new directories c0 and c1.
55 # Ensure that they appear in this script's stderr in sorted order.
56 sort err 1>&2; rm -f err
59 echo Modifying filesystem
66 echo Directory contents
67 find tart -print | sort 2>/dev/null
70 echo Creating incremental archive
71 echo >&2 "Creating incremental archive"
72 cp -p tart.incr1 tart.incr2
73 tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
78 echo Extracting main archive
79 echo >&2 "Extracting main archive"
80 tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
81 echo Extracting incremental archive
82 # This command should produce three messages about deletion
83 # of the existing files, that may appear in any order. Piping
84 # to sort makes sure we don't depend on any particular ordering.
85 tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
88 find tart -print | sort 2>/dev/null
113 Creating incremental archive
119 Extracting main archive
129 Extracting incremental archive
130 tar: Deleting 'tart/a1'
131 tar: Deleting 'tart/b1'
148 [Creating main archive
149 tar: tart/c0: Directory is new
150 tar: tart/c1: Directory is new
151 tar: tart: Directory is new
152 Creating incremental archive
153 tar: tart/c2: Directory has been renamed from 'tart/c1'
154 Extracting main archive