]> Dogcows Code - chaz/tar/blob - tests/extrac18.at
Update copyright years.
[chaz/tar] / tests / extrac18.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 #
3 # Test suite for GNU tar.
4 # Copyright 2011, 2013-2014 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: Check the functionality of the --keep-old-files option.
22 # It should report an error and cause tar to exit with status 2.
23 #
24 # There was a regression in versions 1.23 to 1.26 inclusive, where
25 # this option silently skipped such files.
26 # Reported by: Doug McLaren <dougmc@frenzied.us>,
27 # Gary Partis <gary@partis.co.uk>,
28 # Jim Meyering <jim@meyering.net>
29 #
30 # References: <20111117045433.GA8245@algol.frenzied.us>,
31 # <4F3D824717847C4487F77228F83329A3514CBB@server.Partis.local>,
32 # <87wrar6zzz.fsf@rho.meyering.net>
33
34 AT_SETUP([keep-old-files])
35 AT_KEYWORDS([extract extrac18 old-files keep-old-files])
36
37 AT_TAR_CHECK([
38 mkdir dir
39 cd dir
40 echo 'Old file a' > a
41 echo 'Old file b' > b
42
43 tar cf ../archive .
44
45 rm b
46 echo 'File a' > a
47
48 tar -x -k -f ../archive
49 echo status=$?
50
51 cat a
52 ],
53 [0],
54 [status=2
55 File a
56 ],
57 [tar: ./a: Cannot open: File exists
58 tar: Exiting with failure status due to previous errors
59 ])
60
61 AT_CLEANUP
62
This page took 0.036477 seconds and 4 git commands to generate.