1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2004 Free Software Foundation, Inc.
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)
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.
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
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([listed02])
33 echo Create directories
41 for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
43 echo File $file > $file
48 echo Creating main archive
49 tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart || exit 1
52 echo Modifying filesystem
55 # Current incremental backup algorithm is not able to cope with
56 # renamed files on filesystems that do not change ctime when
57 # renaming. So, if we're on such filesystem, we skip this test.
58 CTIME=`genfile --stat=ctime tart/b1`
60 if test $CTIME -eq `genfile --stat=ctime tart/b2`; then
67 echo Directory contents
68 find tart -print | sort 2>/dev/null
71 echo 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 tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
80 echo Extracting incremental archive
81 # This command should produce three messages about deletion
82 # of the existing files, that may appear in any order. Piping
83 # to sort makes sure we don't depend on any particular ordering.
84 tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
87 find tart -print | sort 2>/dev/null
112 Creating incremental archive
120 Extracting main archive
130 Extracting incremental archive
131 tar: Deleting `tart/a1'
132 tar: Deleting `tart/b1'
133 tar: Deleting `tart/c1'
152 [tar: tart/c0: Directory is new
153 tar: tart/c1: Directory is new
154 tar: tart/c2: Directory is new