| 1 |
# Process this file with autom4te to create testsuite. -*- Autotest -*- |
| 2 |
# |
| 3 |
# Test suite for GNU tar. |
| 4 |
# Copyright 2013-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 |
# The --exclude-tag options interacted incorrectly with --listed-incremental |
| 22 |
# since their very inception. The testcases exclude08 through exclude16 |
| 23 |
# verify that --exclude-tag operates consistently whether or not |
| 24 |
# --listed-incremental option is given. |
| 25 |
# |
| 26 |
# This testcase verifies whether the --exclude-tag-all option works |
| 27 |
# as expected when used together with --listed-incremental. If the |
| 28 |
# exclusion tag is created after the level 0 dump, the level 1 dump |
| 29 |
# must skip the entire affected subdirectory and any previously-included |
| 30 |
# files within it. |
| 31 |
# |
| 32 |
# Reported-by: Nathan Stratton Treadway <[email protected]> |
| 33 |
# Last-Affected-Version: 1.26 |
| 34 |
# References: <[email protected]>, |
| 35 |
# <[email protected]>, |
| 36 |
# http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00013.html |
| 37 |
|
| 38 |
AT_SETUP([--exclude-tag-all option in incremental pass]) |
| 39 |
AT_KEYWORDS([exclude exclude-tag exclude-tag-all listed incremental exclude16]) |
| 40 |
|
| 41 |
AT_TAR_CHECK([ |
| 42 |
AT_SORT_PREREQ |
| 43 |
mkexcltest etest |
| 44 |
rm etest/subdir/excludeme |
| 45 |
decho "# Level 0" |
| 46 |
tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort |
| 47 |
touch etest/subdir/excludeme |
| 48 |
touch etest/subdir/otherfile |
| 49 |
|
| 50 |
decho "# Level 1" |
| 51 |
cp snar-0 snar-1 |
| 52 |
tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort |
| 53 |
], |
| 54 |
[0], |
| 55 |
[# Level 0 |
| 56 |
etest/ |
| 57 |
etest/subdir/ |
| 58 |
etest/subdir/subdir-file |
| 59 |
etest/top-level-file |
| 60 |
# Level 1 |
| 61 |
etest/ |
| 62 |
], |
| 63 |
[# Level 0 |
| 64 |
tar: etest: Directory is new |
| 65 |
tar: etest/subdir: Directory is new |
| 66 |
# Level 1 |
| 67 |
tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped |
| 68 |
],[],[],[gnu]) |
| 69 |
|
| 70 |
AT_CLEANUP |
| 71 |
|