1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2006 Free Software Foundation, Inc.
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)
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.
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
21 # Using tar 1.15.x the following equivalent command sets:
23 # 1. tar cf archive file1 file2
25 # 2. tar cfT archive /dev/null
26 # tar rf archive file1
27 # tar rt archive file2
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).
34 # <200607210526.AA03440@tamuki.linet.gr.jp>
35 # http://lists.gnu.org/archive/html/bug-tar/2006-07/msg00029.html
37 # The test case below verifies that the equivalent create and append commands
38 # produce binary equivalent archives for all formats.
40 AT_SETUP([append vs. create])
41 AT_KEYWORDS([append append02 append-gnu])
47 # Make sure file timestamps in the archive will not differ
50 # For PAX archives, we need to make sure extended header names are
51 # reproducible and that their contents won't change with time
52 if test $[]TEST_TAR_FORMAT = posix; then
53 TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime"
56 echo Creating archive.1
57 tar $MTIME -cf archive.1 file1 file2
59 echo Creating archive.2
60 tar $MTIME -cf archive.2 -T /dev/null
61 tar $MTIME -rf archive.2 file1
62 tar $MTIME -rf archive.2 file2
64 echo Comparing archives
65 cmp archive.1 archive.2