2 # This file is part of GNU tar testsuite.
3 # Copyright (C) 2004 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 # Check if listed-incremental backups work for files moved from one directory
22 # Based on a script by Martin Simmons <ZYHYLCRMZPRP@spammotel.com>
24 # <20040626230315.163AA1D148@cpc5-cmbg1-6-0-cust208.cmbg.cable.ntl.com>
25 # http://lists.gnu.org/archive/html/bug-tar/2004-06/msg00028.html
28 TAR_ARCHIVE_FORMATS
="gnu oldgnu"
33 echo Create directories
41 for file in tart
/a1 tart
/b1 tart
/c
0/cq1 tart
/c
0/cq2 tart
/c
1/ca1 tart
/c
1/ca2
43 echo File
$file > $file
48 echo Creating main archive
49 tar -c -v --listed-incremental=tart.incr1
-f archive
.1 tart
52 echo Modifying filesystem
58 echo Directory contents
62 echo Creating incremental archive
63 cp -p tart.incr1 tart.incr2
64 tar -c -v --listed-incremental=tart.incr2
-f archive
.2 tart
69 echo Extracting main archive
70 tar -x -v --listed-incremental=tart.incr1
-f archive
.1
71 echo Extracting incremental archive
72 # This command should produce three messages about deletion
73 # of the existing files, that may appear in any order. Piping
74 # to sort makes sure we don't depend on any particular ordering.
75 tar -x -v --listed-incremental=tart.incr2
-f archive
.2 | sort
80 err
="tar: tart/c0: Directory is new
81 tar: tart/c1: Directory is new
82 tar: tart/c2: Directory is new
85 out
="Create directories
107 Creating incremental archive
115 Extracting main archive
125 Extracting incremental archive
126 tar: Deleting \`tart/a1'
127 tar: Deleting \`tart/b1'
128 tar: Deleting \`tart/c1'