]> git.cworth.org Git - tar/blob - tests/extrac13.at
upstream: Fix extraction of device nodes.
[tar] / tests / extrac13.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright (C) 2010 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 # written by Paul Eggert
20
21 # Check that 'tar' normally does follow symbolic links when extracting,
22 # unless --dereference is specified.
23
24 AT_SETUP([extract over symlinks])
25 AT_KEYWORDS([extract extrac13])
26
27 AT_TAR_CHECK([
28 mkdir src dst1 dst2 dst3
29 echo file1 >src/file1
30 ln -s target1 dst1/file1
31 echo target1 >dst1/target1
32 echo target1 >target1
33
34 tar -cf archive.tar -C src . &&
35 tar -xf archive.tar -C dst1 --warning=no-timestamp &&
36 diff -c src/file1 dst1/file1 &&
37 diff -c target1 dst1/target1
38
39 ln -s target1 dst2/file1
40 echo target1 >dst2/target1
41 tar --overwrite -xf archive.tar -C dst2 --warning=no-timestamp &&
42 diff -c src/file1 dst2/file1 &&
43 diff -c target1 dst2/target1
44
45 ln -s target1 dst3/file1
46 echo target1 >dst3/target1
47 tar --overwrite -xhf archive.tar -C dst3 --warning=no-timestamp &&
48 diff -c src/file1 dst3/file1 &&
49 diff -c src/file1 dst3/target1
50 ],
51 [0],[],[],[],[],[gnu])
52
53 AT_CLEANUP