| 1 |
# Process this file with autom4te to create testsuite. -*- Autotest -*- |
| 2 |
|
| 3 |
# Test suite for GNU tar. |
| 4 |
# Copyright 2006-2023 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: Handling of cyclic renames in incremental archives. |
| 22 |
|
| 23 |
AT_SETUP([cyclic renames]) |
| 24 |
AT_KEYWORDS([incremental rename rename03 cyclic-rename]) |
| 25 |
|
| 26 |
AT_TAR_CHECK([ |
| 27 |
AT_SORT_PREREQ |
| 28 |
|
| 29 |
mkdir foo |
| 30 |
genfile --file foo/file1 |
| 31 |
genfile --file foo/file2 |
| 32 |
|
| 33 |
mkdir foo/a |
| 34 |
genfile --file foo/a/filea |
| 35 |
|
| 36 |
mkdir foo/b |
| 37 |
genfile --file foo/b/fileb |
| 38 |
|
| 39 |
mkdir foo/c |
| 40 |
genfile --file foo/c/filec |
| 41 |
|
| 42 |
sleep 1 |
| 43 |
|
| 44 |
echo "First dump" |
| 45 |
echo "First dump">&2 |
| 46 |
tar -g incr -cf arch.1 -v foo 2>tmperr |
| 47 |
sort tmperr >&2 |
| 48 |
|
| 49 |
# Shuffle directories: |
| 50 |
(cd foo |
| 51 |
mv a $$ |
| 52 |
mv c a |
| 53 |
mv b c |
| 54 |
mv $$ b) |
| 55 |
|
| 56 |
echo "Second dump" |
| 57 |
echo "Second dump" >&2 |
| 58 |
tar -g incr -cf arch.2 -v foo 2>tmperr |
| 59 |
sort tmperr >&2 |
| 60 |
|
| 61 |
tar xfg arch.1 /dev/null --warning=no-timestamp |
| 62 |
|
| 63 |
echo "Begin directory listing 1" |
| 64 |
find foo | sort |
| 65 |
echo "End directory listing 1" |
| 66 |
|
| 67 |
tar xfgv arch.2 /dev/null --warning=no-timestamp |
| 68 |
echo Begin directory listing 2 |
| 69 |
find foo | sort |
| 70 |
echo End directory listing 2 |
| 71 |
], |
| 72 |
[0], |
| 73 |
[First dump |
| 74 |
foo/ |
| 75 |
foo/a/ |
| 76 |
foo/b/ |
| 77 |
foo/c/ |
| 78 |
foo/file1 |
| 79 |
foo/file2 |
| 80 |
foo/a/filea |
| 81 |
foo/b/fileb |
| 82 |
foo/c/filec |
| 83 |
Second dump |
| 84 |
foo/ |
| 85 |
foo/a/ |
| 86 |
foo/b/ |
| 87 |
foo/c/ |
| 88 |
Begin directory listing 1 |
| 89 |
foo |
| 90 |
foo/a |
| 91 |
foo/a/filea |
| 92 |
foo/b |
| 93 |
foo/b/fileb |
| 94 |
foo/c |
| 95 |
foo/c/filec |
| 96 |
foo/file1 |
| 97 |
foo/file2 |
| 98 |
End directory listing 1 |
| 99 |
foo/ |
| 100 |
foo/a/ |
| 101 |
foo/b/ |
| 102 |
foo/c/ |
| 103 |
Begin directory listing 2 |
| 104 |
foo |
| 105 |
foo/a |
| 106 |
foo/a/filec |
| 107 |
foo/b |
| 108 |
foo/b/filea |
| 109 |
foo/c |
| 110 |
foo/c/fileb |
| 111 |
foo/file1 |
| 112 |
foo/file2 |
| 113 |
End directory listing 2 |
| 114 |
], |
| 115 |
[First dump |
| 116 |
tar: foo/a: Directory is new |
| 117 |
tar: foo/b: Directory is new |
| 118 |
tar: foo/c: Directory is new |
| 119 |
tar: foo: Directory is new |
| 120 |
Second dump |
| 121 |
tar: foo/a: Directory has been renamed from 'foo/c' |
| 122 |
tar: foo/b: Directory has been renamed from 'foo/a' |
| 123 |
tar: foo/c: Directory has been renamed from 'foo/b' |
| 124 |
], |
| 125 |
[],[],[gnu, oldgnu, posix]) |
| 126 |
|
| 127 |
AT_CLEANUP |
| 128 |
|
| 129 |
# End of rename03.at |