]> Dogcows Code - chaz/tar/blob - tests/append02.at
New test case
[chaz/tar] / tests / append02.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright (C) 2006 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 2, 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, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21 # Using tar 1.15.x the following equivalent command sets:
22 #
23 # 1. tar cf archive file1 file2
24 # and
25 # 2. tar cfT archive /dev/null
26 # tar rf archive file1
27 # tar rt archive file2
28 #
29 # produced different archives (GNU format is assumed). Namely, in the
30 # second case the mode field of all members, except the first, was truncated
31 # to lower 3 octets (& 0777).
32 #
33 # References:
34 # <200607210526.AA03440@tamuki.linet.gr.jp>
35 # http://lists.gnu.org/archive/html/bug-tar/2006-07/msg00029.html
36
37 # The test case below verifies that the equivalent create and append commands
38 # produce binary equivalent archives for all formats.
39
40 AT_SETUP([append vs. create])
41 AT_KEYWORDS([append append02 append-gnu])
42
43 AT_TAR_CHECK([
44 genfile --file file1
45 genfile --file file2
46
47 # For PAX archives, we need to make sure extended header names are
48 # reproducible.
49 if test $[]TEST_TAR_FORMAT = posix; then
50 TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f"
51 fi
52
53 echo Creating archive.1
54 tar cf archive.1 file1 file2
55
56 echo Creating archive.2
57 tar cfT archive.2 /dev/null
58 tar rf archive.2 file1
59 tar rf archive.2 file2
60
61 echo Comparing archives
62 cmp archive.1 archive.2
63 ],
64 [0],
65 [Creating archive.1
66 Creating archive.2
67 Comparing archives
68 ])
69
70 AT_CLEANUP
71
72 # End of append02.at
This page took 0.038303 seconds and 5 git commands to generate.