#! /bin/sh
## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi
DUALCASE=1; export DUALCASE # for MKS sh

# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi


# Work around bugs in pre-3.0 UWIN ksh.
$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
for as_var in \
  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  LC_TELEPHONE LC_TIME
do
  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
    eval $as_var=C; export $as_var
  else
    $as_unset $as_var
  fi
done

# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi


# Name of the executable.
as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)$' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
  	  /^X\/\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`


# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conf$$.sh
  echo  "exit 0"   >>conf$$.sh
  chmod +x conf$$.sh
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conf$$.sh
fi


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  case $0 in
    *[\\/]* ) as_myself=$0 ;;
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done

       ;;
  esac
  # We did not find ourselves, most probably we were run as `sh COMMAND'
  # in which case we are not to be found in the path.
  if test "x$as_myself" = x; then
    as_myself=$0
  fi
  if test ! -f "$as_myself"; then
    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  # uniformly replaced by the line number.  The first 'sed' inserts a
  # line-number line before each line; the second 'sed' does the real
  # work.  The second script uses 'N' to pair each line-number line
  # with the numbered line, and appends trailing '-' during
  # substitution so that $LINENO is not a special case at line end.
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  sed '=' <$as_myself |
    sed '
      N
      s,$,-,
      : loop
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
      t loop
      s,-$,,
      s,^['$as_cr_digits']*\n,,
    ' >$as_me.lineno &&
  chmod +x $as_me.lineno ||
    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
   { (exit 1); exit 1; }; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensible to this).
  . ./$as_me.lineno
  # Exit status is that of the last command.
  exit
}


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T='	' ;;
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  # We could just check for DJGPP; but this test a) works b) is more generic
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  if test -f conf$$.exe; then
    # Don't use ln at all; we don't have any links
    as_ln_s='cp -p'
  else
    as_ln_s='ln -s'
  fi
elif ln conf$$.file conf$$ 2>/dev/null; then
  as_ln_s=ln
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.file

if mkdir -p . 2>/dev/null; then
  as_mkdir_p=:
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

as_executable_p="test -f"

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"


# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
'
IFS=" 	$as_nl"

# CDPATH.
$as_unset CDPATH


SHELL=${CONFIG_SHELL-/bin/sh}

# How were we run?
at_cli_args="$@"

# Load the config file.
for at_file in atconfig atlocal
do
  test -r $at_file || continue
  . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2
   { (exit 1); exit 1; }; }
done

# atconfig delivers paths relative to the directory the test suite is
# in, but the groups themselves are run in testsuite-dir/group-dir.
if test -n "$at_top_srcdir"; then
  builddir=../..
  for at_dir in srcdir top_srcdir top_builddir
  do
    at_val=`eval echo '${'at_$at_dir'}'`
    eval "$at_dir=\$at_val/../.."
  done
fi

# Not all shells have the 'times' builtin; the subshell is needed to make
# sure we discard the 'times: not found' message from the shell.
at_times_p=false
(times) >/dev/null 2>&1 && at_times_p=:

# CLI Arguments to pass to the debugging scripts.
at_debug_args=
# -e sets to true
at_errexit_p=false
# Shall we be verbose?
at_verbose=:
at_quiet=echo

# Shall we keep the debug scripts?  Must be `:' when the suite is
# run by a debug script, so that the script doesn't remove itself.
at_debug_p=false
# Display help message?
at_help_p=false
# List test groups?
at_list_p=false
# Test groups to run
at_groups=

# The directory we are in.
at_dir=`pwd`
# The directory the whole suite works in.
# Should be absolutely to let the user `cd' at will.
at_suite_dir=$at_dir/$as_me.dir
# The file containing the suite.
at_suite_log=$at_dir/$as_me.log
# The file containing the location of the last AT_CHECK.
at_check_line_file=$at_suite_dir/at-check-line
# The file containing the exit status of the last command.
at_status_file=$at_suite_dir/at-status
# The files containing the output of the tested commands.
at_stdout=$at_suite_dir/at-stdout
at_stder1=$at_suite_dir/at-stder1
at_stderr=$at_suite_dir/at-stderr
# The file containing dates.
at_times_file=$at_suite_dir/at-times

# List of the tested programs.
at_tested='tar'
# List of the all the test groups.
at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61'
# As many dots as there are digits in the last test group number.
# Used to normalize the test group numbers so that `ls' lists them in
# numerical order.
at_format='..'
# Description of all the test groups.
at_help_all='1;version.at:19;tar version;;
2;pipe.at:29;decompressing from stdin;pipe;
3;options.at:24;mixing options;options options00;
4;options02.at:26;interspersed options;options options02;
5;append.at:21;append;append append00;
6;append01.at:29;appending files with long names;append append01;
7;delete01.at:23;deleting a member after a big one;delete delete01;
8;delete02.at:23;deleting a member from stdin archive;delete delete02;
9;delete03.at:21;deleting members with long names;delete delete03;
10;delete04.at:23;deleting a large last member;delete delete04;
11;delete05.at:27;deleting non-existing member;delete delete05;
12;extrac01.at:23;extract over an existing directory;extract extract01;
13;extrac02.at:23;extracting symlinks over an existing file;extract extract02;
14;extrac03.at:23;extraction loops;extract extract03;
15;extrac04.at:23;extract + fnmatch;extract extract04;
16;extrac05.at:30;extracting selected members from pax;extract extract05;
17;extrac06.at:33;mode of extracted directories;extract extract06;
18;gzip.at:23;gzip;gzip;
19;incremental.at:23;incremental;incremental incr00;
20;incr01.at:27;restore broken symlinks from incremental;incremental incr01;
21;incr02.at:32;restoring timestamps from incremental;incremental timestamp restore incr02;
22;listed01.at:26;--listed for individual files;listed incremental listed01;
23;listed02.at:28;working --listed;listed incremental listed02;
24;incr03.at:28;renamed files in incrementals;incremental incr03 rename;
25;incr04.at:29;proper icontents initialization;incremental incr04 icontents;
26;rename01.at:24;renamed dirs in incrementals;incremental rename rename01;
27;rename02.at:24;move between hierarchies;incremental rename rename02;
28;rename03.at:23;cyclic renames;incremental rename rename03 cyclic-rename;
29;chtype.at:27;changed file types in incrementals;incremental chtype;
30;ignfail.at:23;ignfail;ignfail;
31;link01.at:33;link count gt 2;link01;
32;longv7.at:24;long names in V7 archives;longname longv7;
33;long01.at:28;long file names divisible by block size;longname long512;
34;lustar01.at:21;ustar: unsplittable file name;longname ustar lustar01;
35;lustar02.at:21;ustar: unsplittable path name;longname ustar lustar02;
36;lustar03.at:21;ustar: splitting long names;longname ustar lustar03;
37;multiv01.at:23;multivolume dumps from pipes;multivolume multiv multiv01;
38;multiv02.at:28;skipping a straddling member;multivolume multiv multiv02;
39;multiv03.at:30;MV archive & long filenames;multivolume multiv multiv03;
40;multiv04.at:36;split directory members in a MV archive;multivolume multiv incremental multiv04;
41;old.at:23;old archives;old;
42;recurse.at:21;recurse;recurse;
43;same-order01.at:26;working -C with --same-order;same-order same-order01;
44;same-order02.at:25;multiple -C options;same-order same-order02;
45;shortrec.at:25;short records;shortrec.at;
46;sparse01.at:21;sparse files;sparse sparse01;
47;sparse02.at:21;extracting sparse file over a pipe;sparse sparse02;
48;sparse03.at:21;storing sparse files > 8G;sparse sparse03;
49;sparsemv.at:21;sparse files in MV archives;sparse multiv sparsemv;
50;sparsemvp.at:21;sparse files in PAX MV archives;sparse multiv sparsemvp;
51;update.at:27;update unchanged directories;update;
52;volume.at:23;volume;volume volcheck;
53;volsize.at:29;volume header size;volume volsize;
54;comprec.at:21;compressed format recognition;comprec;
55;truncate.at:28;truncate;truncated files;
56;gtarfail.at:21;gtarfail;star gtarfail;
57;gtarfail2.at:21;gtarfail2;star gtarfail2;
58;multi-fail.at:21;multi-fail;star multivolume multiv multi-fail;
59;ustar-big-2g.at:21;ustar-big-2g;star ustar-big-2g;
60;ustar-big-8g.at:21;ustar-big-8g;star ustar-big-8g;
61;pax-big-10g.at:21;pax-big-10g;star pax-big-10g;
'

at_keywords=
at_prev=
for at_option
do
  # If the previous option needs an argument, assign it.
  if test -n "$at_prev"; then
    at_option=$at_prev=$at_option
    at_prev=
  fi

  at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'`

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case $at_option in
    --help | -h )
	at_help_p=:
	;;

    --list | -l )
	at_list_p=:
	;;

    --version | -V )
	echo "$as_me (GNU tar 1.15.91)"
	exit 0
	;;

    --clean | -c )
	rm -rf $at_suite_dir $at_suite_log
	exit 0
	;;

    --debug | -d )
	at_debug_p=:
	;;

    --errexit | -e )
	at_debug_p=:
	at_errexit_p=:
	;;

    --verbose | -v )
	at_verbose=echo; at_quiet=:
	;;

    --trace | -x )
	at_traceon='set -vx'; at_traceoff='set +vx'
	;;

    [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
	at_groups="$at_groups$at_option "
	;;

    # Ranges
    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
	at_range_start=`echo $at_option |tr -d '-'`
	at_range=`echo " $at_groups_all " | \
	  sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'`
	at_groups="$at_groups$at_range "
	;;

    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
	at_range_end=`echo $at_option |tr -d '-'`
	at_range=`echo " $at_groups_all " | \
	  sed -e 's, '$at_range_end' .*$, '$at_range_end','`
	at_groups="$at_groups$at_range "
	;;

    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
	at_range_start=`echo $at_option |sed 's,-.*,,'`
	at_range_end=`echo $at_option |sed 's,.*-,,'`
	# FIXME: Maybe test to make sure start <= end?
	at_range=`echo " $at_groups_all " | \
	  sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \
	      -e 's, '$at_range_end' .*$, '$at_range_end','`
	at_groups="$at_groups$at_range "
	;;

    # Keywords.
    --keywords | -k )
	at_prev=--keywords
	;;
    --keywords=* )
	at_keywords="$at_keywords,$at_optarg"
	;;

    *=*)
  	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
  	# Reject names that are not valid shell variable names.
  	expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
  	  { echo "$as_me: error: invalid variable name: $at_envvar" >&2
   { (exit 1); exit 1; }; }
  	at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
  	eval "$at_envvar='$at_value'"
  	export $at_envvar
	# Propagate to debug scripts.
  	at_debug_args="$at_debug_args $at_option"
  	;;

     *) echo "$as_me: invalid option: $at_option" >&2
	echo "Try \`$0 --help' for more information." >&2
	exit 1
	;;
  esac
done

# Process the --keywords
if test -n "$at_keywords"; then
  at_groups_selected=$at_help_all
  for at_keyword in `IFS=,; set X $at_keywords; shift; echo ${1+$@}`
  do
    # It is on purpose that we match the test group titles too.
    at_groups_selected=`echo "$at_groups_selected" |
			grep -i "^[^;]*;[^;]*.*[; ]$at_keyword[ ;]"`
  done
  at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'`
  # Smash the end of lines.
  at_groups_selected=`echo $at_groups_selected`
  at_groups="$at_groups$at_groups_selected "
fi

# Selected test groups.
test -z "$at_groups" && at_groups=$at_groups_all

# Help message.
if $at_help_p; then
  cat <<_ATEOF
Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]

Run all the tests, or the selected TESTS, and save a detailed log file.
Upon failure, create debugging scripts.

You should not change environment variables unless explicitly passed
as command line arguments.  Set \`AUTOTEST_PATH' to select the executables
to exercise.  Each relative directory is expanded as build and source
directories relatively to the top level of this distribution.  E.g.,

  $ $0 AUTOTEST_PATH=bin

possibly amounts into

  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH
_ATEOF
cat <<_ATEOF

Operation modes:
  -h, --help     print the help message, then exit
  -V, --version  print version number, then exit
  -c, --clean    remove all the files this test suite might create and exit
  -l, --list     describes all the tests, or the selected TESTS
_ATEOF
cat <<_ATEOF

Execution tuning:
  -k, --keywords=KEYWORDS
	         select the tests matching all the comma separated KEYWORDS
	         accumulates
  -e, --errexit  abort as soon as a test fails; implies --debug
  -v, --verbose  force more detailed output
	         default for debugging scripts
  -d, --debug    inhibit clean up and debug script creation
	         default for debugging scripts
  -x, --trace    enable tests shell tracing
_ATEOF
cat <<_ATEOF

Report bugs to <bug-tar@gnu.org>.
_ATEOF
  exit 0
fi

# List of tests.
if $at_list_p; then
  cat <<_ATEOF
GNU tar 1.15.91 test suite test groups:

 NUM: FILENAME:LINE      TEST-GROUP-NAME
      KEYWORDS

_ATEOF
  # "  1 42  45 " => "^(1|42|45);".
  at_groups_pattern=`echo "$at_groups" | sed 's/^  *//;s/  *$//;s/  */|/g'`
  echo "$at_help_all" |
    awk 'BEGIN { FS = ";" }
	 { if ($1 !~ /^('"$at_groups_pattern"')$/) next }
	 { if ($1) printf " %3d: %-18s %s\n", $1, $2, $3
	   if ($4) printf "      %s\n", $4 } '
  exit 0
fi

# Don't take risks: use only absolute directories in PATH.
#
# For stand-alone test suites, AUTOTEST_PATH is relative to `.'.
#
# For embedded test suites, AUTOTEST_PATH is relative to the top level
# of the package.  Then expand it into build/src parts, since users
# may create executables in both places.
#
# There might be directories that don't exist, but don't redirect
# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
AUTOTEST_PATH=`echo $AUTOTEST_PATH | tr ':' $PATH_SEPARATOR`
at_path=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $AUTOTEST_PATH $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  case $as_dir in
  [\\/]* | ?:[\\/]* )
    at_path=$at_path$PATH_SEPARATOR$as_dir
    ;;
  * )
    if test -z "$at_top_builddir"; then
      # Stand-alone test suite.
      at_path=$at_path$PATH_SEPARATOR$as_dir
    else
      # Embedded test suite.
      at_path=$at_path$PATH_SEPARATOR$at_top_builddir/$as_dir
      at_path=$at_path$PATH_SEPARATOR$at_top_srcdir/$as_dir
    fi
    ;;
esac
done


# Now build and simplify PATH.
PATH=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $at_path
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  as_dir=`(cd "$as_dir" && pwd) 2>/dev/null`
test -d "$as_dir" || continue
case $PATH in
	          $as_dir                 | \
	          $as_dir$PATH_SEPARATOR* | \
  *$PATH_SEPARATOR$as_dir                 | \
  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;;

  '') PATH=$as_dir ;;
   *) PATH=$PATH$PATH_SEPARATOR$as_dir ;;
esac
done

export PATH

# Setting up the FDs.
# 5 is the log file.  Not to be overwritten if `-d'.

$at_debug_p && at_suite_log=/dev/null
exec 5>$at_suite_log

# Banners and logs.
cat <<\_ASBOX
## --------------------------- ##
## GNU tar 1.15.91 test suite. ##
## --------------------------- ##
_ASBOX
{
  cat <<\_ASBOX
## --------------------------- ##
## GNU tar 1.15.91 test suite. ##
## --------------------------- ##
_ASBOX
  echo

  echo "$as_me: command line was:"
  echo "  $ $0 $at_cli_args"
  echo

  # Try to find a few ChangeLogs in case it might help determining the
  # exact version.  Use the relative dir: if the top dir is a symlink,
  # find will not follow it (and options to follow the links are not
  # portable), which would result in no output here.
  if test -n "$at_top_srcdir"; then
    cat <<\_ASBOX
## ----------- ##
## ChangeLogs. ##
## ----------- ##
_ASBOX
    echo
    for at_file in `find "$at_top_srcdir" -name ChangeLog -print`
    do
      echo "$as_me: $at_file:"
      sed 's/^/| /;10q' $at_file
      echo
    done

    {
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##

hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`

/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`

/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`

_ASUNAME

as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  echo "PATH: $as_dir"
done

}
    echo
  fi

  # Contents of the config files.
  for at_file in atconfig atlocal
  do
    test -r $at_file || continue
    echo "$as_me: $at_file:"
    sed 's/^/| /' $at_file
    echo
  done

  cat <<\_ASBOX
## ---------------- ##
## Tested programs. ##
## ---------------- ##
_ASBOX
  echo
} >&5

# Report what programs are being tested.
for at_program in : $at_tested
do
  test "$at_program" = : && continue
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -f $as_dir/$at_program && break
done

  if test -f $as_dir/$at_program; then
    {
      echo "testsuite.at:90: $as_dir/$at_program --version"
      $as_dir/$at_program --version
      echo
    } >&5 2>&1
  else
    { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5
echo "$as_me: error: cannot find $at_program" >&2;}
   { (exit 1); exit 1; }; }
  fi
done

{
  cat <<\_ASBOX
## ------------------ ##
## Running the tests. ##
## ------------------ ##
_ASBOX
} >&5

at_start_date=`date`
at_start_time=`(date +%s) 2>/dev/null`
echo "$as_me: starting at: $at_start_date" >&5
at_xpass_list=
at_xfail_list=
at_pass_list=
at_fail_list=
at_skip_list=
at_group_count=0

# Create the master directory if it doesn't already exist.
test -d $at_suite_dir ||
  mkdir $at_suite_dir ||
  { { echo "$as_me:$LINENO: error: cannot create $at_suite_dir" >&5
echo "$as_me: error: cannot create $at_suite_dir" >&2;}
   { (exit 1); exit 1; }; }

# Can we diff with `/dev/null'?  DU 5.0 refuses.
if diff /dev/null /dev/null >/dev/null 2>&1; then
  at_devnull=/dev/null
else
  at_devnull=$at_suite_dir/devnull
  cp /dev/null $at_devnull
fi

# Use `diff -u' when possible.
if diff -u $at_devnull $at_devnull >/dev/null 2>&1; then
  at_diff='diff -u'
else
  at_diff=diff
fi


for at_group in $at_groups
do
  # Be sure to come back to the top test directory.
  cd $at_suite_dir

  case $at_group in
    banner-*)
      at_group_log=$at_suite_log
      ;;

    *)
      # Skip tests we already run (using --keywords makes it easy to get
      # duplication).
      case " $at_pass_test $at_skip_test $at_fail_test " in
	*" $at_group "* ) continue;;
      esac

      # Normalize the test group number.
      at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"`

      # Create a fresh directory for the next test group, and enter.
      at_group_dir=$at_suite_dir/$at_group_normalized
      at_group_log=$at_group_dir/$as_me.log
      rm -rf $at_group_dir
      mkdir $at_group_dir ||
	{ { echo "$as_me:$LINENO: error: cannot create $at_group_dir" >&5
echo "$as_me: error: cannot create $at_group_dir" >&2;}
   { (exit 1); exit 1; }; }
      cd $at_group_dir
      ;;
  esac

  echo 0 > $at_status_file

  # Clearly separate the test groups when verbose.
  test $at_group_count != 0 && $at_verbose

  # In verbose mode, append to the log file *and* show on
  # the standard output; in quiet mode only write to the log
  if test $at_verbose = echo; then
    at_tee_pipe="tee -a $at_group_log"
  else
    at_tee_pipe="cat >> $at_group_log"
  fi

  case $at_group in
  1 ) # 1. version.at:19: tar version
    at_setup_line='version.at:19'
    at_desc='tar version'
    $at_quiet $ECHO_N "  1: tar version                                  $ECHO_C"
    at_xfail=no
    (
      echo "1. version.at:19: testing ..."
      $at_traceon


$at_traceoff
echo "version.at:33: tar --version | sed 1q"
echo version.at:33 >$at_check_line_file
( $at_traceon; tar --version | sed 1q ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "tar (GNU tar) 1.15.91
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "version.at:33: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then
  cat >$XFAILFILE <<'_EOT'

==============================================================
WARNING: Not using the proper version, *all* checks dubious...
==============================================================
_EOT

  echo 1 > $at_status_file
  exit 1
else
  rm -f $XFAILFILE
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  2 ) # 2. pipe.at:29: decompressing from stdin
    at_setup_line='pipe.at:29'
    at_desc='decompressing from stdin'
    $at_quiet $ECHO_N "  2: decompressing from stdin                     $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "2. pipe.at:29: testing ..."
      $at_traceon






  $at_traceoff
echo "pipe.at:52:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo \"separator\"
cmp orig/file1 directory/file1
echo \"separator\"
cmp orig/file2 directory/file2)"
echo pipe.at:52 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo "separator"
cmp orig/file1 directory/file1
echo "separator"
cmp orig/file2 directory/file2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file1
directory/file2
separator
separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "pipe.at:52: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "pipe.at:52:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo \"separator\"
cmp orig/file1 directory/file1
echo \"separator\"
cmp orig/file2 directory/file2)"
echo pipe.at:52 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo "separator"
cmp orig/file1 directory/file1
echo "separator"
cmp orig/file2 directory/file2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file1
directory/file2
separator
separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "pipe.at:52: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "pipe.at:52:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo \"separator\"
cmp orig/file1 directory/file1
echo \"separator\"
cmp orig/file2 directory/file2)"
echo pipe.at:52 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo "separator"
cmp orig/file1 directory/file1
echo "separator"
cmp orig/file2 directory/file2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file1
directory/file2
separator
separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "pipe.at:52: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "pipe.at:52:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo \"separator\"
cmp orig/file1 directory/file1
echo \"separator\"
cmp orig/file2 directory/file2)"
echo pipe.at:52 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo "separator"
cmp orig/file1 directory/file1
echo "separator"
cmp orig/file2 directory/file2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file1
directory/file2
separator
separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "pipe.at:52: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "pipe.at:52:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo \"separator\"
cmp orig/file1 directory/file1
echo \"separator\"
cmp orig/file2 directory/file2)"
echo pipe.at:52 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 13 --file directory/file2
tar cf archive directory|sort
mv directory orig
cat archive | tar xfv - | sort
echo "separator"
cmp orig/file1 directory/file1
echo "separator"
cmp orig/file2 directory/file2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file1
directory/file2
separator
separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "pipe.at:52: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  3 ) # 3. options.at:24: mixing options
    at_setup_line='options.at:24'
    at_desc='mixing options'
    $at_quiet $ECHO_N "  3: mixing options                               $ECHO_C"
    at_xfail=no
    (
      echo "3. options.at:24: testing ..."
      $at_traceon



$at_traceoff
echo "options.at:34:
echo > file1
TAR_OPTIONS=--numeric-owner tar chof archive file1
tar tf archive
"
echo options.at:34 >$at_check_line_file
( $at_traceon;
echo > file1
TAR_OPTIONS=--numeric-owner tar chof archive file1
tar tf archive
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "options.at:34: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  4 ) # 4. options02.at:26: interspersed options
    at_setup_line='options02.at:26'
    at_desc='interspersed options'
    $at_quiet $ECHO_N "  4: interspersed options                         $ECHO_C"
    at_xfail=no
    (
      echo "4. options02.at:26: testing ..."
      $at_traceon



$at_traceoff
echo "options02.at:36:
echo > file1
tar c file1 -f archive
tar tf archive
"
echo options02.at:36 >$at_check_line_file
( $at_traceon;
echo > file1
tar c file1 -f archive
tar tf archive
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "options02.at:36: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  5 ) # 5. append.at:21: append
    at_setup_line='append.at:21'
    at_desc='append'
    $at_quiet $ECHO_N "  5: append                                       $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "5. append.at:21: testing ..."
      $at_traceon





  $at_traceoff
echo "append.at:32:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive)"
echo append.at:32 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "append.at:32:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive)"
echo append.at:32 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "append.at:32:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive)"
echo append.at:32 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "append.at:32:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive)"
echo append.at:32 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "append.at:32:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive)"
echo append.at:32 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *
touch file1
          touch file2
          tar cf archive file1
          tar rf archive file2
          tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  6 ) # 6. append01.at:29: appending files with long names
    at_setup_line='append01.at:29'
    at_desc='appending files with long names'
    $at_quiet $ECHO_N "  6: appending files with long names              $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "6. append01.at:29: testing ..."
      $at_traceon







  $at_traceoff
echo "append01.at:45:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
)"
echo append01.at:45 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append01.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "append01.at:45:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
)"
echo append01.at:45 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append01.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "append01.at:45:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
)"
echo append01.at:45 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append01.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "append01.at:45:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
)"
echo append01.at:45 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "append01.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  7 ) # 7. delete01.at:23: deleting a member after a big one
    at_setup_line='delete01.at:23'
    at_desc='deleting a member after a big one'
    $at_quiet $ECHO_N "  7: deleting a member after a big one            $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "7. delete01.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "delete01.at:34:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive)"
echo delete01.at:34 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete01.at:34: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete01.at:34:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive)"
echo delete01.at:34 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete01.at:34: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete01.at:34:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive)"
echo delete01.at:34 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete01.at:34: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete01.at:34:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive)"
echo delete01.at:34 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete01.at:34: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete01.at:34:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive)"
echo delete01.at:34 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile -l 50000 --file file1
genfile -l 1024 --file file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete01.at:34: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  8 ) # 8. delete02.at:23: deleting a member from stdin archive
    at_setup_line='delete02.at:23'
    at_desc='deleting a member from stdin archive'
    $at_quiet $ECHO_N "  8: deleting a member from stdin archive         $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "8. delete02.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "delete02.at:42:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2)"
echo delete02.at:42 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "1
2
3
separator
1
3
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete02.at:42: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete02.at:42:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2)"
echo delete02.at:42 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "1
2
3
separator
1
3
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete02.at:42: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete02.at:42:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2)"
echo delete02.at:42 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "1
2
3
separator
1
3
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete02.at:42: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete02.at:42:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2)"
echo delete02.at:42 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "1
2
3
separator
1
3
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete02.at:42: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete02.at:42:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2)"
echo delete02.at:42 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile -l 3073 -p zeros --file 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
echo separator
tar tf archive2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "1
2
3
separator
1
3
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete02.at:42: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  9 ) # 9. delete03.at:21: deleting members with long names
    at_setup_line='delete03.at:21'
    at_desc='deleting members with long names'
    $at_quiet $ECHO_N "  9: deleting members with long names             $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "9. delete03.at:21: testing ..."
      $at_traceon







  $at_traceoff
echo "delete03.at:46:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX
rm -f \$prefix*
for i in 1 2 3 4 5 6 7 8 9
do touch \$prefix\$i
done
tar -cf archive ./\$prefix* &&
 tar --delete -f archive ./\${prefix}5 &&
 tar -tf archive
)"
echo delete03.at:46 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX
rm -f $prefix*
for i in 1 2 3 4 5 6 7 8 9
do touch $prefix$i
done
tar -cf archive ./$prefix* &&
 tar --delete -f archive ./${prefix}5 &&
 tar -tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete03.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete03.at:46:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX
rm -f \$prefix*
for i in 1 2 3 4 5 6 7 8 9
do touch \$prefix\$i
done
tar -cf archive ./\$prefix* &&
 tar --delete -f archive ./\${prefix}5 &&
 tar -tf archive
)"
echo delete03.at:46 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX
rm -f $prefix*
for i in 1 2 3 4 5 6 7 8 9
do touch $prefix$i
done
tar -cf archive ./$prefix* &&
 tar --delete -f archive ./${prefix}5 &&
 tar -tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete03.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete03.at:46:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX
rm -f \$prefix*
for i in 1 2 3 4 5 6 7 8 9
do touch \$prefix\$i
done
tar -cf archive ./\$prefix* &&
 tar --delete -f archive ./\${prefix}5 &&
 tar -tf archive
)"
echo delete03.at:46 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX
rm -f $prefix*
for i in 1 2 3 4 5 6 7 8 9
do touch $prefix$i
done
tar -cf archive ./$prefix* &&
 tar --delete -f archive ./${prefix}5 &&
 tar -tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8
./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete03.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  10 ) # 10. delete04.at:23: deleting a large last member
    at_setup_line='delete04.at:23'
    at_desc='deleting a large last member'
    $at_quiet $ECHO_N " 10: deleting a large last member                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "10. delete04.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "delete04.at:51:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
)"
echo delete04.at:51 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
file3
file4
file5
file6
file7
file8
file9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete04.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete04.at:51:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
)"
echo delete04.at:51 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
file3
file4
file5
file6
file7
file8
file9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete04.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete04.at:51:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
)"
echo delete04.at:51 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
file3
file4
file5
file6
file7
file8
file9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete04.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete04.at:51:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
)"
echo delete04.at:51 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
file3
file4
file5
file6
file7
file8
file9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete04.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete04.at:51:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
)"
echo delete04.at:51 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile -l      3 -f file1
genfile -l      5 -f file2
genfile -l      3 -f file3
genfile -l      6 -f file4
genfile -l     24 -f file5
genfile -l     13 -f file6
genfile -l   1385 -f file7
genfile -l     30 -f file8
genfile -l     10 -f file9
genfile -l 256000 -f file10
tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
tar f archive --delete file10
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
file3
file4
file5
file6
file7
file8
file9
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete04.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  11 ) # 11. delete05.at:27: deleting non-existing member
    at_setup_line='delete05.at:27'
    at_desc='deleting non-existing member'
    $at_quiet $ECHO_N " 11: deleting non-existing member                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "11. delete05.at:27: testing ..."
      $at_traceon





  $at_traceoff
echo "delete05.at:46:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
)"
echo delete05.at:46 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: tre: Not found in archive
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "en
to
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete05.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete05.at:46:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
)"
echo delete05.at:46 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: tre: Not found in archive
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "en
to
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete05.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete05.at:46:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
)"
echo delete05.at:46 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: tre: Not found in archive
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "en
to
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete05.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete05.at:46:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
)"
echo delete05.at:46 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: tre: Not found in archive
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "en
to
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete05.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "delete05.at:46:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
)"
echo delete05.at:46 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f en
genfile -l 1024 -f to

tar cf archive en to
# Make sure we don't use bogus blocking factor.
# GNU tar up to and including 1.14.91 produced an empty archive this way:
tar --file archive --blocking-factor=20 --delete tre
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: tre: Not found in archive
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "en
to
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "delete05.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  12 ) # 12. extrac01.at:23: extract over an existing directory
    at_setup_line='extrac01.at:23'
    at_desc='extract over an existing directory'
    $at_quiet $ECHO_N " 12: extract over an existing directory           $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "12. extrac01.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "extrac01.at:31:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
)"
echo extrac01.at:31 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac01.at:31: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac01.at:31:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
)"
echo extrac01.at:31 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac01.at:31: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac01.at:31:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
)"
echo extrac01.at:31 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac01.at:31: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac01.at:31:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
)"
echo extrac01.at:31 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac01.at:31: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac01.at:31:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
)"
echo extrac01.at:31 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar cf archive directory || exit 1
tar xf archive || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac01.at:31: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  13 ) # 13. extrac02.at:23: extracting symlinks over an existing file
    at_setup_line='extrac02.at:23'
    at_desc='extracting symlinks over an existing file'
    $at_quiet $ECHO_N " 13: extracting symlinks over an existing file    $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "13. extrac02.at:23: testing ..."
      $at_traceon



# FIXME: Skip if symlinks are not supported on the system



  $at_traceoff
echo "extrac02.at:35:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
)"
echo extrac02.at:35 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac02.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac02.at:35:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
)"
echo extrac02.at:35 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac02.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac02.at:35:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
)"
echo extrac02.at:35 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac02.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac02.at:35:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
)"
echo extrac02.at:35 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac02.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac02.at:35:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
)"
echo extrac02.at:35 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

touch file
ln -s file link 2> /dev/null || ln file link
tar cf archive link
rm link
touch link
tar xf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac02.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  14 ) # 14. extrac03.at:23: extraction loops
    at_setup_line='extrac03.at:23'
    at_desc='extraction loops'
    $at_quiet $ECHO_N " 14: extraction loops                             $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "14. extrac03.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "extrac03.at:35:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive)"
echo extrac03.at:35 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/../directory/
separator
directory/../directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac03.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac03.at:35:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive)"
echo extrac03.at:35 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/../directory/
separator
directory/../directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac03.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac03.at:35:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive)"
echo extrac03.at:35 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/../directory/
separator
directory/../directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac03.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac03.at:35:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive)"
echo extrac03.at:35 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/../directory/
separator
directory/../directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac03.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac03.at:35:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive)"
echo extrac03.at:35 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
tar -cPvf archive directory/../directory
echo separator
tar -xPvf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/../directory/
separator
directory/../directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac03.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  15 ) # 15. extrac04.at:23: extract + fnmatch
    at_setup_line='extrac04.at:23'
    at_desc='extract + fnmatch'
    $at_quiet $ECHO_N " 15: extract + fnmatch                            $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "15. extrac04.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "extrac04.at:45:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \\
  --exclude='./*1' \\
  --exclude='d*/*1' \\
  --exclude='d*/s*/*2' | sort
)"
echo extrac04.at:45 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \
  --exclude='./*1' \
  --exclude='d*/*1' \
  --exclude='d*/s*/*2' | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file2
directory/subdirectory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac04.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac04.at:45:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \\
  --exclude='./*1' \\
  --exclude='d*/*1' \\
  --exclude='d*/s*/*2' | sort
)"
echo extrac04.at:45 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \
  --exclude='./*1' \
  --exclude='d*/*1' \
  --exclude='d*/s*/*2' | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file2
directory/subdirectory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac04.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac04.at:45:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \\
  --exclude='./*1' \\
  --exclude='d*/*1' \\
  --exclude='d*/s*/*2' | sort
)"
echo extrac04.at:45 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \
  --exclude='./*1' \
  --exclude='d*/*1' \
  --exclude='d*/s*/*2' | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file2
directory/subdirectory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac04.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac04.at:45:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \\
  --exclude='./*1' \\
  --exclude='d*/*1' \\
  --exclude='d*/s*/*2' | sort
)"
echo extrac04.at:45 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \
  --exclude='./*1' \
  --exclude='d*/*1' \
  --exclude='d*/s*/*2' | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file2
directory/subdirectory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac04.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac04.at:45:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \\
  --exclude='./*1' \\
  --exclude='d*/*1' \\
  --exclude='d*/s*/*2' | sort
)"
echo extrac04.at:45 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

touch file1
mkdir directory
mkdir directory/subdirectory
touch directory/file1
touch directory/file2
touch directory/subdirectory/file1
touch directory/subdirectory/file2
tar -cf archive ./file1 directory
tar -tf archive \
  --exclude='./*1' \
  --exclude='d*/*1' \
  --exclude='d*/s*/*2' | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/file2
directory/subdirectory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac04.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  16 ) # 16. extrac05.at:30: extracting selected members from pax
    at_setup_line='extrac05.at:30'
    at_desc='extracting selected members from pax'
    $at_quiet $ECHO_N " 16: extracting selected members from pax         $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "16. extrac05.at:30: testing ..."
      $at_traceon



cat >list <<'_ATEOF'
jeden
cztery
_ATEOF




  $at_traceoff
echo "extrac05.at:59:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile --length 118 --file jeden
genfile --length 223 --file dwa
genfile --length 517 --file trzy
genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL
genfile --length 110 --file cztery

tar cf archive jeden dwa trzy cztery || exit 1

mkdir dir
cd dir

tar xvfT ../archive ../../list || exit 1

cd ..
)"
echo extrac05.at:59 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile --length 118 --file jeden
genfile --length 223 --file dwa
genfile --length 517 --file trzy
genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL
genfile --length 110 --file cztery

tar cf archive jeden dwa trzy cztery || exit 1

mkdir dir
cd dir

tar xvfT ../archive ../../list || exit 1

cd ..
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "jeden
cztery
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac05.at:59: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  17 ) # 17. extrac06.at:33: mode of extracted directories
    at_setup_line='extrac06.at:33'
    at_desc='mode of extracted directories'
    $at_quiet $ECHO_N " 17: mode of extracted directories                $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "17. extrac06.at:33: testing ..."
      $at_traceon





  $at_traceoff
echo "extrac06.at:70:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
)"
echo extrac06.at:70 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "777
755
755
755
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac06.at:70: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac06.at:70:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
)"
echo extrac06.at:70 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "777
755
755
755
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac06.at:70: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac06.at:70:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
)"
echo extrac06.at:70 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "777
755
755
755
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac06.at:70: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac06.at:70:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
)"
echo extrac06.at:70 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "777
755
755
755
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac06.at:70: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "extrac06.at:70:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
)"
echo extrac06.at:70 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


# Force umask
umask 022

# Make sure user's umask is honored, even if we are superuser
TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"

# Create a directory
mkdir directory
chmod 777 directory
genfile --stat=mode:777 directory

# Archive it
tar cf arc directory

# Change its permissions ...
chmod 755 directory
genfile --stat=mode:777 directory

# ... and attempt to restore it twice
tar xf arc directory
genfile --stat=mode:777 directory

tar xf arc directory
genfile --stat=mode:777 directory

# After both restores, the directory mode should be 755
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "777
755
755
755
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "extrac06.at:70: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  18 ) # 18. gzip.at:23: gzip
    at_setup_line='gzip.at:23'
    at_desc='gzip'
    $at_quiet $ECHO_N " 18: gzip                                         $ECHO_C"
    at_xfail=no
    (
      echo "18. gzip.at:23: testing ..."
      $at_traceon



unset TAR_OPTIONS

$at_traceoff
echo "gzip.at:40:

cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

tar xfvz /dev/null
test \$? = 2 || exit 1
"
echo gzip.at:40 >$at_check_line_file
( $at_traceon;

cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

tar xfvz /dev/null
test $? = 2 || exit 1
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "gzip.at:40: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  19 ) # 19. incremental.at:23: incremental
    at_setup_line='incremental.at:23'
    at_desc='incremental'
    $at_quiet $ECHO_N " 19: incremental                                  $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "19. incremental.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "incremental.at:58:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir structure
echo x >structure/file

# On Nextstep (and perhaps other 4.3BSD systems),
# a newly created file's ctime isn't updated
# until the next sync or stat operation on the file.
ls -l structure/file >/dev/null

# If the time of an initial backup and the creation time of a file contained
# in that backup are the same, the file will be backed up again when an
# incremental backup is done, because the incremental backup backs up
# files created \`on or after' the initial backup time.  Without the sleep
# command, behaviour of tar becomes variable, depending whether the system
# clock ticked over to the next second between creating the file and
# backing it up.
sleep 1

tar cf archive --listed=list structure
tar cfv archive --listed=list structure
echo separator
sleep 1
echo y >structure/file
tar cfv archive --listed=list structure
)"
echo incremental.at:58 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir structure
echo x >structure/file

# On Nextstep (and perhaps other 4.3BSD systems),
# a newly created file's ctime isn't updated
# until the next sync or stat operation on the file.
ls -l structure/file >/dev/null

# If the time of an initial backup and the creation time of a file contained
# in that backup are the same, the file will be backed up again when an
# incremental backup is done, because the incremental backup backs up
# files created `on or after' the initial backup time.  Without the sleep
# command, behaviour of tar becomes variable, depending whether the system
# clock ticked over to the next second between creating the file and
# backing it up.
sleep 1

tar cf archive --listed=list structure
tar cfv archive --listed=list structure
echo separator
sleep 1
echo y >structure/file
tar cfv archive --listed=list structure
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "structure/
separator
structure/
structure/file
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incremental.at:58: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incremental.at:58:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir structure
echo x >structure/file

# On Nextstep (and perhaps other 4.3BSD systems),
# a newly created file's ctime isn't updated
# until the next sync or stat operation on the file.
ls -l structure/file >/dev/null

# If the time of an initial backup and the creation time of a file contained
# in that backup are the same, the file will be backed up again when an
# incremental backup is done, because the incremental backup backs up
# files created \`on or after' the initial backup time.  Without the sleep
# command, behaviour of tar becomes variable, depending whether the system
# clock ticked over to the next second between creating the file and
# backing it up.
sleep 1

tar cf archive --listed=list structure
tar cfv archive --listed=list structure
echo separator
sleep 1
echo y >structure/file
tar cfv archive --listed=list structure
)"
echo incremental.at:58 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir structure
echo x >structure/file

# On Nextstep (and perhaps other 4.3BSD systems),
# a newly created file's ctime isn't updated
# until the next sync or stat operation on the file.
ls -l structure/file >/dev/null

# If the time of an initial backup and the creation time of a file contained
# in that backup are the same, the file will be backed up again when an
# incremental backup is done, because the incremental backup backs up
# files created `on or after' the initial backup time.  Without the sleep
# command, behaviour of tar becomes variable, depending whether the system
# clock ticked over to the next second between creating the file and
# backing it up.
sleep 1

tar cf archive --listed=list structure
tar cfv archive --listed=list structure
echo separator
sleep 1
echo y >structure/file
tar cfv archive --listed=list structure
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "structure/
separator
structure/
structure/file
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incremental.at:58: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incremental.at:58:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir structure
echo x >structure/file

# On Nextstep (and perhaps other 4.3BSD systems),
# a newly created file's ctime isn't updated
# until the next sync or stat operation on the file.
ls -l structure/file >/dev/null

# If the time of an initial backup and the creation time of a file contained
# in that backup are the same, the file will be backed up again when an
# incremental backup is done, because the incremental backup backs up
# files created \`on or after' the initial backup time.  Without the sleep
# command, behaviour of tar becomes variable, depending whether the system
# clock ticked over to the next second between creating the file and
# backing it up.
sleep 1

tar cf archive --listed=list structure
tar cfv archive --listed=list structure
echo separator
sleep 1
echo y >structure/file
tar cfv archive --listed=list structure
)"
echo incremental.at:58 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir structure
echo x >structure/file

# On Nextstep (and perhaps other 4.3BSD systems),
# a newly created file's ctime isn't updated
# until the next sync or stat operation on the file.
ls -l structure/file >/dev/null

# If the time of an initial backup and the creation time of a file contained
# in that backup are the same, the file will be backed up again when an
# incremental backup is done, because the incremental backup backs up
# files created `on or after' the initial backup time.  Without the sleep
# command, behaviour of tar becomes variable, depending whether the system
# clock ticked over to the next second between creating the file and
# backing it up.
sleep 1

tar cf archive --listed=list structure
tar cfv archive --listed=list structure
echo separator
sleep 1
echo y >structure/file
tar cfv archive --listed=list structure
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "structure/
separator
structure/
structure/file
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incremental.at:58: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  20 ) # 20. incr01.at:27: restore broken symlinks from incremental
    at_setup_line='incr01.at:27'
    at_desc='restore broken symlinks from incremental'
    $at_quiet $ECHO_N " 20: restore broken symlinks from incremental     $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "20. incr01.at:27: testing ..."
      $at_traceon





  $at_traceoff
echo "incr01.at:51:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
\$as_ln_s foo directory/bar

tar -cf archive.0 -g db directory
rm directory/bar
tar -cf archive.1 -g db directory

mv directory orig

tar xvfg archive.0 /dev/null
echo separator
tar xvfg archive.1 /dev/null
)"
echo incr01.at:51 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
$as_ln_s foo directory/bar

tar -cf archive.0 -g db directory
rm directory/bar
tar -cf archive.1 -g db directory

mv directory orig

tar xvfg archive.0 /dev/null
echo separator
tar xvfg archive.1 /dev/null
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/bar
separator
directory/
tar: Deleting \`directory/bar'
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr01.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr01.at:51:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
\$as_ln_s foo directory/bar

tar -cf archive.0 -g db directory
rm directory/bar
tar -cf archive.1 -g db directory

mv directory orig

tar xvfg archive.0 /dev/null
echo separator
tar xvfg archive.1 /dev/null
)"
echo incr01.at:51 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
$as_ln_s foo directory/bar

tar -cf archive.0 -g db directory
rm directory/bar
tar -cf archive.1 -g db directory

mv directory orig

tar xvfg archive.0 /dev/null
echo separator
tar xvfg archive.1 /dev/null
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/bar
separator
directory/
tar: Deleting \`directory/bar'
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr01.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr01.at:51:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir directory
\$as_ln_s foo directory/bar

tar -cf archive.0 -g db directory
rm directory/bar
tar -cf archive.1 -g db directory

mv directory orig

tar xvfg archive.0 /dev/null
echo separator
tar xvfg archive.1 /dev/null
)"
echo incr01.at:51 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir directory
$as_ln_s foo directory/bar

tar -cf archive.0 -g db directory
rm directory/bar
tar -cf archive.1 -g db directory

mv directory orig

tar xvfg archive.0 /dev/null
echo separator
tar xvfg archive.1 /dev/null
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/bar
separator
directory/
tar: Deleting \`directory/bar'
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr01.at:51: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  21 ) # 21. incr02.at:32: restoring timestamps from incremental
    at_setup_line='incr02.at:32'
    at_desc='restoring timestamps from incremental'
    $at_quiet $ECHO_N " 21: restoring timestamps from incremental        $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "21. incr02.at:32: testing ..."
      $at_traceon





  $at_traceoff
echo "incr02.at:73:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

# Create directory structure
mkdir dir
mkdir dir/subdir1
mkdir dir/subdir2
genfile --length 10 --file dir/subdir1/file

# Save mtime for later comparison
genfile --stat=mtime dir/subdir1 > ts

# Create an archive. Using incremental mode makes sure the
# archive will have a directory-first member ordering,
# i.e.:
# dir/
# dir/subdir1/
# dir/subdir2/
# dir/subdir1/foofile
#
# When restoring from this directory structure, \`dir/subdir2/' used to
# trigger apply_nonancestor_delayed_set_stat() which restored stats for
# \`subdir1' prior to restoring \`dir/subdir1/foofile'. Then, restoring the
# latter clobbered the directory timestamp.

tar -cf archive -g db dir

# Move away the directory
mv dir orig

# Wait enough time for timestamps to differ in case of failure.
sleep 5

# Restore the directory
tar -xf archive dir

# Check the timestamp
genfile --stat=mtime dir/subdir1 | diff ts -
)"
echo incr02.at:73 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

# Create directory structure
mkdir dir
mkdir dir/subdir1
mkdir dir/subdir2
genfile --length 10 --file dir/subdir1/file

# Save mtime for later comparison
genfile --stat=mtime dir/subdir1 > ts

# Create an archive. Using incremental mode makes sure the
# archive will have a directory-first member ordering,
# i.e.:
# dir/
# dir/subdir1/
# dir/subdir2/
# dir/subdir1/foofile
#
# When restoring from this directory structure, `dir/subdir2/' used to
# trigger apply_nonancestor_delayed_set_stat() which restored stats for
# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the
# latter clobbered the directory timestamp.

tar -cf archive -g db dir

# Move away the directory
mv dir orig

# Wait enough time for timestamps to differ in case of failure.
sleep 5

# Restore the directory
tar -xf archive dir

# Check the timestamp
genfile --stat=mtime dir/subdir1 | diff ts -
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr02.at:73: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr02.at:73:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

# Create directory structure
mkdir dir
mkdir dir/subdir1
mkdir dir/subdir2
genfile --length 10 --file dir/subdir1/file

# Save mtime for later comparison
genfile --stat=mtime dir/subdir1 > ts

# Create an archive. Using incremental mode makes sure the
# archive will have a directory-first member ordering,
# i.e.:
# dir/
# dir/subdir1/
# dir/subdir2/
# dir/subdir1/foofile
#
# When restoring from this directory structure, \`dir/subdir2/' used to
# trigger apply_nonancestor_delayed_set_stat() which restored stats for
# \`subdir1' prior to restoring \`dir/subdir1/foofile'. Then, restoring the
# latter clobbered the directory timestamp.

tar -cf archive -g db dir

# Move away the directory
mv dir orig

# Wait enough time for timestamps to differ in case of failure.
sleep 5

# Restore the directory
tar -xf archive dir

# Check the timestamp
genfile --stat=mtime dir/subdir1 | diff ts -
)"
echo incr02.at:73 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

# Create directory structure
mkdir dir
mkdir dir/subdir1
mkdir dir/subdir2
genfile --length 10 --file dir/subdir1/file

# Save mtime for later comparison
genfile --stat=mtime dir/subdir1 > ts

# Create an archive. Using incremental mode makes sure the
# archive will have a directory-first member ordering,
# i.e.:
# dir/
# dir/subdir1/
# dir/subdir2/
# dir/subdir1/foofile
#
# When restoring from this directory structure, `dir/subdir2/' used to
# trigger apply_nonancestor_delayed_set_stat() which restored stats for
# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the
# latter clobbered the directory timestamp.

tar -cf archive -g db dir

# Move away the directory
mv dir orig

# Wait enough time for timestamps to differ in case of failure.
sleep 5

# Restore the directory
tar -xf archive dir

# Check the timestamp
genfile --stat=mtime dir/subdir1 | diff ts -
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr02.at:73: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr02.at:73:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

# Create directory structure
mkdir dir
mkdir dir/subdir1
mkdir dir/subdir2
genfile --length 10 --file dir/subdir1/file

# Save mtime for later comparison
genfile --stat=mtime dir/subdir1 > ts

# Create an archive. Using incremental mode makes sure the
# archive will have a directory-first member ordering,
# i.e.:
# dir/
# dir/subdir1/
# dir/subdir2/
# dir/subdir1/foofile
#
# When restoring from this directory structure, \`dir/subdir2/' used to
# trigger apply_nonancestor_delayed_set_stat() which restored stats for
# \`subdir1' prior to restoring \`dir/subdir1/foofile'. Then, restoring the
# latter clobbered the directory timestamp.

tar -cf archive -g db dir

# Move away the directory
mv dir orig

# Wait enough time for timestamps to differ in case of failure.
sleep 5

# Restore the directory
tar -xf archive dir

# Check the timestamp
genfile --stat=mtime dir/subdir1 | diff ts -
)"
echo incr02.at:73 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

# Create directory structure
mkdir dir
mkdir dir/subdir1
mkdir dir/subdir2
genfile --length 10 --file dir/subdir1/file

# Save mtime for later comparison
genfile --stat=mtime dir/subdir1 > ts

# Create an archive. Using incremental mode makes sure the
# archive will have a directory-first member ordering,
# i.e.:
# dir/
# dir/subdir1/
# dir/subdir2/
# dir/subdir1/foofile
#
# When restoring from this directory structure, `dir/subdir2/' used to
# trigger apply_nonancestor_delayed_set_stat() which restored stats for
# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the
# latter clobbered the directory timestamp.

tar -cf archive -g db dir

# Move away the directory
mv dir orig

# Wait enough time for timestamps to differ in case of failure.
sleep 5

# Restore the directory
tar -xf archive dir

# Check the timestamp
genfile --stat=mtime dir/subdir1 | diff ts -
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr02.at:73: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  22 ) # 22. listed01.at:26: --listed for individual files
    at_setup_line='listed01.at:26'
    at_desc='--listed for individual files'
    $at_quiet $ECHO_N " 22: --listed for individual files                $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "22. listed01.at:26: testing ..."
      $at_traceon





  $at_traceoff
echo "listed01.at:60:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
# Let the things settle
sleep 1

tar --create \\
    --file=archive.1 \\
    --listed-incremental=listing \\
    directory/file*

tar tf archive.1 || exit 1

sleep 1

genfile --length 10240 --pattern zeros --file directory/file2

echo \"separator\"

tar --create \\
    --file=archive.2 \\
    --listed-incremental=listing \\
    directory/file* || exit 1

tar tf archive.2 || exit 1
)"
echo listed01.at:60 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
# Let the things settle
sleep 1

tar --create \
    --file=archive.1 \
    --listed-incremental=listing \
    directory/file*

tar tf archive.1 || exit 1

sleep 1

genfile --length 10240 --pattern zeros --file directory/file2

echo "separator"

tar --create \
    --file=archive.2 \
    --listed-incremental=listing \
    directory/file* || exit 1

tar tf archive.2 || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/file1
separator
directory/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "listed01.at:60: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "listed01.at:60:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
# Let the things settle
sleep 1

tar --create \\
    --file=archive.1 \\
    --listed-incremental=listing \\
    directory/file*

tar tf archive.1 || exit 1

sleep 1

genfile --length 10240 --pattern zeros --file directory/file2

echo \"separator\"

tar --create \\
    --file=archive.2 \\
    --listed-incremental=listing \\
    directory/file* || exit 1

tar tf archive.2 || exit 1
)"
echo listed01.at:60 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
# Let the things settle
sleep 1

tar --create \
    --file=archive.1 \
    --listed-incremental=listing \
    directory/file*

tar tf archive.1 || exit 1

sleep 1

genfile --length 10240 --pattern zeros --file directory/file2

echo "separator"

tar --create \
    --file=archive.2 \
    --listed-incremental=listing \
    directory/file* || exit 1

tar tf archive.2 || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/file1
separator
directory/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "listed01.at:60: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  23 ) # 23. listed02.at:28: working --listed
    at_setup_line='listed02.at:28'
    at_desc='working --listed'
    $at_quiet $ECHO_N " 23: working --listed                             $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "23. listed02.at:28: testing ..."
      $at_traceon





  $at_traceoff
echo "listed02.at:148:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

echo Create directories

mkdir tart
sleep 1
mkdir tart/c0
sleep 1
mkdir tart/c1
sleep 1

for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
do
  echo File \$file > \$file
  sleep 1
done

sleep 1
echo Creating main archive
tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1

# The above prints two lines to stderr announcing the new directories c0 and c1.
# Ensure that they appear in this script's stderr in sorted order.
sort err 1>&2; rm -f err

sleep 1
echo Modifying filesystem
rm tart/a1

mv tart/b1 tart/b2
mv tart/c1 tart/c2
touch tart/c2/ca3

echo Directory contents
find tart -print | sort 2>/dev/null

sleep 1
echo Creating incremental archive
cp -p tart.incr1 tart.incr2
tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1

sleep 1

rm -rf tart/*
echo Extracting main archive
tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
echo Extracting incremental archive
# This command should produce three messages about deletion
# of the existing files, that may appear in any order. Piping
# to sort makes sure we don't depend on any particular ordering.
tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null

echo Final files:
find tart -print | sort 2>/dev/null
)"
echo listed02.at:148 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

echo Create directories

mkdir tart
sleep 1
mkdir tart/c0
sleep 1
mkdir tart/c1
sleep 1

for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
do
  echo File $file > $file
  sleep 1
done

sleep 1
echo Creating main archive
tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1

# The above prints two lines to stderr announcing the new directories c0 and c1.
# Ensure that they appear in this script's stderr in sorted order.
sort err 1>&2; rm -f err

sleep 1
echo Modifying filesystem
rm tart/a1

mv tart/b1 tart/b2
mv tart/c1 tart/c2
touch tart/c2/ca3

echo Directory contents
find tart -print | sort 2>/dev/null

sleep 1
echo Creating incremental archive
cp -p tart.incr1 tart.incr2
tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1

sleep 1

rm -rf tart/*
echo Extracting main archive
tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
echo Extracting incremental archive
# This command should produce three messages about deletion
# of the existing files, that may appear in any order. Piping
# to sort makes sure we don't depend on any particular ordering.
tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null

echo Final files:
find tart -print | sort 2>/dev/null
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: tart/c0: Directory is new
tar: tart/c1: Directory is new
tar: tart/c2: Directory has been renamed from \`tart/c1'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Create directories
Creating main archive
tart/
tart/c0/
tart/c1/
tart/a1
tart/b1
tart/c0/cq1
tart/c0/cq2
tart/c1/ca1
tart/c1/ca2
Modifying filesystem
Directory contents
tart
tart/b2
tart/c0
tart/c0/cq1
tart/c0/cq2
tart/c2
tart/c2/ca1
tart/c2/ca2
tart/c2/ca3
Creating incremental archive
tart/
tart/c0/
tart/c2/
tart/b2
tart/c2/ca3
Extracting main archive
tart/
tart/c0/
tart/c1/
tart/a1
tart/b1
tart/c0/cq1
tart/c0/cq2
tart/c1/ca1
tart/c1/ca2
Extracting incremental archive
tar: Deleting \`tart/a1'
tar: Deleting \`tart/b1'
tart/
tart/b2
tart/c0/
tart/c2/
tart/c2/ca3
Final files:
tart
tart/b2
tart/c0
tart/c0/cq1
tart/c0/cq2
tart/c2
tart/c2/ca1
tart/c2/ca2
tart/c2/ca3
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "listed02.at:148: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "listed02.at:148:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

echo Create directories

mkdir tart
sleep 1
mkdir tart/c0
sleep 1
mkdir tart/c1
sleep 1

for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
do
  echo File \$file > \$file
  sleep 1
done

sleep 1
echo Creating main archive
tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1

# The above prints two lines to stderr announcing the new directories c0 and c1.
# Ensure that they appear in this script's stderr in sorted order.
sort err 1>&2; rm -f err

sleep 1
echo Modifying filesystem
rm tart/a1

mv tart/b1 tart/b2
mv tart/c1 tart/c2
touch tart/c2/ca3

echo Directory contents
find tart -print | sort 2>/dev/null

sleep 1
echo Creating incremental archive
cp -p tart.incr1 tart.incr2
tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1

sleep 1

rm -rf tart/*
echo Extracting main archive
tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
echo Extracting incremental archive
# This command should produce three messages about deletion
# of the existing files, that may appear in any order. Piping
# to sort makes sure we don't depend on any particular ordering.
tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null

echo Final files:
find tart -print | sort 2>/dev/null
)"
echo listed02.at:148 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

echo Create directories

mkdir tart
sleep 1
mkdir tart/c0
sleep 1
mkdir tart/c1
sleep 1

for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
do
  echo File $file > $file
  sleep 1
done

sleep 1
echo Creating main archive
tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1

# The above prints two lines to stderr announcing the new directories c0 and c1.
# Ensure that they appear in this script's stderr in sorted order.
sort err 1>&2; rm -f err

sleep 1
echo Modifying filesystem
rm tart/a1

mv tart/b1 tart/b2
mv tart/c1 tart/c2
touch tart/c2/ca3

echo Directory contents
find tart -print | sort 2>/dev/null

sleep 1
echo Creating incremental archive
cp -p tart.incr1 tart.incr2
tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1

sleep 1

rm -rf tart/*
echo Extracting main archive
tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
echo Extracting incremental archive
# This command should produce three messages about deletion
# of the existing files, that may appear in any order. Piping
# to sort makes sure we don't depend on any particular ordering.
tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null

echo Final files:
find tart -print | sort 2>/dev/null
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: tart/c0: Directory is new
tar: tart/c1: Directory is new
tar: tart/c2: Directory has been renamed from \`tart/c1'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Create directories
Creating main archive
tart/
tart/c0/
tart/c1/
tart/a1
tart/b1
tart/c0/cq1
tart/c0/cq2
tart/c1/ca1
tart/c1/ca2
Modifying filesystem
Directory contents
tart
tart/b2
tart/c0
tart/c0/cq1
tart/c0/cq2
tart/c2
tart/c2/ca1
tart/c2/ca2
tart/c2/ca3
Creating incremental archive
tart/
tart/c0/
tart/c2/
tart/b2
tart/c2/ca3
Extracting main archive
tart/
tart/c0/
tart/c1/
tart/a1
tart/b1
tart/c0/cq1
tart/c0/cq2
tart/c1/ca1
tart/c1/ca2
Extracting incremental archive
tar: Deleting \`tart/a1'
tar: Deleting \`tart/b1'
tart/
tart/b2
tart/c0/
tart/c2/
tart/c2/ca3
Final files:
tart
tart/b2
tart/c0
tart/c0/cq1
tart/c0/cq2
tart/c2
tart/c2/ca1
tart/c2/ca2
tart/c2/ca3
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "listed02.at:148: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  24 ) # 24. incr03.at:28: renamed files in incrementals
    at_setup_line='incr03.at:28'
    at_desc='renamed files in incrementals'
    $at_quiet $ECHO_N " 24: renamed files in incrementals                $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "24. incr03.at:28: testing ..."
      $at_traceon





  $at_traceoff
echo "incr03.at:73:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --file=directory/x
genfile --file=directory/y

tar -cf archive.1 -g db directory

mv directory/x directory/z
tar -cf archive.2 -g db directory

mv directory orig

echo Listing of archive.1
tar -tf archive.1 | sort
echo Listing of archive.2
tar -tf archive.2 | sort

echo Directory after first restore
tar -xf archive.1 -g db
find directory | sort

echo Directory after second restore
tar -xf archive.2 -g db
find directory | sort
)"
echo incr03.at:73 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --file=directory/x
genfile --file=directory/y

tar -cf archive.1 -g db directory

mv directory/x directory/z
tar -cf archive.2 -g db directory

mv directory orig

echo Listing of archive.1
tar -tf archive.1 | sort
echo Listing of archive.2
tar -tf archive.2 | sort

echo Directory after first restore
tar -xf archive.1 -g db
find directory | sort

echo Directory after second restore
tar -xf archive.2 -g db
find directory | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Listing of archive.1
directory/
directory/x
directory/y
Listing of archive.2
directory/
directory/z
Directory after first restore
directory
directory/x
directory/y
Directory after second restore
directory
directory/y
directory/z
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr03.at:73: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr03.at:73:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --file=directory/x
genfile --file=directory/y

tar -cf archive.1 -g db directory

mv directory/x directory/z
tar -cf archive.2 -g db directory

mv directory orig

echo Listing of archive.1
tar -tf archive.1 | sort
echo Listing of archive.2
tar -tf archive.2 | sort

echo Directory after first restore
tar -xf archive.1 -g db
find directory | sort

echo Directory after second restore
tar -xf archive.2 -g db
find directory | sort
)"
echo incr03.at:73 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --file=directory/x
genfile --file=directory/y

tar -cf archive.1 -g db directory

mv directory/x directory/z
tar -cf archive.2 -g db directory

mv directory orig

echo Listing of archive.1
tar -tf archive.1 | sort
echo Listing of archive.2
tar -tf archive.2 | sort

echo Directory after first restore
tar -xf archive.1 -g db
find directory | sort

echo Directory after second restore
tar -xf archive.2 -g db
find directory | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Listing of archive.1
directory/
directory/x
directory/y
Listing of archive.2
directory/
directory/z
Directory after first restore
directory
directory/x
directory/y
Directory after second restore
directory
directory/y
directory/z
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr03.at:73: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr03.at:73:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --file=directory/x
genfile --file=directory/y

tar -cf archive.1 -g db directory

mv directory/x directory/z
tar -cf archive.2 -g db directory

mv directory orig

echo Listing of archive.1
tar -tf archive.1 | sort
echo Listing of archive.2
tar -tf archive.2 | sort

echo Directory after first restore
tar -xf archive.1 -g db
find directory | sort

echo Directory after second restore
tar -xf archive.2 -g db
find directory | sort
)"
echo incr03.at:73 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --file=directory/x
genfile --file=directory/y

tar -cf archive.1 -g db directory

mv directory/x directory/z
tar -cf archive.2 -g db directory

mv directory orig

echo Listing of archive.1
tar -tf archive.1 | sort
echo Listing of archive.2
tar -tf archive.2 | sort

echo Directory after first restore
tar -xf archive.1 -g db
find directory | sort

echo Directory after second restore
tar -xf archive.2 -g db
find directory | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Listing of archive.1
directory/
directory/x
directory/y
Listing of archive.2
directory/
directory/z
Directory after first restore
directory
directory/x
directory/y
Directory after second restore
directory
directory/y
directory/z
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr03.at:73: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  25 ) # 25. incr04.at:29: proper icontents initialization
    at_setup_line='incr04.at:29'
    at_desc='proper icontents initialization'
    $at_quiet $ECHO_N " 25: proper icontents initialization              $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "25. incr04.at:29: testing ..."
      $at_traceon







  $at_traceoff
echo "incr04.at:59:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


mkinstalldirs a/b >/dev/null

awk 'BEGIN {
  for (i=1;i<=142;i++)
    printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i);
  }' < /dev/null | genfile --files-from -

echo \"Initial dump\"
tar cvf a0.tar -g a.sna a
mv a/b a/c
echo \"Incremental dump\"
tar cvf a1.tar -g a.sna a
)"
echo incr04.at:59 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


mkinstalldirs a/b >/dev/null

awk 'BEGIN {
  for (i=1;i<=142;i++)
    printf("a/b/one_31_chars_long_file_name_%03d\n", i);
  }' < /dev/null | genfile --files-from -

echo "Initial dump"
tar cvf a0.tar -g a.sna a
mv a/b a/c
echo "Incremental dump"
tar cvf a1.tar -g a.sna a
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: a/b: Directory is new
tar: a/c: Directory has been renamed from \`a/b'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Initial dump
a/
a/b/
a/b/one_31_chars_long_file_name_001
a/b/one_31_chars_long_file_name_002
a/b/one_31_chars_long_file_name_003
a/b/one_31_chars_long_file_name_004
a/b/one_31_chars_long_file_name_005
a/b/one_31_chars_long_file_name_006
a/b/one_31_chars_long_file_name_007
a/b/one_31_chars_long_file_name_008
a/b/one_31_chars_long_file_name_009
a/b/one_31_chars_long_file_name_010
a/b/one_31_chars_long_file_name_011
a/b/one_31_chars_long_file_name_012
a/b/one_31_chars_long_file_name_013
a/b/one_31_chars_long_file_name_014
a/b/one_31_chars_long_file_name_015
a/b/one_31_chars_long_file_name_016
a/b/one_31_chars_long_file_name_017
a/b/one_31_chars_long_file_name_018
a/b/one_31_chars_long_file_name_019
a/b/one_31_chars_long_file_name_020
a/b/one_31_chars_long_file_name_021
a/b/one_31_chars_long_file_name_022
a/b/one_31_chars_long_file_name_023
a/b/one_31_chars_long_file_name_024
a/b/one_31_chars_long_file_name_025
a/b/one_31_chars_long_file_name_026
a/b/one_31_chars_long_file_name_027
a/b/one_31_chars_long_file_name_028
a/b/one_31_chars_long_file_name_029
a/b/one_31_chars_long_file_name_030
a/b/one_31_chars_long_file_name_031
a/b/one_31_chars_long_file_name_032
a/b/one_31_chars_long_file_name_033
a/b/one_31_chars_long_file_name_034
a/b/one_31_chars_long_file_name_035
a/b/one_31_chars_long_file_name_036
a/b/one_31_chars_long_file_name_037
a/b/one_31_chars_long_file_name_038
a/b/one_31_chars_long_file_name_039
a/b/one_31_chars_long_file_name_040
a/b/one_31_chars_long_file_name_041
a/b/one_31_chars_long_file_name_042
a/b/one_31_chars_long_file_name_043
a/b/one_31_chars_long_file_name_044
a/b/one_31_chars_long_file_name_045
a/b/one_31_chars_long_file_name_046
a/b/one_31_chars_long_file_name_047
a/b/one_31_chars_long_file_name_048
a/b/one_31_chars_long_file_name_049
a/b/one_31_chars_long_file_name_050
a/b/one_31_chars_long_file_name_051
a/b/one_31_chars_long_file_name_052
a/b/one_31_chars_long_file_name_053
a/b/one_31_chars_long_file_name_054
a/b/one_31_chars_long_file_name_055
a/b/one_31_chars_long_file_name_056
a/b/one_31_chars_long_file_name_057
a/b/one_31_chars_long_file_name_058
a/b/one_31_chars_long_file_name_059
a/b/one_31_chars_long_file_name_060
a/b/one_31_chars_long_file_name_061
a/b/one_31_chars_long_file_name_062
a/b/one_31_chars_long_file_name_063
a/b/one_31_chars_long_file_name_064
a/b/one_31_chars_long_file_name_065
a/b/one_31_chars_long_file_name_066
a/b/one_31_chars_long_file_name_067
a/b/one_31_chars_long_file_name_068
a/b/one_31_chars_long_file_name_069
a/b/one_31_chars_long_file_name_070
a/b/one_31_chars_long_file_name_071
a/b/one_31_chars_long_file_name_072
a/b/one_31_chars_long_file_name_073
a/b/one_31_chars_long_file_name_074
a/b/one_31_chars_long_file_name_075
a/b/one_31_chars_long_file_name_076
a/b/one_31_chars_long_file_name_077
a/b/one_31_chars_long_file_name_078
a/b/one_31_chars_long_file_name_079
a/b/one_31_chars_long_file_name_080
a/b/one_31_chars_long_file_name_081
a/b/one_31_chars_long_file_name_082
a/b/one_31_chars_long_file_name_083
a/b/one_31_chars_long_file_name_084
a/b/one_31_chars_long_file_name_085
a/b/one_31_chars_long_file_name_086
a/b/one_31_chars_long_file_name_087
a/b/one_31_chars_long_file_name_088
a/b/one_31_chars_long_file_name_089
a/b/one_31_chars_long_file_name_090
a/b/one_31_chars_long_file_name_091
a/b/one_31_chars_long_file_name_092
a/b/one_31_chars_long_file_name_093
a/b/one_31_chars_long_file_name_094
a/b/one_31_chars_long_file_name_095
a/b/one_31_chars_long_file_name_096
a/b/one_31_chars_long_file_name_097
a/b/one_31_chars_long_file_name_098
a/b/one_31_chars_long_file_name_099
a/b/one_31_chars_long_file_name_100
a/b/one_31_chars_long_file_name_101
a/b/one_31_chars_long_file_name_102
a/b/one_31_chars_long_file_name_103
a/b/one_31_chars_long_file_name_104
a/b/one_31_chars_long_file_name_105
a/b/one_31_chars_long_file_name_106
a/b/one_31_chars_long_file_name_107
a/b/one_31_chars_long_file_name_108
a/b/one_31_chars_long_file_name_109
a/b/one_31_chars_long_file_name_110
a/b/one_31_chars_long_file_name_111
a/b/one_31_chars_long_file_name_112
a/b/one_31_chars_long_file_name_113
a/b/one_31_chars_long_file_name_114
a/b/one_31_chars_long_file_name_115
a/b/one_31_chars_long_file_name_116
a/b/one_31_chars_long_file_name_117
a/b/one_31_chars_long_file_name_118
a/b/one_31_chars_long_file_name_119
a/b/one_31_chars_long_file_name_120
a/b/one_31_chars_long_file_name_121
a/b/one_31_chars_long_file_name_122
a/b/one_31_chars_long_file_name_123
a/b/one_31_chars_long_file_name_124
a/b/one_31_chars_long_file_name_125
a/b/one_31_chars_long_file_name_126
a/b/one_31_chars_long_file_name_127
a/b/one_31_chars_long_file_name_128
a/b/one_31_chars_long_file_name_129
a/b/one_31_chars_long_file_name_130
a/b/one_31_chars_long_file_name_131
a/b/one_31_chars_long_file_name_132
a/b/one_31_chars_long_file_name_133
a/b/one_31_chars_long_file_name_134
a/b/one_31_chars_long_file_name_135
a/b/one_31_chars_long_file_name_136
a/b/one_31_chars_long_file_name_137
a/b/one_31_chars_long_file_name_138
a/b/one_31_chars_long_file_name_139
a/b/one_31_chars_long_file_name_140
a/b/one_31_chars_long_file_name_141
a/b/one_31_chars_long_file_name_142
Incremental dump
a/
a/c/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr04.at:59: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr04.at:59:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


mkinstalldirs a/b >/dev/null

awk 'BEGIN {
  for (i=1;i<=142;i++)
    printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i);
  }' < /dev/null | genfile --files-from -

echo \"Initial dump\"
tar cvf a0.tar -g a.sna a
mv a/b a/c
echo \"Incremental dump\"
tar cvf a1.tar -g a.sna a
)"
echo incr04.at:59 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


mkinstalldirs a/b >/dev/null

awk 'BEGIN {
  for (i=1;i<=142;i++)
    printf("a/b/one_31_chars_long_file_name_%03d\n", i);
  }' < /dev/null | genfile --files-from -

echo "Initial dump"
tar cvf a0.tar -g a.sna a
mv a/b a/c
echo "Incremental dump"
tar cvf a1.tar -g a.sna a
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: a/b: Directory is new
tar: a/c: Directory has been renamed from \`a/b'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Initial dump
a/
a/b/
a/b/one_31_chars_long_file_name_001
a/b/one_31_chars_long_file_name_002
a/b/one_31_chars_long_file_name_003
a/b/one_31_chars_long_file_name_004
a/b/one_31_chars_long_file_name_005
a/b/one_31_chars_long_file_name_006
a/b/one_31_chars_long_file_name_007
a/b/one_31_chars_long_file_name_008
a/b/one_31_chars_long_file_name_009
a/b/one_31_chars_long_file_name_010
a/b/one_31_chars_long_file_name_011
a/b/one_31_chars_long_file_name_012
a/b/one_31_chars_long_file_name_013
a/b/one_31_chars_long_file_name_014
a/b/one_31_chars_long_file_name_015
a/b/one_31_chars_long_file_name_016
a/b/one_31_chars_long_file_name_017
a/b/one_31_chars_long_file_name_018
a/b/one_31_chars_long_file_name_019
a/b/one_31_chars_long_file_name_020
a/b/one_31_chars_long_file_name_021
a/b/one_31_chars_long_file_name_022
a/b/one_31_chars_long_file_name_023
a/b/one_31_chars_long_file_name_024
a/b/one_31_chars_long_file_name_025
a/b/one_31_chars_long_file_name_026
a/b/one_31_chars_long_file_name_027
a/b/one_31_chars_long_file_name_028
a/b/one_31_chars_long_file_name_029
a/b/one_31_chars_long_file_name_030
a/b/one_31_chars_long_file_name_031
a/b/one_31_chars_long_file_name_032
a/b/one_31_chars_long_file_name_033
a/b/one_31_chars_long_file_name_034
a/b/one_31_chars_long_file_name_035
a/b/one_31_chars_long_file_name_036
a/b/one_31_chars_long_file_name_037
a/b/one_31_chars_long_file_name_038
a/b/one_31_chars_long_file_name_039
a/b/one_31_chars_long_file_name_040
a/b/one_31_chars_long_file_name_041
a/b/one_31_chars_long_file_name_042
a/b/one_31_chars_long_file_name_043
a/b/one_31_chars_long_file_name_044
a/b/one_31_chars_long_file_name_045
a/b/one_31_chars_long_file_name_046
a/b/one_31_chars_long_file_name_047
a/b/one_31_chars_long_file_name_048
a/b/one_31_chars_long_file_name_049
a/b/one_31_chars_long_file_name_050
a/b/one_31_chars_long_file_name_051
a/b/one_31_chars_long_file_name_052
a/b/one_31_chars_long_file_name_053
a/b/one_31_chars_long_file_name_054
a/b/one_31_chars_long_file_name_055
a/b/one_31_chars_long_file_name_056
a/b/one_31_chars_long_file_name_057
a/b/one_31_chars_long_file_name_058
a/b/one_31_chars_long_file_name_059
a/b/one_31_chars_long_file_name_060
a/b/one_31_chars_long_file_name_061
a/b/one_31_chars_long_file_name_062
a/b/one_31_chars_long_file_name_063
a/b/one_31_chars_long_file_name_064
a/b/one_31_chars_long_file_name_065
a/b/one_31_chars_long_file_name_066
a/b/one_31_chars_long_file_name_067
a/b/one_31_chars_long_file_name_068
a/b/one_31_chars_long_file_name_069
a/b/one_31_chars_long_file_name_070
a/b/one_31_chars_long_file_name_071
a/b/one_31_chars_long_file_name_072
a/b/one_31_chars_long_file_name_073
a/b/one_31_chars_long_file_name_074
a/b/one_31_chars_long_file_name_075
a/b/one_31_chars_long_file_name_076
a/b/one_31_chars_long_file_name_077
a/b/one_31_chars_long_file_name_078
a/b/one_31_chars_long_file_name_079
a/b/one_31_chars_long_file_name_080
a/b/one_31_chars_long_file_name_081
a/b/one_31_chars_long_file_name_082
a/b/one_31_chars_long_file_name_083
a/b/one_31_chars_long_file_name_084
a/b/one_31_chars_long_file_name_085
a/b/one_31_chars_long_file_name_086
a/b/one_31_chars_long_file_name_087
a/b/one_31_chars_long_file_name_088
a/b/one_31_chars_long_file_name_089
a/b/one_31_chars_long_file_name_090
a/b/one_31_chars_long_file_name_091
a/b/one_31_chars_long_file_name_092
a/b/one_31_chars_long_file_name_093
a/b/one_31_chars_long_file_name_094
a/b/one_31_chars_long_file_name_095
a/b/one_31_chars_long_file_name_096
a/b/one_31_chars_long_file_name_097
a/b/one_31_chars_long_file_name_098
a/b/one_31_chars_long_file_name_099
a/b/one_31_chars_long_file_name_100
a/b/one_31_chars_long_file_name_101
a/b/one_31_chars_long_file_name_102
a/b/one_31_chars_long_file_name_103
a/b/one_31_chars_long_file_name_104
a/b/one_31_chars_long_file_name_105
a/b/one_31_chars_long_file_name_106
a/b/one_31_chars_long_file_name_107
a/b/one_31_chars_long_file_name_108
a/b/one_31_chars_long_file_name_109
a/b/one_31_chars_long_file_name_110
a/b/one_31_chars_long_file_name_111
a/b/one_31_chars_long_file_name_112
a/b/one_31_chars_long_file_name_113
a/b/one_31_chars_long_file_name_114
a/b/one_31_chars_long_file_name_115
a/b/one_31_chars_long_file_name_116
a/b/one_31_chars_long_file_name_117
a/b/one_31_chars_long_file_name_118
a/b/one_31_chars_long_file_name_119
a/b/one_31_chars_long_file_name_120
a/b/one_31_chars_long_file_name_121
a/b/one_31_chars_long_file_name_122
a/b/one_31_chars_long_file_name_123
a/b/one_31_chars_long_file_name_124
a/b/one_31_chars_long_file_name_125
a/b/one_31_chars_long_file_name_126
a/b/one_31_chars_long_file_name_127
a/b/one_31_chars_long_file_name_128
a/b/one_31_chars_long_file_name_129
a/b/one_31_chars_long_file_name_130
a/b/one_31_chars_long_file_name_131
a/b/one_31_chars_long_file_name_132
a/b/one_31_chars_long_file_name_133
a/b/one_31_chars_long_file_name_134
a/b/one_31_chars_long_file_name_135
a/b/one_31_chars_long_file_name_136
a/b/one_31_chars_long_file_name_137
a/b/one_31_chars_long_file_name_138
a/b/one_31_chars_long_file_name_139
a/b/one_31_chars_long_file_name_140
a/b/one_31_chars_long_file_name_141
a/b/one_31_chars_long_file_name_142
Incremental dump
a/
a/c/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr04.at:59: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "incr04.at:59:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


mkinstalldirs a/b >/dev/null

awk 'BEGIN {
  for (i=1;i<=142;i++)
    printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i);
  }' < /dev/null | genfile --files-from -

echo \"Initial dump\"
tar cvf a0.tar -g a.sna a
mv a/b a/c
echo \"Incremental dump\"
tar cvf a1.tar -g a.sna a
)"
echo incr04.at:59 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


mkinstalldirs a/b >/dev/null

awk 'BEGIN {
  for (i=1;i<=142;i++)
    printf("a/b/one_31_chars_long_file_name_%03d\n", i);
  }' < /dev/null | genfile --files-from -

echo "Initial dump"
tar cvf a0.tar -g a.sna a
mv a/b a/c
echo "Incremental dump"
tar cvf a1.tar -g a.sna a
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: a/b: Directory is new
tar: a/c: Directory has been renamed from \`a/b'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Initial dump
a/
a/b/
a/b/one_31_chars_long_file_name_001
a/b/one_31_chars_long_file_name_002
a/b/one_31_chars_long_file_name_003
a/b/one_31_chars_long_file_name_004
a/b/one_31_chars_long_file_name_005
a/b/one_31_chars_long_file_name_006
a/b/one_31_chars_long_file_name_007
a/b/one_31_chars_long_file_name_008
a/b/one_31_chars_long_file_name_009
a/b/one_31_chars_long_file_name_010
a/b/one_31_chars_long_file_name_011
a/b/one_31_chars_long_file_name_012
a/b/one_31_chars_long_file_name_013
a/b/one_31_chars_long_file_name_014
a/b/one_31_chars_long_file_name_015
a/b/one_31_chars_long_file_name_016
a/b/one_31_chars_long_file_name_017
a/b/one_31_chars_long_file_name_018
a/b/one_31_chars_long_file_name_019
a/b/one_31_chars_long_file_name_020
a/b/one_31_chars_long_file_name_021
a/b/one_31_chars_long_file_name_022
a/b/one_31_chars_long_file_name_023
a/b/one_31_chars_long_file_name_024
a/b/one_31_chars_long_file_name_025
a/b/one_31_chars_long_file_name_026
a/b/one_31_chars_long_file_name_027
a/b/one_31_chars_long_file_name_028
a/b/one_31_chars_long_file_name_029
a/b/one_31_chars_long_file_name_030
a/b/one_31_chars_long_file_name_031
a/b/one_31_chars_long_file_name_032
a/b/one_31_chars_long_file_name_033
a/b/one_31_chars_long_file_name_034
a/b/one_31_chars_long_file_name_035
a/b/one_31_chars_long_file_name_036
a/b/one_31_chars_long_file_name_037
a/b/one_31_chars_long_file_name_038
a/b/one_31_chars_long_file_name_039
a/b/one_31_chars_long_file_name_040
a/b/one_31_chars_long_file_name_041
a/b/one_31_chars_long_file_name_042
a/b/one_31_chars_long_file_name_043
a/b/one_31_chars_long_file_name_044
a/b/one_31_chars_long_file_name_045
a/b/one_31_chars_long_file_name_046
a/b/one_31_chars_long_file_name_047
a/b/one_31_chars_long_file_name_048
a/b/one_31_chars_long_file_name_049
a/b/one_31_chars_long_file_name_050
a/b/one_31_chars_long_file_name_051
a/b/one_31_chars_long_file_name_052
a/b/one_31_chars_long_file_name_053
a/b/one_31_chars_long_file_name_054
a/b/one_31_chars_long_file_name_055
a/b/one_31_chars_long_file_name_056
a/b/one_31_chars_long_file_name_057
a/b/one_31_chars_long_file_name_058
a/b/one_31_chars_long_file_name_059
a/b/one_31_chars_long_file_name_060
a/b/one_31_chars_long_file_name_061
a/b/one_31_chars_long_file_name_062
a/b/one_31_chars_long_file_name_063
a/b/one_31_chars_long_file_name_064
a/b/one_31_chars_long_file_name_065
a/b/one_31_chars_long_file_name_066
a/b/one_31_chars_long_file_name_067
a/b/one_31_chars_long_file_name_068
a/b/one_31_chars_long_file_name_069
a/b/one_31_chars_long_file_name_070
a/b/one_31_chars_long_file_name_071
a/b/one_31_chars_long_file_name_072
a/b/one_31_chars_long_file_name_073
a/b/one_31_chars_long_file_name_074
a/b/one_31_chars_long_file_name_075
a/b/one_31_chars_long_file_name_076
a/b/one_31_chars_long_file_name_077
a/b/one_31_chars_long_file_name_078
a/b/one_31_chars_long_file_name_079
a/b/one_31_chars_long_file_name_080
a/b/one_31_chars_long_file_name_081
a/b/one_31_chars_long_file_name_082
a/b/one_31_chars_long_file_name_083
a/b/one_31_chars_long_file_name_084
a/b/one_31_chars_long_file_name_085
a/b/one_31_chars_long_file_name_086
a/b/one_31_chars_long_file_name_087
a/b/one_31_chars_long_file_name_088
a/b/one_31_chars_long_file_name_089
a/b/one_31_chars_long_file_name_090
a/b/one_31_chars_long_file_name_091
a/b/one_31_chars_long_file_name_092
a/b/one_31_chars_long_file_name_093
a/b/one_31_chars_long_file_name_094
a/b/one_31_chars_long_file_name_095
a/b/one_31_chars_long_file_name_096
a/b/one_31_chars_long_file_name_097
a/b/one_31_chars_long_file_name_098
a/b/one_31_chars_long_file_name_099
a/b/one_31_chars_long_file_name_100
a/b/one_31_chars_long_file_name_101
a/b/one_31_chars_long_file_name_102
a/b/one_31_chars_long_file_name_103
a/b/one_31_chars_long_file_name_104
a/b/one_31_chars_long_file_name_105
a/b/one_31_chars_long_file_name_106
a/b/one_31_chars_long_file_name_107
a/b/one_31_chars_long_file_name_108
a/b/one_31_chars_long_file_name_109
a/b/one_31_chars_long_file_name_110
a/b/one_31_chars_long_file_name_111
a/b/one_31_chars_long_file_name_112
a/b/one_31_chars_long_file_name_113
a/b/one_31_chars_long_file_name_114
a/b/one_31_chars_long_file_name_115
a/b/one_31_chars_long_file_name_116
a/b/one_31_chars_long_file_name_117
a/b/one_31_chars_long_file_name_118
a/b/one_31_chars_long_file_name_119
a/b/one_31_chars_long_file_name_120
a/b/one_31_chars_long_file_name_121
a/b/one_31_chars_long_file_name_122
a/b/one_31_chars_long_file_name_123
a/b/one_31_chars_long_file_name_124
a/b/one_31_chars_long_file_name_125
a/b/one_31_chars_long_file_name_126
a/b/one_31_chars_long_file_name_127
a/b/one_31_chars_long_file_name_128
a/b/one_31_chars_long_file_name_129
a/b/one_31_chars_long_file_name_130
a/b/one_31_chars_long_file_name_131
a/b/one_31_chars_long_file_name_132
a/b/one_31_chars_long_file_name_133
a/b/one_31_chars_long_file_name_134
a/b/one_31_chars_long_file_name_135
a/b/one_31_chars_long_file_name_136
a/b/one_31_chars_long_file_name_137
a/b/one_31_chars_long_file_name_138
a/b/one_31_chars_long_file_name_139
a/b/one_31_chars_long_file_name_140
a/b/one_31_chars_long_file_name_141
a/b/one_31_chars_long_file_name_142
Incremental dump
a/
a/c/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "incr04.at:59: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  26 ) # 26. rename01.at:24: renamed dirs in incrementals
    at_setup_line='rename01.at:24'
    at_desc='renamed dirs in incrementals'
    $at_quiet $ECHO_N " 26: renamed dirs in incrementals                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "26. rename01.at:24: testing ..."
      $at_traceon





  $at_traceoff
echo "rename01.at:85:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file

echo \"Creating base archive\"
tar -g incr -cf arch.1 -v foo

mv foo/bar foo/baz

echo \"Creating incremental archive\"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfg arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename01.at:85 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file

echo "Creating base archive"
tar -g incr -cf arch.1 -v foo

mv foo/bar foo/baz

echo "Creating incremental archive"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfg arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo/bar: Directory is new
tar: foo/baz: Directory has been renamed from \`foo/bar'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Creating base archive
foo/
foo/bar/
foo/file1
foo/file2
foo/bar/file
Creating incremental archive
foo/
foo/baz/
Begin directory listing 1
foo
foo/bar
foo/bar/file
foo/file1
foo/file2
End directory listing 1
Begin directory listing 2
foo
foo/baz
foo/baz/file
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename01.at:85: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "rename01.at:85:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file

echo \"Creating base archive\"
tar -g incr -cf arch.1 -v foo

mv foo/bar foo/baz

echo \"Creating incremental archive\"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfg arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename01.at:85 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file

echo "Creating base archive"
tar -g incr -cf arch.1 -v foo

mv foo/bar foo/baz

echo "Creating incremental archive"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfg arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo/bar: Directory is new
tar: foo/baz: Directory has been renamed from \`foo/bar'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Creating base archive
foo/
foo/bar/
foo/file1
foo/file2
foo/bar/file
Creating incremental archive
foo/
foo/baz/
Begin directory listing 1
foo
foo/bar
foo/bar/file
foo/file1
foo/file2
End directory listing 1
Begin directory listing 2
foo
foo/baz
foo/baz/file
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename01.at:85: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "rename01.at:85:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file

echo \"Creating base archive\"
tar -g incr -cf arch.1 -v foo

mv foo/bar foo/baz

echo \"Creating incremental archive\"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfg arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename01.at:85 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file

echo "Creating base archive"
tar -g incr -cf arch.1 -v foo

mv foo/bar foo/baz

echo "Creating incremental archive"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfg arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo/bar: Directory is new
tar: foo/baz: Directory has been renamed from \`foo/bar'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Creating base archive
foo/
foo/bar/
foo/file1
foo/file2
foo/bar/file
Creating incremental archive
foo/
foo/baz/
Begin directory listing 1
foo
foo/bar
foo/bar/file
foo/file1
foo/file2
End directory listing 1
Begin directory listing 2
foo
foo/baz
foo/baz/file
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename01.at:85: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  27 ) # 27. rename02.at:24: move between hierarchies
    at_setup_line='rename02.at:24'
    at_desc='move between hierarchies'
    $at_quiet $ECHO_N " 27: move between hierarchies                     $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "27. rename02.at:24: testing ..."
      $at_traceon





  $at_traceoff
echo "rename02.at:98:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file.r
mkdir foo/bar/baz
genfile --file foo/bar/baz/file.z

echo \"Creating base archive\"
tar -g incr -cf arch.1 -v foo

mv foo/bar/baz foo

echo \"Creating incremental archive\"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null 2>tmperr
sort tmperr >&2

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename02.at:98 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file.r
mkdir foo/bar/baz
genfile --file foo/bar/baz/file.z

echo "Creating base archive"
tar -g incr -cf arch.1 -v foo

mv foo/bar/baz foo

echo "Creating incremental archive"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null 2>tmperr
sort tmperr >&2

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo/bar: Directory is new
tar: foo/bar/baz: Directory is new
tar: foo/baz: Directory has been renamed from \`foo/bar/baz'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Creating base archive
foo/
foo/bar/
foo/bar/baz/
foo/file1
foo/file2
foo/bar/file.r
foo/bar/baz/file.z
Creating incremental archive
foo/
foo/bar/
foo/baz/
Begin directory listing 1
foo
foo/bar
foo/bar/baz
foo/bar/baz/file.z
foo/bar/file.r
foo/file1
foo/file2
End directory listing 1
foo/
foo/bar/
foo/baz/
Begin directory listing 2
foo
foo/bar
foo/bar/file.r
foo/baz
foo/baz/file.z
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename02.at:98: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "rename02.at:98:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file.r
mkdir foo/bar/baz
genfile --file foo/bar/baz/file.z

echo \"Creating base archive\"
tar -g incr -cf arch.1 -v foo

mv foo/bar/baz foo

echo \"Creating incremental archive\"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null 2>tmperr
sort tmperr >&2

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename02.at:98 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file.r
mkdir foo/bar/baz
genfile --file foo/bar/baz/file.z

echo "Creating base archive"
tar -g incr -cf arch.1 -v foo

mv foo/bar/baz foo

echo "Creating incremental archive"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null 2>tmperr
sort tmperr >&2

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo/bar: Directory is new
tar: foo/bar/baz: Directory is new
tar: foo/baz: Directory has been renamed from \`foo/bar/baz'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Creating base archive
foo/
foo/bar/
foo/bar/baz/
foo/file1
foo/file2
foo/bar/file.r
foo/bar/baz/file.z
Creating incremental archive
foo/
foo/bar/
foo/baz/
Begin directory listing 1
foo
foo/bar
foo/bar/baz
foo/bar/baz/file.z
foo/bar/file.r
foo/file1
foo/file2
End directory listing 1
foo/
foo/bar/
foo/baz/
Begin directory listing 2
foo
foo/bar
foo/bar/file.r
foo/baz
foo/baz/file.z
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename02.at:98: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "rename02.at:98:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file.r
mkdir foo/bar/baz
genfile --file foo/bar/baz/file.z

echo \"Creating base archive\"
tar -g incr -cf arch.1 -v foo

mv foo/bar/baz foo

echo \"Creating incremental archive\"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null 2>tmperr
sort tmperr >&2

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename02.at:98 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir foo
genfile --file foo/file1
genfile --file foo/file2
mkdir foo/bar
genfile --file foo/bar/file.r
mkdir foo/bar/baz
genfile --file foo/bar/baz/file.z

echo "Creating base archive"
tar -g incr -cf arch.1 -v foo

mv foo/bar/baz foo

echo "Creating incremental archive"
tar -g incr -cf arch.2 -v foo

mv foo old

tar xfg arch.1 /dev/null 2>tmperr
sort tmperr >&2

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo/bar: Directory is new
tar: foo/bar/baz: Directory is new
tar: foo/baz: Directory has been renamed from \`foo/bar/baz'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "Creating base archive
foo/
foo/bar/
foo/bar/baz/
foo/file1
foo/file2
foo/bar/file.r
foo/bar/baz/file.z
Creating incremental archive
foo/
foo/bar/
foo/baz/
Begin directory listing 1
foo
foo/bar
foo/bar/baz
foo/bar/baz/file.z
foo/bar/file.r
foo/file1
foo/file2
End directory listing 1
foo/
foo/bar/
foo/baz/
Begin directory listing 2
foo
foo/bar
foo/bar/file.r
foo/baz
foo/baz/file.z
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename02.at:98: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  28 ) # 28. rename03.at:23: cyclic renames
    at_setup_line='rename03.at:23'
    at_desc='cyclic renames'
    $at_quiet $ECHO_N " 28: cyclic renames                               $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "28. rename03.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "rename03.at:122:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2

mkdir foo/a
genfile --file foo/a/filea

mkdir foo/b
genfile --file foo/b/fileb

mkdir foo/c
genfile --file foo/c/filec

echo \"First dump\"
echo \"First dump\">&2
tar -g incr -cf arch.1 -v foo 2>tmperr
sort tmperr >&2

# Shuffle directories:
(cd foo
mv a \$\$
mv c a
mv b c
mv \$\$ b)

echo \"Second dump\"
echo \"Second dump\" >&2
tar -g incr -cf arch.2 -v foo 2>tmperr
sort tmperr >&2

tar xfg arch.1 /dev/null

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename03.at:122 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2

mkdir foo/a
genfile --file foo/a/filea

mkdir foo/b
genfile --file foo/b/fileb

mkdir foo/c
genfile --file foo/c/filec

echo "First dump"
echo "First dump">&2
tar -g incr -cf arch.1 -v foo 2>tmperr
sort tmperr >&2

# Shuffle directories:
(cd foo
mv a $$
mv c a
mv b c
mv $$ b)

echo "Second dump"
echo "Second dump" >&2
tar -g incr -cf arch.2 -v foo 2>tmperr
sort tmperr >&2

tar xfg arch.1 /dev/null

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "First dump
tar: foo/a: Directory is new
tar: foo/b: Directory is new
tar: foo/c: Directory is new
Second dump
tar: foo/a: Directory has been renamed from \`foo/c'
tar: foo/b: Directory has been renamed from \`foo/a'
tar: foo/c: Directory has been renamed from \`foo/b'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "First dump
foo/
foo/a/
foo/b/
foo/c/
foo/file1
foo/file2
foo/a/filea
foo/b/fileb
foo/c/filec
Second dump
foo/
foo/a/
foo/b/
foo/c/
Begin directory listing 1
foo
foo/a
foo/a/filea
foo/b
foo/b/fileb
foo/c
foo/c/filec
foo/file1
foo/file2
End directory listing 1
foo/
foo/a/
foo/b/
foo/c/
Begin directory listing 2
foo
foo/a
foo/a/filec
foo/b
foo/b/filea
foo/c
foo/c/fileb
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename03.at:122: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "rename03.at:122:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2

mkdir foo/a
genfile --file foo/a/filea

mkdir foo/b
genfile --file foo/b/fileb

mkdir foo/c
genfile --file foo/c/filec

echo \"First dump\"
echo \"First dump\">&2
tar -g incr -cf arch.1 -v foo 2>tmperr
sort tmperr >&2

# Shuffle directories:
(cd foo
mv a \$\$
mv c a
mv b c
mv \$\$ b)

echo \"Second dump\"
echo \"Second dump\" >&2
tar -g incr -cf arch.2 -v foo 2>tmperr
sort tmperr >&2

tar xfg arch.1 /dev/null

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename03.at:122 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2

mkdir foo/a
genfile --file foo/a/filea

mkdir foo/b
genfile --file foo/b/fileb

mkdir foo/c
genfile --file foo/c/filec

echo "First dump"
echo "First dump">&2
tar -g incr -cf arch.1 -v foo 2>tmperr
sort tmperr >&2

# Shuffle directories:
(cd foo
mv a $$
mv c a
mv b c
mv $$ b)

echo "Second dump"
echo "Second dump" >&2
tar -g incr -cf arch.2 -v foo 2>tmperr
sort tmperr >&2

tar xfg arch.1 /dev/null

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "First dump
tar: foo/a: Directory is new
tar: foo/b: Directory is new
tar: foo/c: Directory is new
Second dump
tar: foo/a: Directory has been renamed from \`foo/c'
tar: foo/b: Directory has been renamed from \`foo/a'
tar: foo/c: Directory has been renamed from \`foo/b'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "First dump
foo/
foo/a/
foo/b/
foo/c/
foo/file1
foo/file2
foo/a/filea
foo/b/fileb
foo/c/filec
Second dump
foo/
foo/a/
foo/b/
foo/c/
Begin directory listing 1
foo
foo/a
foo/a/filea
foo/b
foo/b/fileb
foo/c
foo/c/filec
foo/file1
foo/file2
End directory listing 1
foo/
foo/a/
foo/b/
foo/c/
Begin directory listing 2
foo
foo/a
foo/a/filec
foo/b
foo/b/filea
foo/c
foo/c/fileb
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename03.at:122: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "rename03.at:122:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2

mkdir foo/a
genfile --file foo/a/filea

mkdir foo/b
genfile --file foo/b/fileb

mkdir foo/c
genfile --file foo/c/filec

echo \"First dump\"
echo \"First dump\">&2
tar -g incr -cf arch.1 -v foo 2>tmperr
sort tmperr >&2

# Shuffle directories:
(cd foo
mv a \$\$
mv c a
mv b c
mv \$\$ b)

echo \"Second dump\"
echo \"Second dump\" >&2
tar -g incr -cf arch.2 -v foo 2>tmperr
sort tmperr >&2

tar xfg arch.1 /dev/null

echo \"Begin directory listing 1\"
find foo | sort
echo \"End directory listing 1\"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
)"
echo rename03.at:122 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkdir foo
genfile --file foo/file1
genfile --file foo/file2

mkdir foo/a
genfile --file foo/a/filea

mkdir foo/b
genfile --file foo/b/fileb

mkdir foo/c
genfile --file foo/c/filec

echo "First dump"
echo "First dump">&2
tar -g incr -cf arch.1 -v foo 2>tmperr
sort tmperr >&2

# Shuffle directories:
(cd foo
mv a $$
mv c a
mv b c
mv $$ b)

echo "Second dump"
echo "Second dump" >&2
tar -g incr -cf arch.2 -v foo 2>tmperr
sort tmperr >&2

tar xfg arch.1 /dev/null

echo "Begin directory listing 1"
find foo | sort
echo "End directory listing 1"

tar xfgv arch.2 /dev/null
echo Begin directory listing 2
find foo | sort
echo End directory listing 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "First dump
tar: foo/a: Directory is new
tar: foo/b: Directory is new
tar: foo/c: Directory is new
Second dump
tar: foo/a: Directory has been renamed from \`foo/c'
tar: foo/b: Directory has been renamed from \`foo/a'
tar: foo/c: Directory has been renamed from \`foo/b'
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "First dump
foo/
foo/a/
foo/b/
foo/c/
foo/file1
foo/file2
foo/a/filea
foo/b/fileb
foo/c/filec
Second dump
foo/
foo/a/
foo/b/
foo/c/
Begin directory listing 1
foo
foo/a
foo/a/filea
foo/b
foo/b/fileb
foo/c
foo/c/filec
foo/file1
foo/file2
End directory listing 1
foo/
foo/a/
foo/b/
foo/c/
Begin directory listing 2
foo
foo/a
foo/a/filec
foo/b
foo/b/filea
foo/c
foo/c/fileb
foo/file1
foo/file2
End directory listing 2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "rename03.at:122: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  29 ) # 29. chtype.at:27: changed file types in incrementals
    at_setup_line='chtype.at:27'
    at_desc='changed file types in incrementals'
    $at_quiet $ECHO_N " 29: changed file types in incrementals           $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "29. chtype.at:27: testing ..."
      $at_traceon





  $at_traceoff
echo "chtype.at:69:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkinstalldirs directory/b/c >/dev/null
genfile --file directory/b/c/x
mkdir directory/a
genfile --file directory/a/a

echo First backup
tar --create --file=archive.1 --listed-incremental=db.1 directory

sleep 2

# Remove directory b and create a file with this name.
# Previous versions were not able to restore over this file.
rm -r directory/b
genfile --file directory/b
genfile --file directory/a/b

echo Second backup
tar --create --file=archive.2 --listed-incremental=db.2 directory

# Delete a
rm -r directory

echo Restore archive.1
tar -xf archive.1 --listed-incremental=/dev/null
echo Restore archive.2
tar -xf archive.2 --listed-incremental=/dev/null
find directory | sort
)"
echo chtype.at:69 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkinstalldirs directory/b/c >/dev/null
genfile --file directory/b/c/x
mkdir directory/a
genfile --file directory/a/a

echo First backup
tar --create --file=archive.1 --listed-incremental=db.1 directory

sleep 2

# Remove directory b and create a file with this name.
# Previous versions were not able to restore over this file.
rm -r directory/b
genfile --file directory/b
genfile --file directory/a/b

echo Second backup
tar --create --file=archive.2 --listed-incremental=db.2 directory

# Delete a
rm -r directory

echo Restore archive.1
tar -xf archive.1 --listed-incremental=/dev/null
echo Restore archive.2
tar -xf archive.2 --listed-incremental=/dev/null
find directory | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "First backup
Second backup
Restore archive.1
Restore archive.2
directory
directory/a
directory/a/a
directory/a/b
directory/b
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "chtype.at:69: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "chtype.at:69:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkinstalldirs directory/b/c >/dev/null
genfile --file directory/b/c/x
mkdir directory/a
genfile --file directory/a/a

echo First backup
tar --create --file=archive.1 --listed-incremental=db.1 directory

sleep 2

# Remove directory b and create a file with this name.
# Previous versions were not able to restore over this file.
rm -r directory/b
genfile --file directory/b
genfile --file directory/a/b

echo Second backup
tar --create --file=archive.2 --listed-incremental=db.2 directory

# Delete a
rm -r directory

echo Restore archive.1
tar -xf archive.1 --listed-incremental=/dev/null
echo Restore archive.2
tar -xf archive.2 --listed-incremental=/dev/null
find directory | sort
)"
echo chtype.at:69 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkinstalldirs directory/b/c >/dev/null
genfile --file directory/b/c/x
mkdir directory/a
genfile --file directory/a/a

echo First backup
tar --create --file=archive.1 --listed-incremental=db.1 directory

sleep 2

# Remove directory b and create a file with this name.
# Previous versions were not able to restore over this file.
rm -r directory/b
genfile --file directory/b
genfile --file directory/a/b

echo Second backup
tar --create --file=archive.2 --listed-incremental=db.2 directory

# Delete a
rm -r directory

echo Restore archive.1
tar -xf archive.1 --listed-incremental=/dev/null
echo Restore archive.2
tar -xf archive.2 --listed-incremental=/dev/null
find directory | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "First backup
Second backup
Restore archive.1
Restore archive.2
directory
directory/a
directory/a/a
directory/a/b
directory/b
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "chtype.at:69: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "chtype.at:69:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkinstalldirs directory/b/c >/dev/null
genfile --file directory/b/c/x
mkdir directory/a
genfile --file directory/a/a

echo First backup
tar --create --file=archive.1 --listed-incremental=db.1 directory

sleep 2

# Remove directory b and create a file with this name.
# Previous versions were not able to restore over this file.
rm -r directory/b
genfile --file directory/b
genfile --file directory/a/b

echo Second backup
tar --create --file=archive.2 --listed-incremental=db.2 directory

# Delete a
rm -r directory

echo Restore archive.1
tar -xf archive.1 --listed-incremental=/dev/null
echo Restore archive.2
tar -xf archive.2 --listed-incremental=/dev/null
find directory | sort
)"
echo chtype.at:69 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


mkinstalldirs directory/b/c >/dev/null
genfile --file directory/b/c/x
mkdir directory/a
genfile --file directory/a/a

echo First backup
tar --create --file=archive.1 --listed-incremental=db.1 directory

sleep 2

# Remove directory b and create a file with this name.
# Previous versions were not able to restore over this file.
rm -r directory/b
genfile --file directory/b
genfile --file directory/a/b

echo Second backup
tar --create --file=archive.2 --listed-incremental=db.2 directory

# Delete a
rm -r directory

echo Restore archive.1
tar -xf archive.1 --listed-incremental=/dev/null
echo Restore archive.2
tar -xf archive.2 --listed-incremental=/dev/null
find directory | sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "First backup
Second backup
Restore archive.1
Restore archive.2
directory
directory/a
directory/a/a
directory/a/b
directory/b
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "chtype.at:69: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  30 ) # 30. ignfail.at:23: ignfail
    at_setup_line='ignfail.at:23'
    at_desc='ignfail'
    $at_quiet $ECHO_N " 30: ignfail                                      $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "30. ignfail.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "ignfail.at:75:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=\$?
chmod 600 file
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=\$?
chmod 600 file
test \$status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=\$?
chmod 700 directory
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=\$?
chmod 700 directory
test \$status = 0
)"
echo ignfail.at:75 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=$?
chmod 600 file
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=$?
chmod 600 file
test $status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=$?
chmod 700 directory
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=$?
chmod 700 directory
test $status = 0
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "-----
tar: file: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: file: Warning: Cannot open: Permission denied
-----
tar: directory: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: directory: Warning: Cannot open: Permission denied
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "ignfail.at:75: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "ignfail.at:75:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=\$?
chmod 600 file
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=\$?
chmod 600 file
test \$status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=\$?
chmod 700 directory
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=\$?
chmod 700 directory
test \$status = 0
)"
echo ignfail.at:75 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=$?
chmod 600 file
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=$?
chmod 600 file
test $status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=$?
chmod 700 directory
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=$?
chmod 700 directory
test $status = 0
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "-----
tar: file: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: file: Warning: Cannot open: Permission denied
-----
tar: directory: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: directory: Warning: Cannot open: Permission denied
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "ignfail.at:75: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "ignfail.at:75:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=\$?
chmod 600 file
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=\$?
chmod 600 file
test \$status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=\$?
chmod 700 directory
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=\$?
chmod 700 directory
test \$status = 0
)"
echo ignfail.at:75 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=$?
chmod 600 file
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=$?
chmod 600 file
test $status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=$?
chmod 700 directory
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=$?
chmod 700 directory
test $status = 0
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "-----
tar: file: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: file: Warning: Cannot open: Permission denied
-----
tar: directory: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: directory: Warning: Cannot open: Permission denied
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "ignfail.at:75: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "ignfail.at:75:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=\$?
chmod 600 file
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=\$?
chmod 600 file
test \$status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=\$?
chmod 700 directory
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=\$?
chmod 700 directory
test \$status = 0
)"
echo ignfail.at:75 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=$?
chmod 600 file
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=$?
chmod 600 file
test $status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=$?
chmod 700 directory
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=$?
chmod 700 directory
test $status = 0
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "-----
tar: file: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: file: Warning: Cannot open: Permission denied
-----
tar: directory: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: directory: Warning: Cannot open: Permission denied
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "ignfail.at:75: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "ignfail.at:75:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=\$?
chmod 600 file
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=\$?
chmod 600 file
test \$status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=\$?
chmod 700 directory
test \$status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=\$?
chmod 700 directory
test \$status = 0
)"
echo ignfail.at:75 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

# The test is meaningless for super-user.

echo "test" > $$
chmod 0 $$
cat $$ > /dev/null 2>&1
result=$?
rm -f $$
test $result -eq 0 && exit 77


touch file
mkdir directory
touch directory/file

echo 1>&2 -----
chmod 000 file
tar cf archive file
status=$?
chmod 600 file
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=$?
chmod 600 file
test $status = 0 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive directory
status=$?
chmod 700 directory
test $status = 2 || exit 1

echo 1>&2 -----
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=$?
chmod 700 directory
test $status = 0
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "-----
tar: file: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: file: Warning: Cannot open: Permission denied
-----
tar: directory: Cannot open: Permission denied
tar: Error exit delayed from previous errors
-----
tar: directory: Warning: Cannot open: Permission denied
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "ignfail.at:75: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  31 ) # 31. link01.at:33: link count gt 2
    at_setup_line='link01.at:33'
    at_desc='link count gt 2'
    $at_quiet $ECHO_N " 31: link count gt 2                              $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "31. link01.at:33: testing ..."
      $at_traceon





  $at_traceoff
echo "link01.at:53:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
)"
echo link01.at:53 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "test.txt
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "link01.at:53: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "link01.at:53:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
)"
echo link01.at:53 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "test.txt
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "link01.at:53: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "link01.at:53:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
)"
echo link01.at:53 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "test.txt
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "link01.at:53: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "link01.at:53:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
)"
echo link01.at:53 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "test.txt
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "link01.at:53: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "link01.at:53:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
)"
echo link01.at:53 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
mkdir directory/test1
mkdir directory/test2

echo TEST > directory/test1/test.txt
ln directory/test1/test.txt directory/test2/test.txt || exit 77

tar cf archive directory/test1/test.txt directory/test1/test.txt

rm -r directory
tar xf archive

ls directory/test1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "test.txt
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "link01.at:53: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  32 ) # 32. longv7.at:24: long names in V7 archives
    at_setup_line='longv7.at:24'
    at_desc='long names in V7 archives'
    $at_quiet $ECHO_N " 32: long names in V7 archives                    $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "32. longv7.at:24: testing ..."
      $at_traceon








  $at_traceoff
echo "longv7.at:45:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems
touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c

tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems
echo separator
tar tf archive
)"
echo longv7.at:45 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems
touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c

tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems
echo separator
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c: file name is too long (max 99); not dumped
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
this_is_a_very_long_name_for_a_directory_which_causes_problems/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "longv7.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  33 ) # 33. long01.at:28: long file names divisible by block size
    at_setup_line='long01.at:28'
    at_desc='long file names divisible by block size'
    $at_quiet $ECHO_N " 33: long file names divisible by block size      $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "33. long01.at:28: testing ..."
      $at_traceon









  $at_traceoff
echo "long01.at:46:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


mkinstalldirs 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null
genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde
echo test > endfile

tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile
tar tf archive)"
echo long01.at:46 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


mkinstalldirs 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null
genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde
echo test > endfile

tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde
endfile
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "long01.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "long01.at:46:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


mkinstalldirs 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null
genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde
echo test > endfile

tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile
tar tf archive)"
echo long01.at:46 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


mkinstalldirs 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null
genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde
echo test > endfile

tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde
endfile
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "long01.at:46: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  34 ) # 34. lustar01.at:21: ustar: unsplittable file name
    at_setup_line='lustar01.at:21'
    at_desc='ustar: unsplittable file name'
    $at_quiet $ECHO_N " 34: ustar: unsplittable file name                $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "34. lustar01.at:21: testing ..."
      $at_traceon







  $at_traceoff
echo "lustar01.at:35:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix
tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix
)"
echo lustar01.at:35 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix
tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix: file name is too long (cannot be split); not dumped
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   2) ;;
   *) echo "lustar01.at:35: exit code was $at_status, expected 2"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  35 ) # 35. lustar02.at:21: ustar: unsplittable path name
    at_setup_line='lustar02.at:21'
    at_desc='ustar: unsplittable path name'
    $at_quiet $ECHO_N " 35: ustar: unsplittable path name                $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "35. lustar02.at:21: testing ..."
      $at_traceon











  $at_traceoff
echo "lustar02.at:40:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


mkinstalldirs this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null
genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix
tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
)"
echo lustar02.at:40 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


mkinstalldirs this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null
genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix
tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/: file name is too long (cannot be split); not dumped
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   2) ;;
   *) echo "lustar02.at:40: exit code was $at_status, expected 2"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  36 ) # 36. lustar03.at:21: ustar: splitting long names
    at_setup_line='lustar03.at:21'
    at_desc='ustar: splitting long names'
    $at_quiet $ECHO_N " 36: ustar: splitting long names                  $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "36. lustar03.at:21: testing ..."
      $at_traceon









  $at_traceoff
echo "lustar03.at:41:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


mkinstalldirs this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null
genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file
echo \"Create archive\"
tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
echo \"List archive\"
tar tf archive)"
echo lustar03.at:41 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


mkinstalldirs this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null
genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file
echo "Create archive"
tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
echo "List archive"
tar tf archive) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Create archive
List archive
this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/
this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "lustar03.at:41: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  37 ) # 37. multiv01.at:23: multivolume dumps from pipes
    at_setup_line='multiv01.at:23'
    at_desc='multivolume dumps from pipes'
    $at_quiet $ECHO_N " 37: multivolume dumps from pipes                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "37. multiv01.at:23: testing ..."
      $at_traceon



# Fixme: should be configurable
#  TRUSS=truss -o /tmp/tr
#  TRUSS=strace



  $at_traceoff
echo "multiv01.at:62:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --length 7168 --file file1

for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
  for count in 2 3 4 5 6 7 8 ; do
    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
  done
done >file2

if test \$TEST_TAR_FORMAT = pax; then
  TAPE_LENGTH=11
else
  TAPE_LENGTH=10
fi

tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
  --listed-incremental=t.snar \\
  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1

mkdir extract-dir-pipe
dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
      -C extract-dir-pipe -x --multi-volume \\
      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1

cmp file1 extract-dir-pipe/file1
cmp file2 extract-dir-pipe/file2
)"
echo multiv01.at:62 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --length 7168 --file file1

for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  for count in 2 3 4 5 6 7 8 ; do
    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  done
done >file2

if test $TEST_TAR_FORMAT = pax; then
  TAPE_LENGTH=11
else
  TAPE_LENGTH=10
fi

tar -c --multi-volume --tape-length=$TAPE_LENGTH \
  --listed-incremental=t.snar \
  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1

mkdir extract-dir-pipe
dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
      -C extract-dir-pipe -x --multi-volume \
      --tape-length=$TAPE_LENGTH --read-full-records || exit 1

cmp file1 extract-dir-pipe/file1
cmp file2 extract-dir-pipe/file2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv01.at:62: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "multiv01.at:62:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --length 7168 --file file1

for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
  for count in 2 3 4 5 6 7 8 ; do
    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
  done
done >file2

if test \$TEST_TAR_FORMAT = pax; then
  TAPE_LENGTH=11
else
  TAPE_LENGTH=10
fi

tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
  --listed-incremental=t.snar \\
  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1

mkdir extract-dir-pipe
dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
      -C extract-dir-pipe -x --multi-volume \\
      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1

cmp file1 extract-dir-pipe/file1
cmp file2 extract-dir-pipe/file2
)"
echo multiv01.at:62 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --length 7168 --file file1

for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  for count in 2 3 4 5 6 7 8 ; do
    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  done
done >file2

if test $TEST_TAR_FORMAT = pax; then
  TAPE_LENGTH=11
else
  TAPE_LENGTH=10
fi

tar -c --multi-volume --tape-length=$TAPE_LENGTH \
  --listed-incremental=t.snar \
  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1

mkdir extract-dir-pipe
dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
      -C extract-dir-pipe -x --multi-volume \
      --tape-length=$TAPE_LENGTH --read-full-records || exit 1

cmp file1 extract-dir-pipe/file1
cmp file2 extract-dir-pipe/file2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv01.at:62: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "multiv01.at:62:
mkdir pax
(cd pax
TEST_TAR_FORMAT=pax
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H pax\"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --length 7168 --file file1

for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
  for count in 2 3 4 5 6 7 8 ; do
    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
  done
done >file2

if test \$TEST_TAR_FORMAT = pax; then
  TAPE_LENGTH=11
else
  TAPE_LENGTH=10
fi

tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
  --listed-incremental=t.snar \\
  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1

mkdir extract-dir-pipe
dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
      -C extract-dir-pipe -x --multi-volume \\
      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1

cmp file1 extract-dir-pipe/file1
cmp file2 extract-dir-pipe/file2
)"
echo multiv01.at:62 >$at_check_line_file
( $at_traceon;
mkdir pax
(cd pax
TEST_TAR_FORMAT=pax
export TEST_TAR_FORMAT
TAR_OPTIONS="-H pax"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --length 7168 --file file1

for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  for count in 2 3 4 5 6 7 8 ; do
    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  done
done >file2

if test $TEST_TAR_FORMAT = pax; then
  TAPE_LENGTH=11
else
  TAPE_LENGTH=10
fi

tar -c --multi-volume --tape-length=$TAPE_LENGTH \
  --listed-incremental=t.snar \
  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1

mkdir extract-dir-pipe
dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
      -C extract-dir-pipe -x --multi-volume \
      --tape-length=$TAPE_LENGTH --read-full-records || exit 1

cmp file1 extract-dir-pipe/file1
cmp file2 extract-dir-pipe/file2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv01.at:62: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  38 ) # 38. multiv02.at:28: skipping a straddling member
    at_setup_line='multiv02.at:28'
    at_desc='skipping a straddling member'
    $at_quiet $ECHO_N " 38: skipping a straddling member                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "38. multiv02.at:28: testing ..."
      $at_traceon





  $at_traceoff
echo "multiv02.at:47:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile --length 10240 --file en
genfile --length 20000 --file to
genfile --length 20000 --file tre
genfile --length 10240 --file fire

exec <&-

tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
echo separator
tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1
)"
echo multiv02.at:47 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile --length 10240 --file en
genfile --length 20000 --file to
genfile --length 20000 --file tre
genfile --length 10240 --file fire

exec <&-

tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
echo separator
tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
en
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "multiv02.at:47:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile --length 10240 --file en
genfile --length 20000 --file to
genfile --length 20000 --file tre
genfile --length 10240 --file fire

exec <&-

tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
echo separator
tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1
)"
echo multiv02.at:47 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile --length 10240 --file en
genfile --length 20000 --file to
genfile --length 20000 --file tre
genfile --length 10240 --file fire

exec <&-

tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
echo separator
tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
en
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "multiv02.at:47:
mkdir pax
(cd pax
TEST_TAR_FORMAT=pax
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H pax\"
export TAR_OPTIONS
rm -rf *

genfile --length 10240 --file en
genfile --length 20000 --file to
genfile --length 20000 --file tre
genfile --length 10240 --file fire

exec <&-

tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
echo separator
tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1
)"
echo multiv02.at:47 >$at_check_line_file
( $at_traceon;
mkdir pax
(cd pax
TEST_TAR_FORMAT=pax
export TEST_TAR_FORMAT
TAR_OPTIONS="-H pax"
export TAR_OPTIONS
rm -rf *

genfile --length 10240 --file en
genfile --length 20000 --file to
genfile --length 20000 --file tre
genfile --length 10240 --file fire

exec <&-

tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
echo separator
tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
en
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  39 ) # 39. multiv03.at:30: MV archive & long filenames
    at_setup_line='multiv03.at:30'
    at_desc='MV archive & long filenames'
    $at_quiet $ECHO_N " 39: MV archive & long filenames                  $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "39. multiv03.at:30: testing ..."
      $at_traceon





  $at_traceoff
echo "multiv03.at:68:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\`
BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\`

cat > ../experr <<EOF
tar: \$BFILE: file name too long to be stored in a GNU multivolume header, truncated
tar: \\\`\$BFILE' is possibly continued on this volume: header contains truncated name
EOF

cat > ../expout <<EOF
\$AFILE
separator-1
separator-2
EOF

genfile --length 15360 --file \$AFILE

exec <&-

tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1
tar -tM -f arch.1 -f arch.2 || exit 1

echo separator-1

genfile --length 15360 --file \$BFILE
tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1

echo separator-2
mv \$BFILE bfile
tar -M -x -f arch.1 -f arch.2 || exit 1
cmp \$BFILE bfile
)"
echo multiv03.at:68 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'`
BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'`

cat > ../experr <<EOF
tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
tar: \`$BFILE' is possibly continued on this volume: header contains truncated name
EOF

cat > ../expout <<EOF
$AFILE
separator-1
separator-2
EOF

genfile --length 15360 --file $AFILE

exec <&-

tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
tar -tM -f arch.1 -f arch.2 || exit 1

echo separator-1

genfile --length 15360 --file $BFILE
tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1

echo separator-2
mv $BFILE bfile
tar -M -x -f arch.1 -f arch.2 || exit 1
cmp $BFILE bfile
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff experr $at_stderr || at_failed=:
$at_diff expout $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv03.at:68: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "multiv03.at:68:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\`
BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\`

cat > ../experr <<EOF
tar: \$BFILE: file name too long to be stored in a GNU multivolume header, truncated
tar: \\\`\$BFILE' is possibly continued on this volume: header contains truncated name
EOF

cat > ../expout <<EOF
\$AFILE
separator-1
separator-2
EOF

genfile --length 15360 --file \$AFILE

exec <&-

tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1
tar -tM -f arch.1 -f arch.2 || exit 1

echo separator-1

genfile --length 15360 --file \$BFILE
tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1

echo separator-2
mv \$BFILE bfile
tar -M -x -f arch.1 -f arch.2 || exit 1
cmp \$BFILE bfile
)"
echo multiv03.at:68 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'`
BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'`

cat > ../experr <<EOF
tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
tar: \`$BFILE' is possibly continued on this volume: header contains truncated name
EOF

cat > ../expout <<EOF
$AFILE
separator-1
separator-2
EOF

genfile --length 15360 --file $AFILE

exec <&-

tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
tar -tM -f arch.1 -f arch.2 || exit 1

echo separator-1

genfile --length 15360 --file $BFILE
tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1

echo separator-2
mv $BFILE bfile
tar -M -x -f arch.1 -f arch.2 || exit 1
cmp $BFILE bfile
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff experr $at_stderr || at_failed=:
$at_diff expout $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv03.at:68: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  40 ) # 40. multiv04.at:36: split directory members in a MV archive
    at_setup_line='multiv04.at:36'
    at_desc='split directory members in a MV archive'
    $at_quiet $ECHO_N " 40: split directory members in a MV archive      $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "40. multiv04.at:36: testing ..."
      $at_traceon





  $at_traceoff
echo "multiv04.at:64:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


mkdir directory
awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' </dev/null | genfile --files-from -

exec <&-

sleep 2

tar --listed-incremental=list -c -f archive.a directory

sleep 2

tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory

echo separator

tar -MRt -f arc.1 -f arc.2)"
echo multiv04.at:64 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


mkdir directory
awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' </dev/null | genfile --files-from -

exec <&-

sleep 2

tar --listed-incremental=list -c -f archive.a directory

sleep 2

tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory

echo separator

tar -MRt -f arc.1 -f arc.2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
separator
block 0: directory/
block 35: ** Block of NULs **
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv04.at:64: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "multiv04.at:64:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


mkdir directory
awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' </dev/null | genfile --files-from -

exec <&-

sleep 2

tar --listed-incremental=list -c -f archive.a directory

sleep 2

tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory

echo separator

tar -MRt -f arc.1 -f arc.2)"
echo multiv04.at:64 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


mkdir directory
awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' </dev/null | genfile --files-from -

exec <&-

sleep 2

tar --listed-incremental=list -c -f archive.a directory

sleep 2

tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory

echo separator

tar -MRt -f arc.1 -f arc.2) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
separator
block 0: directory/
block 35: ** Block of NULs **
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multiv04.at:64: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  41 ) # 41. old.at:23: old archives
    at_setup_line='old.at:23'
    at_desc='old archives'
    $at_quiet $ECHO_N " 41: old archives                                 $ECHO_C"
    at_xfail=no
    (
      echo "41. old.at:23: testing ..."
      $at_traceon



unset TAR_OPTIONS
$at_traceoff
echo "old.at:35:
mkdir directory
tar cfvo archive directory || exit 1
tar tf archive
"
echo old.at:35 >$at_check_line_file
( $at_traceon;
mkdir directory
tar cfvo archive directory || exit 1
tar tf archive
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "old.at:35: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  42 ) # 42. recurse.at:21: recurse
    at_setup_line='recurse.at:21'
    at_desc='recurse'
    $at_quiet $ECHO_N " 42: recurse                                      $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "42. recurse.at:21: testing ..."
      $at_traceon





  $at_traceoff
echo "recurse.at:32:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
)"
echo recurse.at:32 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "recurse.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "recurse.at:32:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
)"
echo recurse.at:32 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "recurse.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "recurse.at:32:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
)"
echo recurse.at:32 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "recurse.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "recurse.at:32:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
)"
echo recurse.at:32 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "recurse.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "recurse.at:32:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
)"
echo recurse.at:32 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
touch directory/file
tar --create --file archive --no-recursion directory || exit 1
tar tf archive
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "directory/
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "recurse.at:32: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  43 ) # 43. same-order01.at:26: working -C with --same-order
    at_setup_line='same-order01.at:26'
    at_desc='working -C with --same-order'
    $at_quiet $ECHO_N " 43: working -C with --same-order                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "43. same-order01.at:26: testing ..."
      $at_traceon





  $at_traceoff
echo "same-order01.at:44:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
)"
echo same-order01.at:44 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order01.at:44: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order01.at:44:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
)"
echo same-order01.at:44 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order01.at:44: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order01.at:44:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
)"
echo same-order01.at:44 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order01.at:44: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order01.at:44:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
)"
echo same-order01.at:44 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order01.at:44: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order01.at:44:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
)"
echo same-order01.at:44 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir directory
tar -xf archive --same-order -C directory || exit 1

ls directory|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order01.at:44: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  44 ) # 44. same-order02.at:25: multiple -C options
    at_setup_line='same-order02.at:25'
    at_desc='multiple -C options'
    $at_quiet $ECHO_N " 44: multiple -C options                          $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "44. same-order02.at:25: testing ..."
      $at_traceon





  $at_traceoff
echo "same-order02.at:47:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=\`pwd\`
tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1

ls en
echo separator
ls to
)"
echo same-order02.at:47 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=`pwd`
tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1

ls en
echo separator
ls to
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
separator
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order02.at:47:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=\`pwd\`
tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1

ls en
echo separator
ls to
)"
echo same-order02.at:47 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=`pwd`
tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1

ls en
echo separator
ls to
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
separator
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order02.at:47:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=\`pwd\`
tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1

ls en
echo separator
ls to
)"
echo same-order02.at:47 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=`pwd`
tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1

ls en
echo separator
ls to
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
separator
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order02.at:47:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=\`pwd\`
tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1

ls en
echo separator
ls to
)"
echo same-order02.at:47 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=`pwd`
tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1

ls en
echo separator
ls to
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
separator
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "same-order02.at:47:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=\`pwd\`
tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1

ls en
echo separator
ls to
)"
echo same-order02.at:47 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile -l 1024 -f file1
genfile -l 1024 -f file2
tar cf archive file1 file2

mkdir en
mkdir to

HERE=`pwd`
tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1

ls en
echo separator
ls to
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "file1
separator
file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "same-order02.at:47: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  45 ) # 45. shortrec.at:25: short records
    at_setup_line='shortrec.at:25'
    at_desc='short records'
    $at_quiet $ECHO_N " 45: short records                                $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "45. shortrec.at:25: testing ..."
      $at_traceon





  $at_traceoff
echo "shortrec.at:37:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
)"
echo shortrec.at:37 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "shortrec.at:37: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "shortrec.at:37:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
)"
echo shortrec.at:37 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "shortrec.at:37: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "shortrec.at:37:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
)"
echo shortrec.at:37 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "shortrec.at:37: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "shortrec.at:37:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
)"
echo shortrec.at:37 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "shortrec.at:37: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "shortrec.at:37:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
)"
echo shortrec.at:37 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

mkdir directory
(cd directory && touch a b c d e f g h i j k l m n o p q r)
tar -c -b 1 directory | tar -t >/dev/null
tar -c -b 1 -f archive directory
tar -t -f archive >/dev/null
tar -t -f - < archive >/dev/null

rm -r directory
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "shortrec.at:37: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  46 ) # 46. sparse01.at:21: sparse files
    at_setup_line='sparse01.at:21'
    at_desc='sparse files'
    $at_quiet $ECHO_N " 46: sparse files                                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "46. sparse01.at:21: testing ..."
      $at_traceon





  $at_traceoff
echo "sparse01.at:40:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 -f begin
genfile --length 1000 -f end
genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
)"
echo sparse01.at:40 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 -f begin
genfile --length 1000 -f end
genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo stdout:; tee stdout <$at_stdout
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparse01.at:40: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "sparse01.at:40:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 -f begin
genfile --length 1000 -f end
genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
)"
echo sparse01.at:40 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 -f begin
genfile --length 1000 -f end
genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo stdout:; tee stdout <$at_stdout
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparse01.at:40: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "sparse01.at:40:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 -f begin
genfile --length 1000 -f end
genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
)"
echo sparse01.at:40 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 -f begin
genfile --length 1000 -f end
genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo stdout:; tee stdout <$at_stdout
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparse01.at:40: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon




cat >stdout.re <<'_ATEOF'
separator
-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin
-rw-r--r-- ^ ^ *  *10344448 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile
-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end
separator
sparsefile 10344448
_ATEOF

awk '{print NR " " $0}' stdout > $$.1
awk '{print NR " " $0}' stdout.re | join - $$.1 |
while read NUM RE LINE
do
  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
done


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  47 ) # 47. sparse02.at:21: extracting sparse file over a pipe
    at_setup_line='sparse02.at:21'
    at_desc='extracting sparse file over a pipe'
    $at_quiet $ECHO_N " 47: extracting sparse file over a pipe           $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "47. sparse02.at:21: testing ..."
      $at_traceon



# Tar 1.14 - 1.15.1 was unable to extract sparse files to a pipe.
# References: <16896.21739.460782.124775@jik.kamens.brookline.ma.us>
# http://lists.gnu.org/archive/html/bug-tar/2005-02/msg00003.html



  $at_traceoff
echo "sparse02.at:39:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse sparsefile || exit 1
echo separator

tar xfO archive | cat - > sparsecopy || exit 1
cmp sparsefile sparsecopy
)"
echo sparse02.at:39 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse sparsefile || exit 1
echo separator

tar xfO archive | cat - > sparsecopy || exit 1
cmp sparsefile sparsecopy
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparse02.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "sparse02.at:39:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse sparsefile || exit 1
echo separator

tar xfO archive | cat - > sparsecopy || exit 1
cmp sparsefile sparsecopy
)"
echo sparse02.at:39 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse sparsefile || exit 1
echo separator

tar xfO archive | cat - > sparsecopy || exit 1
cmp sparsefile sparsecopy
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparse02.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "sparse02.at:39:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse sparsefile || exit 1
echo separator

tar xfO archive | cat - > sparsecopy || exit 1
cmp sparsefile sparsecopy
)"
echo sparse02.at:39 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
tar -c -f archive --sparse sparsefile || exit 1
echo separator

tar xfO archive | cat - > sparsecopy || exit 1
cmp sparsefile sparsecopy
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparse02.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  48 ) # 48. sparse03.at:21: storing sparse files > 8G
    at_setup_line='sparse03.at:21'
    at_desc='storing sparse files > 8G'
    $at_quiet $ECHO_N " 48: storing sparse files > 8G                    $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "48. sparse03.at:21: testing ..."
      $at_traceon



# Tar 1.15.1 incorrectly computed sparse member size if the extended
# PAX header contained size keyword.
# References: <87vf46nb36.fsf@penguin.cs.ucla.edu>
# http://lists.gnu.org/archive/html/bug-tar/2005-06/msg00040.html



  $at_traceoff
echo "sparse03.at:45:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 --file begin
genfile --length 1000 --file end
genfile --sparse --file sparsefile --block-size 512 8G A || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
)"
echo sparse03.at:45 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile --length 1000 --file begin
genfile --length 1000 --file end
genfile --sparse --file sparsefile --block-size 512 8G A || exit 77
tar -c -f archive --sparse begin sparsefile end || exit 1
echo separator

tar tfv archive
echo separator
mkdir directory
tar Cxf directory archive
genfile --stat=name,size sparsefile
cmp sparsefile directory/sparsefile
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo stdout:; tee stdout <$at_stdout
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparse03.at:45: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon




cat >stdout.re <<'_ATEOF'
separator
-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin
-rw-r--r-- ^ ^ *  *8589935104 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile
-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end
separator
sparsefile 8589935104
_ATEOF

awk '{print NR " " $0}' stdout > $$.1
awk '{print NR " " $0}' stdout.re | join - $$.1 |
while read NUM RE LINE
do
  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
done


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  49 ) # 49. sparsemv.at:21: sparse files in MV archives
    at_setup_line='sparsemv.at:21'
    at_desc='sparse files in MV archives'
    $at_quiet $ECHO_N " 49: sparse files in MV archives                  $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "49. sparsemv.at:21: testing ..."
      $at_traceon



# Check if sparse files are correctly split between GNU multi-volume
# archives.
# There are two cases: the file can be split within an empty (null) block,
# or within a data block. Since null blocks are not archived, the first
# case means the file is split between two consecutive data blocks.
#



  $at_traceoff
echo "sparsemv.at:63:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
echo \"Pass 1: Split between data blocks\"
echo \"Create archive\"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo \"Test archive\"
tar -t -M -f arc.1 -f arc.2
echo \"Compare archive\"
tar -d -M -f arc.1 -f arc.2

echo \"Pass 2: Split within a data block\"
genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
echo \"Create archive\"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo \"Test archive\"
tar -t -M -f arc.1 -f arc.2
echo \"Compare archive\"
tar -d -M -f arc.1 -f arc.2
)"
echo sparsemv.at:63 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
echo "Pass 1: Split between data blocks"
echo "Create archive"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo "Test archive"
tar -t -M -f arc.1 -f arc.2
echo "Compare archive"
tar -d -M -f arc.1 -f arc.2

echo "Pass 2: Split within a data block"
genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
echo "Create archive"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo "Test archive"
tar -t -M -f arc.1 -f arc.2
echo "Compare archive"
tar -d -M -f arc.1 -f arc.2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Pass 1: Split between data blocks
Create archive
Test archive
sparsefile
Compare archive
Pass 2: Split within a data block
Create archive
Test archive
sparsefile
Compare archive
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparsemv.at:63: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "sparsemv.at:63:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
echo \"Pass 1: Split between data blocks\"
echo \"Create archive\"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo \"Test archive\"
tar -t -M -f arc.1 -f arc.2
echo \"Compare archive\"
tar -d -M -f arc.1 -f arc.2

echo \"Pass 2: Split within a data block\"
genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
echo \"Create archive\"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo \"Test archive\"
tar -t -M -f arc.1 -f arc.2
echo \"Compare archive\"
tar -d -M -f arc.1 -f arc.2
)"
echo sparsemv.at:63 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
echo "Pass 1: Split between data blocks"
echo "Create archive"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo "Test archive"
tar -t -M -f arc.1 -f arc.2
echo "Compare archive"
tar -d -M -f arc.1 -f arc.2

echo "Pass 2: Split within a data block"
genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
echo "Create archive"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
echo "Test archive"
tar -t -M -f arc.1 -f arc.2
echo "Compare archive"
tar -d -M -f arc.1 -f arc.2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Pass 1: Split between data blocks
Create archive
Test archive
sparsefile
Compare archive
Pass 2: Split within a data block
Create archive
Test archive
sparsefile
Compare archive
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparsemv.at:63: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  50 ) # 50. sparsemvp.at:21: sparse files in PAX MV archives
    at_setup_line='sparsemvp.at:21'
    at_desc='sparse files in PAX MV archives'
    $at_quiet $ECHO_N " 50: sparse files in PAX MV archives              $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "50. sparsemvp.at:21: testing ..."
      $at_traceon



# Check if sparse files are correctly split between PAX multi-volume
# archives.
# See comment in sparsemv.at for the description.



  $at_traceoff
echo "sparsemvp.at:60:
mkdir pax
(cd pax
TEST_TAR_FORMAT=pax
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H pax\"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
echo \"Pass 1: Split between data blocks\"
echo \"Create archive\"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
echo \"Test archive\"
tar -t -M -f arc.1 -f arc.2 -f arc.3
echo \"Compare archive\"
tar -d -M -f arc.1 -f arc.2 -f arc.3

echo \"Pass 2: Split within a data block\"
genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
echo \"Create archive\"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
echo \"Test archive\"
tar -t -M -f arc.1 -f arc.2 -f arc.3
echo \"Compare archive\"
tar -d -M -f arc.1 -f arc.2 -f arc.3
)"
echo sparsemvp.at:60 >$at_check_line_file
( $at_traceon;
mkdir pax
(cd pax
TEST_TAR_FORMAT=pax
export TEST_TAR_FORMAT
TAR_OPTIONS="-H pax"
export TAR_OPTIONS
rm -rf *

exec <&-
genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
echo "Pass 1: Split between data blocks"
echo "Create archive"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
echo "Test archive"
tar -t -M -f arc.1 -f arc.2 -f arc.3
echo "Compare archive"
tar -d -M -f arc.1 -f arc.2 -f arc.3

echo "Pass 2: Split within a data block"
genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
echo "Create archive"
tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
echo "Test archive"
tar -t -M -f arc.1 -f arc.2 -f arc.3
echo "Compare archive"
tar -d -M -f arc.1 -f arc.2 -f arc.3
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Pass 1: Split between data blocks
Create archive
Test archive
sparsefile
Compare archive
Pass 2: Split within a data block
Create archive
Test archive
sparsefile
Compare archive
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "sparsemvp.at:60: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  51 ) # 51. update.at:27: update unchanged directories
    at_setup_line='update.at:27'
    at_desc='update unchanged directories'
    $at_quiet $ECHO_N " 51: update unchanged directories                 $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "51. update.at:27: testing ..."
      $at_traceon





  $at_traceoff
echo "update.at:48:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
)"
echo update.at:48 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
directory/
directory/file1
directory/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "update.at:48: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "update.at:48:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
)"
echo update.at:48 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
directory/
directory/file1
directory/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "update.at:48: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "update.at:48:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
)"
echo update.at:48 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
directory/
directory/file1
directory/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "update.at:48: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "update.at:48:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
)"
echo update.at:48 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
directory/
directory/file1
directory/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "update.at:48: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "update.at:48:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
)"
echo update.at:48 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77

mkdir directory
genfile --length 10240 --pattern zeros --file directory/file1
genfile --length 10240 --pattern default --file directory/file2

tar cf archive directory || exit 1
echo separator
tar uf archive directory || exit 1
echo separator
tar tf archive | sort || exit 1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
directory/
directory/file1
directory/file2
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "update.at:48: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  52 ) # 52. volume.at:23: volume
    at_setup_line='volume.at:23'
    at_desc='volume'
    $at_quiet $ECHO_N " 52: volume                                       $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "52. volume.at:23: testing ..."
      $at_traceon





  $at_traceoff
echo "volume.at:55:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

tar -cf archive -V label -T /dev/null || exit 1

tar xfV archive label || exit 1
tar xfV archive 'la?el' || exit 1
tar xfV archive 'l*l' || exit 1

echo 1>&2 -----
tar xfV archive lab
test \$? = 2 || exit 1
echo 1>&2 -----
tar xfV archive bel
test \$? = 2 || exit 1
echo 1>&2 -----
tar xfV archive babel
test \$? = 2
)"
echo volume.at:55 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

tar -cf archive -V label -T /dev/null || exit 1

tar xfV archive label || exit 1
tar xfV archive 'la?el' || exit 1
tar xfV archive 'l*l' || exit 1

echo 1>&2 -----
tar xfV archive lab
test $? = 2 || exit 1
echo 1>&2 -----
tar xfV archive bel
test $? = 2 || exit 1
echo 1>&2 -----
tar xfV archive babel
test $? = 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "-----
tar: Volume \`label' does not match \`lab'
tar: Error is not recoverable: exiting now
-----
tar: Volume \`label' does not match \`bel'
tar: Error is not recoverable: exiting now
-----
tar: Volume \`label' does not match \`babel'
tar: Error is not recoverable: exiting now
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "volume.at:55: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "volume.at:55:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

tar -cf archive -V label -T /dev/null || exit 1

tar xfV archive label || exit 1
tar xfV archive 'la?el' || exit 1
tar xfV archive 'l*l' || exit 1

echo 1>&2 -----
tar xfV archive lab
test \$? = 2 || exit 1
echo 1>&2 -----
tar xfV archive bel
test \$? = 2 || exit 1
echo 1>&2 -----
tar xfV archive babel
test \$? = 2
)"
echo volume.at:55 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

tar -cf archive -V label -T /dev/null || exit 1

tar xfV archive label || exit 1
tar xfV archive 'la?el' || exit 1
tar xfV archive 'l*l' || exit 1

echo 1>&2 -----
tar xfV archive lab
test $? = 2 || exit 1
echo 1>&2 -----
tar xfV archive bel
test $? = 2 || exit 1
echo 1>&2 -----
tar xfV archive babel
test $? = 2
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "-----
tar: Volume \`label' does not match \`lab'
tar: Error is not recoverable: exiting now
-----
tar: Volume \`label' does not match \`bel'
tar: Error is not recoverable: exiting now
-----
tar: Volume \`label' does not match \`babel'
tar: Error is not recoverable: exiting now
" | $at_diff - $at_stderr || at_failed=:
$at_diff $at_devnull $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "volume.at:55: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  53 ) # 53. volsize.at:29: volume header size
    at_setup_line='volsize.at:29'
    at_desc='volume header size'
    $at_quiet $ECHO_N " 53: volume header size                           $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "53. volsize.at:29: testing ..."
      $at_traceon





  $at_traceoff
echo "volsize.at:54:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf \$TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv \$TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf \$TEST_DATA_DIR/abc.tar
find abc|sort
)"
echo volsize.at:54 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf $TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv $TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf $TEST_DATA_DIR/abc.tar
find abc|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Short Listing
abc/not-a-file.gif
abc/CCC
Verbose Listing
V--------- 0/0            1536 2006-05-09 01:07 abc/not-a-file.gif--Volume Header--
-rw-r--r-- tom/users         0 2006-04-22 22:52 abc/CCC
Extracted directory
abc
abc/CCC
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "volsize.at:54: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "volsize.at:54:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf \$TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv \$TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf \$TEST_DATA_DIR/abc.tar
find abc|sort
)"
echo volsize.at:54 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf $TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv $TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf $TEST_DATA_DIR/abc.tar
find abc|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Short Listing
abc/not-a-file.gif
abc/CCC
Verbose Listing
V--------- 0/0            1536 2006-05-09 01:07 abc/not-a-file.gif--Volume Header--
-rw-r--r-- tom/users         0 2006-04-22 22:52 abc/CCC
Extracted directory
abc
abc/CCC
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "volsize.at:54: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "volsize.at:54:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf \$TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv \$TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf \$TEST_DATA_DIR/abc.tar
find abc|sort
)"
echo volsize.at:54 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf $TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv $TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf $TEST_DATA_DIR/abc.tar
find abc|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Short Listing
abc/not-a-file.gif
abc/CCC
Verbose Listing
V--------- 0/0            1536 2006-05-09 01:07 abc/not-a-file.gif--Volume Header--
-rw-r--r-- tom/users         0 2006-04-22 22:52 abc/CCC
Extracted directory
abc
abc/CCC
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "volsize.at:54: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "volsize.at:54:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf \$TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv \$TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf \$TEST_DATA_DIR/abc.tar
find abc|sort
)"
echo volsize.at:54 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf $TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv $TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf $TEST_DATA_DIR/abc.tar
find abc|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Short Listing
abc/not-a-file.gif
abc/CCC
Verbose Listing
V--------- 0/0            1536 2006-05-09 01:07 abc/not-a-file.gif--Volume Header--
-rw-r--r-- tom/users         0 2006-04-22 22:52 abc/CCC
Extracted directory
abc
abc/CCC
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "volsize.at:54: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "volsize.at:54:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf \$TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv \$TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf \$TEST_DATA_DIR/abc.tar
find abc|sort
)"
echo volsize.at:54 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


test -z "`sort < /dev/null 2>&1`" || exit 77


test -z "$TEST_DATA_DIR" && exit 77
tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77

echo Short Listing
tar tf $TEST_DATA_DIR/abc.tar
echo Verbose Listing
tar tfv $TEST_DATA_DIR/abc.tar
echo Extracted directory
tar xf $TEST_DATA_DIR/abc.tar
find abc|sort
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "Short Listing
abc/not-a-file.gif
abc/CCC
Verbose Listing
V--------- 0/0            1536 2006-05-09 01:07 abc/not-a-file.gif--Volume Header--
-rw-r--r-- tom/users         0 2006-04-22 22:52 abc/CCC
Extracted directory
abc
abc/CCC
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "volsize.at:54: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  54 ) # 54. comprec.at:21: compressed format recognition
    at_setup_line='comprec.at:21'
    at_desc='compressed format recognition'
    $at_quiet $ECHO_N " 54: compressed format recognition                $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "54. comprec.at:21: testing ..."
      $at_traceon






  $at_traceoff
echo "comprec.at:39:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo \"separator\"
tar cfz archive file1
echo \"separator\"
mv file1 orig
tar xfv archive
cmp orig file1
)"
echo comprec.at:39 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo "separator"
tar cfz archive file1
echo "separator"
mv file1 orig
tar xfv archive
cmp orig file1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "comprec.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "comprec.at:39:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo \"separator\"
tar cfz archive file1
echo \"separator\"
mv file1 orig
tar xfv archive
cmp orig file1
)"
echo comprec.at:39 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo "separator"
tar cfz archive file1
echo "separator"
mv file1 orig
tar xfv archive
cmp orig file1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "comprec.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "comprec.at:39:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo \"separator\"
tar cfz archive file1
echo \"separator\"
mv file1 orig
tar xfv archive
cmp orig file1
)"
echo comprec.at:39 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo "separator"
tar cfz archive file1
echo "separator"
mv file1 orig
tar xfv archive
cmp orig file1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "comprec.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "comprec.at:39:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo \"separator\"
tar cfz archive file1
echo \"separator\"
mv file1 orig
tar xfv archive
cmp orig file1
)"
echo comprec.at:39 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo "separator"
tar cfz archive file1
echo "separator"
mv file1 orig
tar xfv archive
cmp orig file1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "comprec.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "comprec.at:39:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo \"separator\"
tar cfz archive file1
echo \"separator\"
mv file1 orig
tar xfv archive
cmp orig file1
)"
echo comprec.at:39 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *


cat /dev/null | gzip - > /dev/null 2>&1 || exit 77

genfile --length 10240 --file file1
echo "separator"
tar cfz archive file1
echo "separator"
mv file1 orig
tar xfv archive
cmp orig file1
) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "separator
separator
file1
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "comprec.at:39: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  55 ) # 55. truncate.at:28: truncate
    at_setup_line='truncate.at:28'
    at_desc='truncate'
    $at_quiet $ECHO_N " 55: truncate                                     $ECHO_C"
    at_xfail=no
      test -f $XFAILFILE && at_xfail=yes
    (
      echo "55. truncate.at:28: testing ..."
      $at_traceon





  $at_traceoff
echo "truncate.at:49:
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H v7\"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar)"
echo truncate.at:49 >$at_check_line_file
( $at_traceon;
mkdir v7
(cd v7
TEST_TAR_FORMAT=v7
export TEST_TAR_FORMAT
TAR_OPTIONS="-H v7"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo: File shrank by 5120 bytes; padding with zeros
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "foo
baz
separator
foo
foo: Mod time differs
baz
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   1) ;;
   *) echo "truncate.at:49: exit code was $at_status, expected 1"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "truncate.at:49:
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H oldgnu\"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar)"
echo truncate.at:49 >$at_check_line_file
( $at_traceon;
mkdir oldgnu
(cd oldgnu
TEST_TAR_FORMAT=oldgnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H oldgnu"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo: File shrank by 5120 bytes; padding with zeros
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "foo
baz
separator
foo
foo: Mod time differs
baz
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   1) ;;
   *) echo "truncate.at:49: exit code was $at_status, expected 1"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "truncate.at:49:
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H ustar\"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar)"
echo truncate.at:49 >$at_check_line_file
( $at_traceon;
mkdir ustar
(cd ustar
TEST_TAR_FORMAT=ustar
export TEST_TAR_FORMAT
TAR_OPTIONS="-H ustar"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo: File shrank by 5120 bytes; padding with zeros
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "foo
baz
separator
foo
foo: Mod time differs
baz
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   1) ;;
   *) echo "truncate.at:49: exit code was $at_status, expected 1"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "truncate.at:49:
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H posix\"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar)"
echo truncate.at:49 >$at_check_line_file
( $at_traceon;
mkdir posix
(cd posix
TEST_TAR_FORMAT=posix
export TEST_TAR_FORMAT
TAR_OPTIONS="-H posix"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo: File shrank by 5120 bytes; padding with zeros
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "foo
baz
separator
foo
foo: Mod time differs
baz
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   1) ;;
   *) echo "truncate.at:49: exit code was $at_status, expected 1"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon
$at_traceoff
echo "truncate.at:49:
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS=\"-H gnu\"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar)"
echo truncate.at:49 >$at_check_line_file
( $at_traceon;
mkdir gnu
(cd gnu
TEST_TAR_FORMAT=gnu
export TEST_TAR_FORMAT
TAR_OPTIONS="-H gnu"
export TAR_OPTIONS
rm -rf *

genfile --file foo --length 50000k
genfile --file baz
genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo
echo separator
sleep 1
dd if=/dev/zero of=foo bs=1k seek=49995 count=5 >/dev/null 2>&1
tar dvf bar) ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo >>$at_stderr; echo "tar: foo: File shrank by 5120 bytes; padding with zeros
tar: Error exit delayed from previous errors
" | $at_diff - $at_stderr || at_failed=:
echo >>$at_stdout; echo "foo
baz
separator
foo
foo: Mod time differs
baz
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   1) ;;
   *) echo "truncate.at:49: exit code was $at_status, expected 1"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  56 ) # 56. gtarfail.at:21: gtarfail
    at_setup_line='gtarfail.at:21'
    at_desc='gtarfail'
    $at_quiet $ECHO_N " 56: gtarfail                                     $ECHO_C"
    at_xfail=no
    (
      echo "56. gtarfail.at:21: testing ..."
      $at_traceon



unset TAR_OPTIONS

$at_traceoff
echo "gtarfail.at:38:

test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvf \$STAR_TESTSCRIPTS/gtarfail.tar
"
echo gtarfail.at:38 >$at_check_line_file
( $at_traceon;

test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "-rw-r--r-- jes/glone       518 2001-05-25 14:41 vedpowered.gif
-rw-r--r-- jes/glone      6825 1997-04-29 00:19 cd.gif
-rw-r--r-- jes/glone     33354 1999-06-22 12:17 DSCN0049c.JPG
-rw-r--r-- jes/glone     86159 2001-06-05 18:16 Window1.jpg
-rw-r--r-- jes/glone      1310 2001-05-25 13:05 vipower.gif
-rw-rw-rw- jes/glone    148753 1998-09-15 13:08 billyboy.jpg
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "gtarfail.at:38: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  57 ) # 57. gtarfail2.at:21: gtarfail2
    at_setup_line='gtarfail2.at:21'
    at_desc='gtarfail2'
    $at_quiet $ECHO_N " 57: gtarfail2                                    $ECHO_C"
    at_xfail=no
    (
      echo "57. gtarfail2.at:21: testing ..."
      $at_traceon



unset TAR_OPTIONS

$at_traceoff
echo "gtarfail2.at:41:

test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77

tar --utc -tvf \$STAR_TESTSCRIPTS/gtarfail2.tar
"
echo gtarfail2.at:41 >$at_check_line_file
( $at_traceon;

test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77

tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "-rwxr-xr-x jes/glone       214 2001-09-21 14:08 .clean
lrwxrwxrwx jes/cats          0 1998-05-07 12:39 RULES -> makefiles/RULES
drwxr-sr-x jes/glone         0 2001-12-10 00:00 build/
-rw-r--r-- jes/glone    312019 2001-12-10 00:00 build/smake-1.2.tar.gz
drwxr-sr-x jes/glone         0 2001-11-09 18:20 build/psmake/
-rwxr-xr-x jes/glone       259 2000-01-09 16:36 build/psmake/MAKE
-rwxr-xr-x jes/glone      4820 2001-02-25 22:45 build/psmake/MAKE.sh
-rw-r--r-- jes/glone       647 2001-02-25 23:50 build/psmake/Makefile
lrwxrwxrwx jes/glone         0 2001-08-29 10:53 build/psmake/archconf.c -> ../archconf.c
lrwxrwxrwx jes/glone         0 2001-08-29 10:54 build/psmake/astoi.c -> ../../lib/astoi.c
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "gtarfail2.at:41: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  58 ) # 58. multi-fail.at:21: multi-fail
    at_setup_line='multi-fail.at:21'
    at_desc='multi-fail'
    $at_quiet $ECHO_N " 58: multi-fail                                   $ECHO_C"
    at_xfail=no
    (
      echo "58. multi-fail.at:21: testing ..."
      $at_traceon



unset TAR_OPTIONS

$at_traceoff
echo "multi-fail.at:86:

test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvM -f \$STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \\
               -f \$STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&-
"
echo multi-fail.at:86 >$at_check_line_file
( $at_traceon;

test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \
               -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&-
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
$at_diff $at_devnull $at_stderr || at_failed=:
echo >>$at_stdout; echo "drwxrwsr-x joerg/bs          0 2003-10-11 14:32 OBJ/i386-sunos5-gcc/
-rw-r--r-- joerg/bs          1 2003-10-11 14:32 OBJ/i386-sunos5-gcc/Dnull
-rw-r--r-- joerg/bs       1743 2003-10-10 18:06 OBJ/i386-sunos5-gcc/star.d
-rw-r--r-- joerg/bs       1460 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.d
-rw-r--r-- joerg/bs       1540 2003-10-10 18:06 OBJ/i386-sunos5-gcc/cpiohdr.d
-rw-r--r-- joerg/bs       2245 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xheader.d
-rw-r--r-- joerg/bs       1254 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xattr.d
-rw-r--r-- joerg/bs       1330 2003-10-10 18:06 OBJ/i386-sunos5-gcc/list.d
-rw-r--r-- joerg/bs       1745 2003-10-10 18:06 OBJ/i386-sunos5-gcc/extract.d
-rw-r--r-- joerg/bs       1518 2003-10-10 18:06 OBJ/i386-sunos5-gcc/create.d
-rw-r--r-- joerg/bs       1235 2003-10-10 18:06 OBJ/i386-sunos5-gcc/append.d
-rw-r--r-- joerg/bs       1368 2003-10-10 18:06 OBJ/i386-sunos5-gcc/diff.d
-rw-r--r-- joerg/bs       1423 2003-10-10 18:06 OBJ/i386-sunos5-gcc/remove.d
-rw-r--r-- joerg/bs       1493 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.d
-rw-r--r-- joerg/bs       1572 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.d
-rw-r--r-- joerg/bs       1453 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.d
-rw-r--r-- joerg/bs       2257 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.d
-rw-r--r-- joerg/bs        969 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.d
-rw-r--r-- joerg/bs       1308 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.d
-rw-r--r-- joerg/bs       1287 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.d
-rw-r--r-- joerg/bs       1105 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.d
-rw-r--r-- joerg/bs       1230 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.d
-rw-r--r-- joerg/bs       1091 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.d
-rw-r--r-- joerg/bs        961 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.d
-rw-r--r-- joerg/bs       1113 2003-10-10 18:07 OBJ/i386-sunos5-gcc/props.d
-rw-r--r-- joerg/bs       2146 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fetchdir.d
-rw-r--r-- joerg/bs       1093 2003-10-10 18:07 OBJ/i386-sunos5-gcc/unicode.d
-rw-r--r-- joerg/bs       1211 2003-10-10 18:07 OBJ/i386-sunos5-gcc/subst.d
-rw-r--r-- joerg/bs       2076 2003-10-11 11:53 OBJ/i386-sunos5-gcc/volhdr.d
-rw-r--r-- joerg/bs       1480 2003-10-10 18:07 OBJ/i386-sunos5-gcc/chdir.d
-rw-r--r-- joerg/bs      42460 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star.o
-rw-r--r-- joerg/bs      22564 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.o
-rw-r--r-- joerg/bs       7880 2003-10-10 18:07 OBJ/i386-sunos5-gcc/cpiohdr.o
-rw-r--r-- joerg/bs      14624 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xheader.o
-rw-r--r-- joerg/bs        924 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xattr.o
-rw-r--r-- joerg/bs       6120 2003-10-10 18:07 OBJ/i386-sunos5-gcc/list.o
-rw-r--r-- joerg/bs      12764 2003-10-10 18:07 OBJ/i386-sunos5-gcc/extract.o
-rw-r--r-- joerg/bs      14668 2003-10-10 18:07 OBJ/i386-sunos5-gcc/create.o
-rw-r--r-- joerg/bs       2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/append.o
-rw-r--r-- joerg/bs       7636 2003-10-10 18:07 OBJ/i386-sunos5-gcc/diff.o
-rw-r--r-- joerg/bs       3072 2003-10-10 18:07 OBJ/i386-sunos5-gcc/remove.o
-rw-r--r-- joerg/bs       5612 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.o
-rw-r--r-- joerg/bs       6220 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.o
-rw-r--r-- joerg/bs       1092 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.o
-rw-r--r-- joerg/bs      20996 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.o
-rw-r--r-- joerg/bs       2060 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.o
-rw-r--r-- joerg/bs       1664 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.o
-rw-r--r-- joerg/bs      10564 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.o
-rw-r--r-- joerg/bs       3864 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.o
-rw-r--r-- joerg/bs       2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.o
-rw-r--r-- joerg/bs        952 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.o
-rw-r--r-- joerg/bs       2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "multi-fail.at:86: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  59 ) # 59. ustar-big-2g.at:21: ustar-big-2g
    at_setup_line='ustar-big-2g.at:21'
    at_desc='ustar-big-2g'
    $at_quiet $ECHO_N " 59: ustar-big-2g                                 $ECHO_C"
    at_xfail=no
    (
      echo "59. ustar-big-2g.at:21: testing ..."
      $at_traceon



unset TAR_OPTIONS

$at_traceoff
echo "ustar-big-2g.at:36:

cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvjf \$STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2
"
echo ustar-big-2g.at:36 >$at_check_line_file
( $at_traceon;

cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo stderr:; tee stderr <$at_stderr
echo >>$at_stdout; echo "-rw------- jes/glone 2147483647 2002-06-15 14:53 big
-rw-r--r-- jes/glone          0 2002-06-15 14:53 file
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "ustar-big-2g.at:36: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



cat >stderr.re <<'_ATEOF'
tar: Record size = .*
_ATEOF

awk '{print NR " " $0}' stderr > $$.1
awk '{print NR " " $0}' stderr.re | join - $$.1 |
while read NUM RE LINE
do
  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
done


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  60 ) # 60. ustar-big-8g.at:21: ustar-big-8g
    at_setup_line='ustar-big-8g.at:21'
    at_desc='ustar-big-8g'
    $at_quiet $ECHO_N " 60: ustar-big-8g                                 $ECHO_C"
    at_xfail=no
    (
      echo "60. ustar-big-8g.at:21: testing ..."
      $at_traceon



unset TAR_OPTIONS

$at_traceoff
echo "ustar-big-8g.at:36:

cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvjf \$STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2
"
echo ustar-big-8g.at:36 >$at_check_line_file
( $at_traceon;

cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo stderr:; tee stderr <$at_stderr
echo >>$at_stdout; echo "-rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1
-rw-r--r-- jes/glone          0 2002-06-15 14:53 file
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "ustar-big-8g.at:36: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



cat >stderr.re <<'_ATEOF'
tar: Record size = .*
_ATEOF

awk '{print NR " " $0}' stderr > $$.1
awk '{print NR " " $0}' stderr.re | join - $$.1 |
while read NUM RE LINE
do
  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
done


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;

  61 ) # 61. pax-big-10g.at:21: pax-big-10g
    at_setup_line='pax-big-10g.at:21'
    at_desc='pax-big-10g'
    $at_quiet $ECHO_N " 61: pax-big-10g                                  $ECHO_C"
    at_xfail=no
    (
      echo "61. pax-big-10g.at:21: testing ..."
      $at_traceon



unset TAR_OPTIONS

$at_traceoff
echo "pax-big-10g.at:36:

cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvjf \$STAR_TESTSCRIPTS/pax-big-10g.tar.bz2
"
echo pax-big-10g.at:36 >$at_check_line_file
( $at_traceon;

cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77


test -z "$STAR_TESTSCRIPTS" && exit 77
tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77


tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2
 ) >$at_stdout 2>$at_stder1
at_status=$?
grep '^ *+' $at_stder1 >&2
grep -v '^ *+' $at_stder1 >$at_stderr
at_failed=false
echo stderr:; tee stderr <$at_stderr
echo >>$at_stdout; echo "-rw------- jes/glone 10737418240 2002-06-15 21:18 10g
-rw-r--r-- jes/glone           0 2002-06-15 14:53 file
" | $at_diff - $at_stdout || at_failed=:
case $at_status in
   77) echo 77 > $at_status_file
            exit 77;;
   0) ;;
   *) echo "pax-big-10g.at:36: exit code was $at_status, expected 0"
      at_failed=:;;
esac
if $at_failed; then

  echo 1 > $at_status_file
  exit 1
fi

$at_traceon



cat >stderr.re <<'_ATEOF'
tar: Record size = .*
_ATEOF

awk '{print NR " " $0}' stderr > $$.1
awk '{print NR " " $0}' stderr.re | join - $$.1 |
while read NUM RE LINE
do
  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
done


      $at_traceoff
      $at_times_p && times >$at_times_file
    ) 5>&1 2>&1 | eval $at_tee_pipe
    at_status=`cat $at_status_file`
    ;;


  * )
    echo "$as_me: no such test group: $at_group" >&2
    continue
    ;;
  esac

  # Be sure to come back to the suite directory, in particular
  # since below we might `rm' the group directory we are in currently.
  cd $at_suite_dir

  case $at_group in
    banner-*) ;;
    *)
      if test ! -f $at_check_line_file; then
	sed "s/^ */$as_me: warning: /" <<_ATEOF
	A failure happened in a test group before any test could be
	run. This means that test suite is improperly designed.  Please
	report this failure to <bug-tar@gnu.org>.
_ATEOF
    	echo "$at_setup_line" >$at_check_line_file
      fi
      at_group_count=`expr 1 + $at_group_count`
      $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C"
      echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> $at_group_log
      case $at_xfail:$at_status in
	yes:0)
	    at_msg="UNEXPECTED PASS"
	    at_xpass_list="$at_xpass_list $at_group"
	    at_errexit=$at_errexit_p
	    ;;
	no:0)
	    at_msg="ok"
	    at_pass_list="$at_pass_list $at_group"
	    at_errexit=false
	    ;;
	*:77)
	    at_msg="skipped (`cat $at_check_line_file`)"
	    at_skip_list="$at_skip_list $at_group"
	    at_errexit=false
	    ;;
	yes:*)
	    at_msg="expected failure (`cat $at_check_line_file`)"
	    at_xfail_list="$at_xfail_list $at_group"
	    at_errexit=false
	    ;;
	no:*)
	    at_msg="FAILED (`cat $at_check_line_file`)"
	    at_fail_list="$at_fail_list $at_group"
	    at_errexit=$at_errexit_p
	    ;;
      esac
      echo $at_msg
      at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
      case $at_status in
	0|77)
	  # $at_times_file is only available if the group succeeded.
	  # We're not including the group log, so the success message
	  # is written in the global log separately.  But we also
	  # write to the group log in case they're using -d.
	  if test -f $at_times_file; then
	    at_log_msg="$at_log_msg	(`sed 1d $at_times_file`)"
	    rm -f $at_times_file
          fi
	  echo "$at_log_msg" >> $at_group_log
	  echo "$at_log_msg" >&5

	  # Cleanup the group directory, unless the user wants the files.
	  $at_debug_p || rm -rf $at_group_dir
	  ;;
	*)
	  # Upon failure, include the log into the testsuite's global
	  # log.  The failure message is written in the group log.  It
	  # is later included in the global log.
	  echo "$at_log_msg" >> $at_group_log

	  # Upon failure, keep the group directory for autopsy, and
	  # create the debugging script.
	  {
	    echo "#! /bin/sh"
	    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\'''
	    echo "cd $at_dir"
	    echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \
	         '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}'
	    echo 'exit 1'
	  } >$at_group_dir/run
	  chmod +x $at_group_dir/run
	  $at_errexit && break
	  ;;
      esac
      ;;
  esac
done

# Back to the top directory.
cd $at_dir

# Compute the duration of the suite.
at_stop_date=`date`
at_stop_time=`(date +%s) 2>/dev/null`
echo "$as_me: ending at: $at_stop_date" >&5
at_duration_s=`(expr $at_stop_time - $at_start_time) 2>/dev/null`
at_duration_m=`(expr $at_duration_s / 60) 2>/dev/null`
at_duration_h=`(expr $at_duration_m / 60) 2>/dev/null`
at_duration_s=`(expr $at_duration_s % 60) 2>/dev/null`
at_duration_m=`(expr $at_duration_m % 60) 2>/dev/null`
at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
if test "$at_duration" != "h m s"; then
  echo "$as_me: test suite duration: $at_duration" >&5
fi

# Wrap up the test suite with summary statistics.
at_skip_count=`set dummy $at_skip_list; shift; echo $#`
at_fail_count=`set dummy $at_fail_list; shift; echo $#`
at_xpass_count=`set dummy $at_xpass_list; shift; echo $#`
at_xfail_count=`set dummy $at_xfail_list; shift; echo $#`

at_run_count=`expr $at_group_count - $at_skip_count`
at_unexpected_count=`expr $at_xpass_count + $at_fail_count`
at_total_fail_count=`expr $at_xfail_count + $at_fail_count`

echo
cat <<\_ASBOX
## ------------- ##
## Test results. ##
## ------------- ##
_ASBOX
echo
{
  echo
  cat <<\_ASBOX
## ------------- ##
## Test results. ##
## ------------- ##
_ASBOX
  echo
} >&5

if test $at_run_count = 1; then
  at_result="1 test"
  at_were=was
else
  at_result="$at_run_count tests"
  at_were=were
fi
if $at_errexit_p && test $at_unexpected_count != 0; then
  if test $at_xpass_count = 1; then
    at_result="$at_result $at_were run, one passed"
  else
    at_result="$at_result $at_were run, one failed"
  fi
  at_result="$at_result unexpectedly and inhibited subsequent tests."
else
  # Don't you just love exponential explosion of the number of cases?
  case $at_xpass_count:$at_fail_count:$at_xfail_count in
    # So far, so good.
    0:0:0) at_result="$at_result $at_were successful." ;;
    0:0:*) at_result="$at_result behaved as expected." ;;

    # Some unexpected failures
    0:*:0) at_result="$at_result $at_were run,
$at_fail_count failed unexpectedly." ;;

    # Some failures, both expected and unexpected
    0:*:1) at_result="$at_result $at_were run,
$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
    0:*:*) at_result="$at_result $at_were run,
$at_total_fail_count failed ($at_xfail_count expected failures)." ;;

    # No unexpected failures, but some xpasses
    *:0:*) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly." ;;

    # No expected failures, but failures and xpasses
    *:1:0) at_result="$at_result $at_were run,
$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
    *:*:0) at_result="$at_result $at_were run,
$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;

    # All of them.
    *:*:1) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly,
$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
    *:*:*) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly,
$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
  esac

  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
    at_result="All $at_result"
  fi
fi

# Now put skips in the mix.
case $at_skip_count in
  0) ;;
  1) at_result="$at_result
1 test was skipped." ;;
  *) at_result="$at_result
$at_skip_count tests were skipped." ;;
esac

if test $at_unexpected_count = 0; then
  echo "$at_result"
  echo "$at_result" >&5
else
  echo "ERROR: $at_result" >&2
  echo "ERROR: $at_result" >&5
  {
    echo
    cat <<\_ASBOX
## ------------------------ ##
## Summary of the failures. ##
## ------------------------ ##
_ASBOX

    # Summary of failed and skipped tests.
    if test $at_fail_count != 0; then
      echo "Failed tests:"
      $SHELL $0 $at_fail_list --list
      echo
    fi
    if test $at_skip_count != 0; then
      echo "Skipped tests:"
      $SHELL $0 $at_skip_list --list
      echo
    fi
    if test $at_xpass_count != 0; then
      echo "Unexpected passes:"
      $SHELL $0 $at_xpass_list --list
      echo
    fi
    if test $at_fail_count != 0; then
      cat <<\_ASBOX
## ---------------------- ##
## Detailed failed tests. ##
## ---------------------- ##
_ASBOX
      echo
      for at_group in $at_fail_list
      do
        # Normalize the test group number.
        at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"`
        # Create a fresh directory for the next test group, and enter.
        at_group_dir=$at_suite_dir/$at_group_normalized
        at_group_log=$at_group_dir/$as_me.log
        cat $at_group_log
        echo
      done
      echo
    fi
    if test -n "$at_top_srcdir"; then
      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## $at_top_builddir/config.log ##
_ASBOX
      sed 's/^/| /' $at_top_builddir/config.log
      echo
    fi
  } >&5

  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## $as_me.log was created. ##
_ASBOX

  echo
  echo "Please send \`$as_me.log' and all information you think might help:"
  echo
  echo "   To: <bug-tar@gnu.org>"
  echo "   Subject: [GNU tar 1.15.91] $as_me:$at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}$at_xpass_list${at_xpass_list:+ passed unexpectedly}"
  echo
  if test $at_debug_p = false; then
    echo
    echo 'You may investigate any problem if you feel able to do so, in which'
    echo 'case the test suite provides a good starting point.'
    echo
  fi
    exit 1
fi

exit 0


