]> Dogcows Code - chaz/tar/blob - tests/extrac18.at
Fix --keep-old-files option.
[chaz/tar] / tests / extrac18.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 #
3 # Test suite for GNU tar.
4 # Copyright (C) 2011 Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 # Description: Check the functionality of the --keep-old-files option.
20 # It should report an error and cause tar to exit with status 2.
21 #
22 # There was a regression in versions 1.23 to 1.26 inclusive, where
23 # this option silently skipped such files.
24 # Reported by: Doug McLaren <dougmc@frenzied.us>,
25 # Gary Partis <gary@partis.co.uk>,
26 # Jim Meyering <jim@meyering.net>
27 #
28 # References: <20111117045433.GA8245@algol.frenzied.us>,
29 # <4F3D824717847C4487F77228F83329A3514CBB@server.Partis.local>,
30 # <87wrar6zzz.fsf@rho.meyering.net>
31
32 AT_SETUP([keep-old-files])
33 AT_KEYWORDS([extract extrac18 old-files keep-old-files])
34
35 AT_TAR_CHECK([
36 mkdir dir
37 cd dir
38 echo 'Old file a' > a
39 echo 'Old file b' > b
40
41 tar cf ../archive .
42
43 rm b
44 echo 'File a' > a
45
46 tar -x -k -f ../archive
47 echo status=$?
48
49 cat a
50 ],
51 [0],
52 [status=2
53 File a
54 ],
55 [tar: ./a: Cannot open: File exists
56 tar: Exiting with failure status due to previous errors
57 ])
58
59 AT_CLEANUP
60
This page took 0.038403 seconds and 5 git commands to generate.