1# Process this file with autom4te to create testsuite. -*- Autotest -*- 2# Test suite for GNU tar. 3# Copyright 2009-2021 Free Software Foundation, Inc. 4# 5# GNU tar 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 3 of the License, or 8# (at your option) any later version. 9# 10# GNU tar 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. 14# 15# You should have received a copy of the GNU General Public License 16# along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18AT_SETUP([incremental restores with -C]) 19AT_KEYWORDS([incremental extract incr07 chdir]) 20 21# Tar 1.26 had problems extracting from incremental restores when given 22# the -C option. The code in incremen.c:try_purge_directory and 23# misc.c:remove_any_file was using savedir(), which ignored eventual changes 24# in the current working directory and caused the malfunctioning. 25# 26# The problem was reported by Piotr Rotter on 2013-03-22. 27# 28# This testcase is based on scripts provided by Piotr Rotter and Nathan 29# Stratton Treadway. 30# 31# References: <514C8F56.90900@active24.pl>, 32# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00036.html, 33# <20130326181922.GZ3732@shire.ontko.com>, 34# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00042.html, 35# <20130327051828.GA3732@shire.ontko.com>, 36# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00043.html, 37# <20130327054957.GB3732@shire.ontko.com>, 38# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00044.html 39 40AT_TAR_CHECK([ 41AT_CHECK_TIMESTAMP 42mkdir dirA 43echo 'a' > dirA/a 44echo 'a' > dirA/b 45 46decho C0 47tar -g test.snar -vcf test.0.tar dirA 48 49echo 'a' > dirA/c 50decho C1 51tar -g test.snar -vcf test.1.tar dirA 52 53rm -f dirA/a 54decho C2 55tar -g test.snar -vcf test.2.tar dirA 56 57mkdir ext 58rm -rf dirA 59 60decho E0 61tar -g test.snar -vxf test.0.tar -C ext/ 62decho E1 63tar -g test.snar -vxf test.1.tar -C ext/ 64 65decho E2 66tar -g test.snar -vxf test.2.tar -C ext/ 67 68mkdir ext/dirA/dirB 69touch ext/dirA/dirB/file 70 71decho E3 72tar -g test.snar -vxf test.2.tar -C ext/ 73 74echo FIN 75test -d dirA && echo >&2 "toplevel dirA exists" 76exit 0 77], 78[0], 79[C0 80dirA/ 81dirA/a 82dirA/b 83C1 84dirA/ 85dirA/c 86C2 87dirA/ 88E0 89dirA/ 90dirA/a 91dirA/b 92E1 93dirA/ 94dirA/c 95E2 96dirA/ 97tar: Deleting 'dirA/a' 98E3 99dirA/ 100tar: Deleting 'dirA/dirB' 101FIN 102], 103[C0 104tar: dirA: Directory is new 105C1 106C2 107E0 108E1 109E2 110E3 111],[],[],[gnu, oldgnu, posix]) 112 113AT_CLEANUP 114