#!/bin/sh
# Validation suite for Free `pax' utilities.		-*- shell-script -*-
# Copyright  1998, 1999 Progiciels Bourbeau-Pinard inc.
# Franois Pinard <pinard@iro.umontreal.ca>, 1998.

# Check version with `tar' for the time being, as `pax' is not always built.
# When `pax' will be declared stable, use `pax' instead here.  FIXME!

. ./atconfig
# Snippet (3

at_usage="Usage: $0 OPTION...

  -e  Stop and inhibit normal clean up if a test of the full test suite fails
  -n  Do not redirect stdout and stderr and do not test their contents
  -s  Inhibit verbosity in debugging scripts, at generation or at execution
  -v  Force more detailed output, default for debugging scripts unless -s
  -x  Have the shell to trace command execution; implies options -n"

while test $# -gt 0; do
  case "$1" in
    --help) echo "$at_usage"; exit 0 ;;
    --version) echo "$0 ($at_package) $at_version"; exit 0 ;;
    -e) at_stop_on_error=1; shift ;;
    -n) at_no_redirs=1; shift ;;
    -s) at_verbose=; at_silent=1; shift ;;
    -v) at_verbose=1; at_silent=; shift ;;
    -x) at_tracex=1; at_no_redirs=1; shift ;;
    *) echo 1>&2 "Try \`$0 --help' for more information."; exit 1 ;;
  esac
done

# In the testing suite, we only want to know if the test succeeded or failed.
# But in debugging scripts, we want more information, so we prefer `diff -u'
# to the silent `cmp', even if it may happen that we compare binary files.
# Option `-u' might be less portable, so either change it or use GNU `diff'.

if test -n "$at_verbose"; then
  at_diff='diff -u'
else
  at_diff='cmp -s'
fi

# Each generated debugging script, containing a single test group, cleans
# up files at the beginning only, not at the end.  This is so we can repeat
# the script many times and browse left over files.  To cope with such left
# over files, the full test suite cleans up both before and after test groups.
# Snippet )3

if test -n "`tar --version | sed -n s/$at_package.*$at_version/OK/p`"; then
  at_banner="Testing suite for $at_package, version $at_version"
  at_dashes=`echo $at_banner | sed s/./=/g`
  echo "$at_dashes"
  echo "$at_banner"
  echo "$at_dashes"
else
  echo '======================================================='
  echo 'ERROR: Not using the proper version, no tests performed'
  echo '======================================================='
  exit 1
fi

# Remove any debugging script resulting from a previous run.
rm -f debug-*.sh

at_failed_list=
at_ignore_count=0

echo
echo 'cpio tests.'
echo

test -n "$check_cpio" || at_skip_mode=1

# We may get many "truncating inode number" diagnostics in case the
# build directory has high-numbered inodes, CPIO_FILTER gets rid of them.
# One might prefer testing on a less used filesystem?  I'm not sure.

rm -rf mix list-mix cpio-def cpio-oldc
cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-def; then
  cat list-mix | cpio -o > cpio-def 2> /dev/null
  cleanup="$cleanup cpio-def"
fi
if test ! -f cpio-oldc; then
  cat list-mix | cpio -oc > cpio-oldc 2> /dev/null
  cleanup="$cleanup cpio-oldc"
fi

cleanup=
rm -rf smix list-smix listf-smix

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c1(

rm -rf $cleanup archive stdout stderr expout
# Snippet )c1)
  echo c-default.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if default cpio creation and listing works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "1. $srcdir/c-default.m4:3     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s1(

# The test group starts at `c-default.m4:3'.  An error occurred while
# testing if default cpio creation and listing works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-default.m4:13: Testing if default cpio creation and listing works'
echo c-default.m4:13 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -o > archive || exit 1
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-default.m4:21: Testing if default cpio creation and listing works'
echo c-default.m4:21 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -t < archive || exit 1
cp list-mix expout
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-default.m4:29: Testing if default cpio creation and listing works'
echo c-default.m4:29 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -tv < archive | sed -e 's/ -> .*//' -e 's/^.* //'
cp list-mix expout
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s1)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 1"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=1
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr expout
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c2(

rm -rf $cleanup unmix stdout stderr
# Snippet )c2)
  echo c-default.m4:33 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if installed cpio can unpack our cpio'
    echo $at_n "     $at_c"
  fi
  echo $at_n "2. $srcdir/c-default.m4:33    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s2(

# The test group starts at `c-default.m4:33'.  An error occurred while
# testing if installed cpio can unpack our cpio.

test -n "$BINCPIO" || exit 77

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-def; then
  cat list-mix | cpio -o > cpio-def 2> /dev/null
  cleanup="$cleanup cpio-def"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-default.m4:50: Testing if installed cpio can unpack our cpio'
echo c-default.m4:50 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  $BINCPIO -id$DEVFLAG < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-default.m4:60: Testing if installed cpio can unpack our cpio'
echo c-default.m4:60 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  $BINCPIO -idum$DEVFLAG < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s2)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 2"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=2
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c3(

rm -rf $cleanup unmix stdout stderr
# Snippet )c3)
  echo c-default.m4:64 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if we can unpack our own archive'
    echo $at_n "     $at_c"
  fi
  echo $at_n "3. $srcdir/c-default.m4:64    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s3(

# The test group starts at `c-default.m4:64'.  An error occurred while
# testing if we can unpack our own archive.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-def; then
  cat list-mix | cpio -o > cpio-def 2> /dev/null
  cleanup="$cleanup cpio-def"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-default.m4:79: Testing if we can unpack our own archive'
echo c-default.m4:79 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -id < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-default.m4:89: Testing if we can unpack our own archive'
echo c-default.m4:89 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s3)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 3"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=3
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

#							-*- shell-script -*-

# Test blocking.  It will not do much good on a pipe, but because it will
# cause all reads and writes to use the same blocksize it will help exercise
# `sparse.c'.

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c4(

rm -rf $cleanup unmix stdout stderr
# Snippet )c4)
  echo c-block.m4:7 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing option -C'
    echo $at_n "     $at_c"
  fi
  echo $at_n "4. $srcdir/c-block.m4:7       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s4(

# The test group starts at `c-block.m4:7'.  An error occurred while
# testing option -C.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-def; then
  cat list-mix | cpio -o > cpio-def 2> /dev/null
  cleanup="$cleanup cpio-def"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-block.m4:21: Testing option -C'
echo c-block.m4:21 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum -C 1 < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-block.m4:31: Testing option -C'
echo c-block.m4:31 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum -C 256 < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-block.m4:41: Testing option -C'
echo c-block.m4:41 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum --block-size=20 < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s4)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 4"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=4
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c5(

rm -rf $cleanup unmix stdout stderr experr
# Snippet )c5)
  echo c-block.m4:45 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing option -B'
    echo $at_n "     $at_c"
  fi
  echo $at_n "5. $srcdir/c-block.m4:45      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s5(

# The test group starts at `c-block.m4:45'.  An error occurred while
# testing option -B.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-def; then
  cat list-mix | cpio -o > cpio-def 2> /dev/null
  cleanup="$cleanup cpio-def"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-block.m4:59: Testing option -B'
echo c-block.m4:59 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idm -B < ../cpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-block.m4:70: Testing option -B'
echo c-block.m4:70 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  # Probably should verify linked message.
  cpio -idumv < ../cpio-def 2>&1 | grep -v 'cpio.*linked to' 1>&2
cd ..
cp list-mix experr
echo 'NN blocks' >> experr
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  $at_diff experr stderr || exit 1
fi

# Snippet )s5)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 5"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=5
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr experr
  fi
fi

#							-*- shell-script -*-
# Inter-operability of old portable cpio formats.

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c6(

rm -rf $cleanup archive stdout stderr
# Snippet )c6)
  echo c-oldc.m4:4 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if installed cpio creation works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "6. $srcdir/c-oldc.m4:4        $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s6(

# The test group starts at `c-oldc.m4:4'.  An error occurred while
# testing if installed cpio creation works.

test -n "$BINCPIO" || exit 77

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:16: Testing if installed cpio creation works'
echo c-oldc.m4:16 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | $BINCPIO -o$DEVFLAG > archive || exit 1
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:23: Testing if installed cpio creation works'
echo c-oldc.m4:23 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | $BINCPIO -o$DEVFLAG $BINOLDC > archive || exit 1
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s6)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 6"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=6
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c7(

rm -rf $cleanup archive stdout stderr expout
# Snippet )c7)
  echo c-oldc.m4:27 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if old portable cpio creation and listing works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "7. $srcdir/c-oldc.m4:27       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s7(

# The test group starts at `c-oldc.m4:27'.  An error occurred while
# testing if old portable cpio creation and listing works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:37: Testing if old portable cpio creation and listing works'
echo c-oldc.m4:37 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -o -c > archive || exit 1
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:45: Testing if old portable cpio creation and listing works'
echo c-oldc.m4:45 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -t -c < archive || exit 1
cp list-mix expout
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:53: Testing if old portable cpio creation and listing works'
echo c-oldc.m4:53 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -t < archive || exit 1
cp list-mix expout
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:61: Testing if old portable cpio creation and listing works'
echo c-oldc.m4:61 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -tv -c < archive | sed -e 's/ -> .*//' -e 's/^.* //'
cp list-mix expout
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s7)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 7"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=7
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr expout
  fi
fi

# Do a bit of optimization.
if test -n "$BINCPIO"; then
  cleanup=
if test ! -f icpio-def; then
  cat list-mix | $BINCPIO -o$DEVFLAG > icpio-def 2> /dev/null
  cleanup="$cleanup icpio-def"
fi
if test ! -f icpio-oldc; then
  cat list-mix | $BINCPIO -o$DEVFLAG $BINOLDC > icpio-oldc 2> /dev/null
  cleanup="$cleanup icpio-oldc"
fi

fi
cleanup=
if test ! -f cpio-oldc; then
  cat list-mix | cpio -oc > cpio-oldc 2> /dev/null
  cleanup="$cleanup cpio-oldc"
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c8(

rm -rf $cleanup unmix stdout stderr
# Snippet )c8)
  echo c-oldc.m4:71 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing interoperability with installed cpio'
    echo $at_n "     $at_c"
  fi
  echo $at_n "8. $srcdir/c-oldc.m4:71       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s8(

# The test group starts at `c-oldc.m4:71'.  An error occurred while
# testing interoperability with installed cpio.

test -n "$BINCPIO" || exit 77

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-oldc; then
  cat list-mix | cpio -oc > cpio-oldc 2> /dev/null
  cleanup="$cleanup cpio-oldc"
fi
if test ! -f icpio-def; then
  cat list-mix | $BINCPIO -o$DEVFLAG > icpio-def 2> /dev/null
  cleanup="$cleanup icpio-def"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:88: Testing interoperability with installed cpio'
echo c-oldc.m4:88 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -id < ../icpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:98: Testing interoperability with installed cpio'
echo c-oldc.m4:98 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum < ../icpio-def || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:109: Testing interoperability with installed cpio'
echo c-oldc.m4:109 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  $BINCPIO -idum$DEVFLAG $BINOLDC < ../cpio-oldc || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:119: Testing interoperability with installed cpio'
echo c-oldc.m4:119 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  $BINCPIO -idum$DEVFLAG $BINOLDC < ../cpio-oldc || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s8)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 8"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=8
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c9(

rm -rf $cleanup unmix stdout stderr
# Snippet )c9)
  echo c-oldc.m4:123 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing interoperability with installed cpio in portable mode'
    echo $at_n "     $at_c"
  fi
  echo $at_n "9. $srcdir/c-oldc.m4:123      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s9(

# The test group starts at `c-oldc.m4:123'.  An error occurred while
# testing interoperability with installed cpio in portable mode.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f icpio-oldc; then
  cat list-mix | $BINCPIO -o$DEVFLAG $BINOLDC > icpio-oldc 2> /dev/null
  cleanup="$cleanup icpio-oldc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:138: Testing interoperability with installed cpio in portable mode'
echo c-oldc.m4:138 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -id -c < ../icpio-oldc || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:148: Testing interoperability with installed cpio in portable mode'
echo c-oldc.m4:148 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum -c < ../icpio-oldc || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s9)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 9"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=9
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c10(

rm -rf $cleanup unmix stdout stderr
# Snippet )c10)
  echo c-oldc.m4:152 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio interoperability with self'
    echo $at_n "     $at_c"
  fi
  echo $at_n "10. $srcdir/c-oldc.m4:152     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s10(

# The test group starts at `c-oldc.m4:152'.  An error occurred while
# testing cpio interoperability with self.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-oldc; then
  cat list-mix | cpio -oc > cpio-oldc 2> /dev/null
  cleanup="$cleanup cpio-oldc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:167: Testing cpio interoperability with self'
echo c-oldc.m4:167 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -id -c < ../cpio-oldc || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-oldc.m4:177: Testing cpio interoperability with self'
echo c-oldc.m4:177 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum -c < ../cpio-oldc || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s10)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 10"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=10
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

# Optimization cleanup.
if test -n "$BINCPIO"; then
  rm -f icpio-def icpio-oldc
fi
rm -f cpio-oldc

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c11(

rm -rf $cleanup unmix stdout stderr experr
# Snippet )c11)
  echo c-pass.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing copy-pass mode'
    echo $at_n "     $at_c"
  fi
  echo $at_n "11. $srcdir/c-pass.m4:3       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s11(

# The test group starts at `c-pass.m4:3'.  An error occurred while
# testing copy-pass mode.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-pass.m4:16: Testing copy-pass mode'
echo c-pass.m4:16 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
find mix -depth -print | cpio -pd unmix || exit 1
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-pass.m4:24: Testing copy-pass mode'
echo c-pass.m4:24 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
find mix -depth -print | cpio -pdum unmix || exit 1
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-pass.m4:33: Testing copy-pass mode'
echo c-pass.m4:33 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
# Probably should verify linked message.
find mix -depth -print | cpio -pdumv unmix 2>&1 | grep -v 'cpio.*linked to' 1>&2
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
cp list-mix experr
echo 'NN blocks' >> experr
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  $at_diff experr stderr || exit 1
fi

# Snippet )s11)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 11"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=11
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr experr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c12(

rm -rf $cleanup unmix stdout stderr
# Snippet )c12)
  echo c-pass.m4:37 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing copy-pass mode through linking'
    echo $at_n "     $at_c"
  fi
  echo $at_n "12. $srcdir/c-pass.m4:37      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s12(

# The test group starts at `c-pass.m4:37'.  An error occurred while
# testing copy-pass mode through linking.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-pass.m4:49: Testing copy-pass mode through linking'
echo c-pass.m4:49 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
find mix -depth -print | cpio -pdl unmix || exit 1
verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match -contents-match -mtime-match -ino-match -ignore-dir-ino -ignore-link-ino -ignore-link-mtime -ignore-dir-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "0 blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s12)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 12"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=12
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c13(

rm -rf $cleanup unmix stdout stderr
# Snippet )c13)
  echo c-reset.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if access time could be reset'
    echo $at_n "     $at_c"
  fi
  echo $at_n "13. $srcdir/c-reset.m4:3      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s13(

# The test group starts at `c-reset.m4:3'.  An error occurred while
# testing if access time could be reset.

# First copy the directory into unmix so we can make sure that
# the -a doesn't do something weird to the mtime (like it has on a
# weird 88k SysV machine that has a non-standard utimbuf mix).

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-oldc; then
  cat list-mix | cpio -oc > cpio-oldc 2> /dev/null
  cleanup="$cleanup cpio-oldc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-reset.m4:21: Testing if access time could be reset'
echo c-reset.m4:21 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idm -c < ../cpio-oldc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-reset.m4:31: Testing if access time could be reset'
echo c-reset.m4:31 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cat list-mix | cpio -oa -c > cpio-oldc
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
verify -list -ignore-dir-atime -atime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-reset.m4:41: Testing if access time could be reset'
echo c-reset.m4:41 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum -c < ../cpio-oldc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s13)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 13"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=13
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c14(

rm -rf $cleanup archive stdout stderr
# Snippet )c14)
  echo c-tar.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if tar creation works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "14. $srcdir/c-tar.m4:3        $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s14(

# The test group starts at `c-tar.m4:3'.  An error occurred while
# testing if tar creation works.

# This is in preparation for later testing if `cpio' can read `tar' files.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:9: Testing if tar creation works'
echo c-tar.m4:9 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar cf archive mix
test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s14)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 14"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=14
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c15(

rm -rf $cleanup archive stdout stderr
# Snippet )c15)
  echo c-tar.m4:13 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if tar format cpio creation works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "15. $srcdir/c-tar.m4:13       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s15(

# The test group starts at `c-tar.m4:13'.  An error occurred while
# testing if tar format cpio creation works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

if test "$FIFOS" = yes; then

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:29: Testing if tar format cpio creation works'
echo c-tar.m4:29 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -oH tar > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: mix/dev/pipe2 not dumped: not a regular file
cpio: mix/pipe not dumped: not a regular file
cpio: mix/copy not dumped: not a regular file
cpio: mix/diff not dumped: not a regular file
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

else

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:38: Testing if tar format cpio creation works'
echo c-tar.m4:38 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -oH tar > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

fi

# Snippet )s15)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 15"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=15
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c16(

rm -rf $cleanup archive stdout stderr
# Snippet )c16)
  echo c-tar.m4:44 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if ustar format cpio creation works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "16. $srcdir/c-tar.m4:44       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s16(

# The test group starts at `c-tar.m4:44'.  An error occurred while
# testing if ustar format cpio creation works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:54: Testing if ustar format cpio creation works'
echo c-tar.m4:54 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -oH ustar > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s16)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 16"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=16
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c17(

rm -rf $cleanup unmix stdout stderr
# Snippet )c17)
  echo c-tar.m4:58 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can unpack installed tar archives'
    echo $at_n "     $at_c"
  fi
  echo $at_n "17. $srcdir/c-tar.m4:58       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s17(

# The test group starts at `c-tar.m4:58'.  An error occurred while
# testing if cpio can unpack installed tar archives.

test -n "$BINTAR" || exit 77

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f itar-def; then
  $BINTAR cf itar-def mix >/dev/null 2>&1
  cleanup="$cleanup itar-def"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:77: Testing if cpio can unpack installed tar archives'
echo c-tar.m4:77 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idH tar < ../itar-def
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s17)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 17"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=17
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c18(

rm -rf $cleanup unmix stdout stderr
# Snippet )c18)
  echo c-tar.m4:81 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can unpack tar archives'
    echo $at_n "     $at_c"
  fi
  echo $at_n "18. $srcdir/c-tar.m4:81       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s18(

# The test group starts at `c-tar.m4:81'.  An error occurred while
# testing if cpio can unpack tar archives.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f tar-def; then
  tar cf tar-def mix >/dev/null 2>&1
  cleanup="$cleanup tar-def"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:96: Testing if cpio can unpack tar archives'
echo c-tar.m4:96 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idH ustar < ../tar-def
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s18)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 18"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=18
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c19(

rm -rf $cleanup unmix stdout stderr
# Snippet )c19)
  echo c-tar.m4:100 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can unpack tar format'
    echo $at_n "     $at_c"
  fi
  echo $at_n "19. $srcdir/c-tar.m4:100      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s19(

# The test group starts at `c-tar.m4:100'.  An error occurred while
# testing if cpio can unpack tar format.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-tar; then
  cat list-mix | cpio -oH tar > cpio-tar 2> /dev/null
  cleanup="$cleanup cpio-tar"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:116: Testing if cpio can unpack tar format'
echo c-tar.m4:116 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-tar; then
  cat list-mix | cpio -oH tar > cpio-tar 2> /dev/null
  cleanup="$cleanup cpio-tar"
fi

TIME=`echotime`
cd unmix
  cpio -idH tar < ../cpio-tar
cd ..
cat list-mix \
| fgrep -v -x -f mix/extra1 \
| verify -list -match-dir unmix -mode-match -uid-match -gid-match \
    -size-match -contents-match -mtime-le $TIME \
| fgrep -v -x -f mix/extra2
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:127: Testing if cpio can unpack tar format'
echo c-tar.m4:127 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idu < ../cpio-tar
cd ..
cat list-mix \
| fgrep -v -x -f mix/extra1 \
| verify -list -match-dir unmix -mode-match -uid-match -gid-match \
    -size-match -contents-match -mtime-le $TIME \
| fgrep -v -x -f mix/extra2
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s19)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 19"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=19
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c20(

rm -rf $cleanup unmix stdout stderr
# Snippet )c20)
  echo c-tar.m4:131 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can unpack ustar format'
    echo $at_n "     $at_c"
  fi
  echo $at_n "20. $srcdir/c-tar.m4:131      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s20(

# The test group starts at `c-tar.m4:131'.  An error occurred while
# testing if cpio can unpack ustar format.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-ustar; then
  cat list-mix | cpio -oH ustar > cpio-ustar 2> /dev/null
  cleanup="$cleanup cpio-ustar"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:146: Testing if cpio can unpack ustar format'
echo c-tar.m4:146 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idH ustar < ../cpio-ustar
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-tar.m4:157: Testing if cpio can unpack ustar format'
echo c-tar.m4:157 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idu < ../cpio-ustar
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s20)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 20"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=20
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

#							-*- shell-script -*-
# New portable cpio format.

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c21(

rm -rf $cleanup archive stdout stderr expout
# Snippet )c21)
  echo c-newc.m4:4 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if new portable cpio creation and listing works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "21. $srcdir/c-newc.m4:4       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s21(

# The test group starts at `c-newc.m4:4'.  An error occurred while
# testing if new portable cpio creation and listing works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

sed -e '/^\.\/..*$/s/^\.\///' list-mix | sort > expout

test -n "$at_verbose" \
  && echo $srcdir'/c-newc.m4:15: Testing if new portable cpio creation and listing works'
echo c-newc.m4:15 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -o -H newc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-newc.m4:22: Testing if new portable cpio creation and listing works'
echo c-newc.m4:22 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -t -H newc < archive | sort
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-newc.m4:29: Testing if new portable cpio creation and listing works'
echo c-newc.m4:29 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -tv -H newc < archive | sed -e 's,^.* \(mix[a-z0-9/]*\).*,\1,' | sort
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-newc.m4:36: Testing if new portable cpio creation and listing works'
echo c-newc.m4:36 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -tv < archive | sed -e 's,^.* \(mix[a-z0-9/]*\).*,\1,' | sort
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s21)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 21"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=21
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr expout
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c22(

rm -rf $cleanup unmix stdout stderr
# Snippet )c22)
  echo c-newc.m4:40 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if new portable cpio extraction works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "22. $srcdir/c-newc.m4:40      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s22(

# The test group starts at `c-newc.m4:40'.  An error occurred while
# testing if new portable cpio extraction works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-newc; then
  cat list-mix | cpio -oH newc > cpio-newc 2> /dev/null
  cleanup="$cleanup cpio-newc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-newc.m4:55: Testing if new portable cpio extraction works'
echo c-newc.m4:55 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -id -H newc < ../cpio-newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-newc.m4:65: Testing if new portable cpio extraction works'
echo c-newc.m4:65 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum -H newc < ../cpio-newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s22)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 22"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=22
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

#							-*- shell-script -*-
# CRC cpio format.

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c23(

rm -rf $cleanup archive stdout stderr expout
# Snippet )c23)
  echo c-crc.m4:4 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if CRC cpio creation and listing works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "23. $srcdir/c-crc.m4:4        $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s23(

# The test group starts at `c-crc.m4:4'.  An error occurred while
# testing if CRC cpio creation and listing works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

sed -e '/^\.\/..*$/s/^\.\///' list-mix | sort > expout

test -n "$at_verbose" \
  && echo $srcdir'/c-crc.m4:15: Testing if CRC cpio creation and listing works'
echo c-crc.m4:15 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -oH crc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-crc.m4:22: Testing if CRC cpio creation and listing works'
echo c-crc.m4:22 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -tH crc < archive | sort
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-crc.m4:29: Testing if CRC cpio creation and listing works'
echo c-crc.m4:29 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -tvH crc < archive | sed -e 's,^.* \(mix[a-z0-9/]*\).*,\1,' | sort
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  $at_diff expout stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s23)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 23"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=23
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr expout
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c24(

rm -rf $cleanup unmix stdout stderr
# Snippet )c24)
  echo c-crc.m4:33 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if CRC cpio extraction works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "24. $srcdir/c-crc.m4:33       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s24(

# The test group starts at `c-crc.m4:33'.  An error occurred while
# testing if CRC cpio extraction works.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-crc; then
  cat list-mix | cpio -oH crc > cpio-crc 2> /dev/null
  cleanup="$cleanup cpio-crc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-crc.m4:48: Testing if CRC cpio extraction works'
echo c-crc.m4:48 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idH crc < ../cpio-crc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-crc.m4:58: Testing if CRC cpio extraction works'
echo c-crc.m4:58 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumH crc < ../cpio-crc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-crc.m4:68: Testing if CRC cpio extraction works'
echo c-crc.m4:68 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum < ../cpio-crc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s24)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 24"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=24
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

#							-*- shell-script -*-
# Options -I, -O and -F.

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c25(

rm -rf $cleanup unmix stdout stderr
# Snippet )c25)
  echo c-nopipe.m4:4 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can read without pipe'
    echo $at_n "     $at_c"
  fi
  echo $at_n "25. $srcdir/c-nopipe.m4:4     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s25(

# The test group starts at `c-nopipe.m4:4'.  An error occurred while
# testing if cpio can read without pipe.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-newc; then
  cat list-mix | cpio -oH newc > cpio-newc 2> /dev/null
  cleanup="$cleanup cpio-newc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:18: Testing if cpio can read without pipe'
echo c-nopipe.m4:18 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idmI ../cpio-newc -H newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:28: Testing if cpio can read without pipe'
echo c-nopipe.m4:28 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumF ../cpio-newc -H newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s25)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 25"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=25
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c26(

rm -rf $cleanup archive unmix stdout stderr
# Snippet )c26)
  echo c-nopipe.m4:32 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can write without pipe using -O'
    echo $at_n "     $at_c"
  fi
  echo $at_n "26. $srcdir/c-nopipe.m4:32    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s26(

# The test group starts at `c-nopipe.m4:32'.  An error occurred while
# testing if cpio can write without pipe using -O.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:43: Testing if cpio can write without pipe using -O'
echo c-nopipe.m4:43 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -oO archive -H newc
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:53: Testing if cpio can write without pipe using -O'
echo c-nopipe.m4:53 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idm -H newc < ../archive
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:63: Testing if cpio can write without pipe using -O'
echo c-nopipe.m4:63 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumI ../archive -H newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s26)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 26"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=26
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c27(

rm -rf $cleanup archive unmix stdout stderr
# Snippet )c27)
  echo c-nopipe.m4:67 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can write without pipe using -F'
    echo $at_n "     $at_c"
  fi
  echo $at_n "27. $srcdir/c-nopipe.m4:67    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s27(

# The test group starts at `c-nopipe.m4:67'.  An error occurred while
# testing if cpio can write without pipe using -F.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:78: Testing if cpio can write without pipe using -F'
echo c-nopipe.m4:78 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mix | cpio -oF archive -H newc
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:88: Testing if cpio can write without pipe using -F'
echo c-nopipe.m4:88 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idmF ../archive -H newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-nopipe.m4:98: Testing if cpio can write without pipe using -F'
echo c-nopipe.m4:98 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumI ../archive -H newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s27)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 27"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=27
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix stdout stderr
  fi
fi

# Skipping files while extracting.			-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c28(

rm -rf $cleanup unmix stdout stderr
# Snippet )c28)
  echo c-skip.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio skips files as per non-options'
    echo $at_n "     $at_c"
  fi
  echo $at_n "28. $srcdir/c-skip.m4:3       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s28(

# The test group starts at `c-skip.m4:3'.  An error occurred while
# testing if cpio skips files as per non-options.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-newc; then
  cat list-mix | cpio -oH newc > cpio-newc 2> /dev/null
  cleanup="$cleanup cpio-newc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-skip.m4:20: Testing if cpio skips files as per non-options'
echo c-skip.m4:20 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idm -H newc mix/foo < ../cpio-newc
cd ..
verify -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-match mix/foo
sed -e '/^mix$/d' -e '/^mix\/foo$/d' -e 's,^,unmix/,' list-mix \
| verify -list -non-exist
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

rm -rf unmix
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-skip.m4:37: Testing if cpio skips files as per non-options'
echo c-skip.m4:37 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idm -H newc -f mix/foo < ../cpio-newc
cd ..
sed -e '/mix\/foo/d' list-mix \
| verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
    -contents-match -mtime-match -ignore-dot-mtime \
| sed -e '/^mix\/foo: extra file$/d'
verify -non-exist unmix/mix/foo
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s28)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 28"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=28
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c29(

rm -rf $cleanup pattern unmix stdout stderr
# Snippet )c29)
  echo c-skip.m4:41 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio skips files as per -E file'
    echo $at_n "     $at_c"
  fi
  echo $at_n "29. $srcdir/c-skip.m4:41      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s29(

# The test group starts at `c-skip.m4:41'.  An error occurred while
# testing if cpio skips files as per -E file.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-newc; then
  cat list-mix | cpio -oH newc > cpio-newc 2> /dev/null
  cleanup="$cleanup cpio-newc"
fi

echo mix/foo > pattern
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-skip.m4:59: Testing if cpio skips files as per -E file'
echo c-skip.m4:59 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idmE ../pattern -H newc < ../cpio-newc
cd ..
verify -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-match mix/foo
sed -e '/^mix$/d' -e '/^mix\/foo$/d' -e 's,^,unmix/,' list-mix \
| verify -list -non-exist
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

rm -rf unmix
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-skip.m4:76: Testing if cpio skips files as per -E file'
echo c-skip.m4:76 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idmfE ../pattern -H newc < ../cpio-newc
cd ..
sed -e '/^mix\/foo/d' list-mix \
| verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-match -ignore-dot-mtime \
| sed -e '/^mix\/foo: extra file$/d'
verify -non-exist unmix/mix/foo
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s29)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 29"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=29
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup pattern unmix stdout stderr
  fi
fi

# cpio appends.						-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c30(

rm -rf $cleanup aplist archive mix-save unmix stdout stderr
# Snippet )c30)
  echo c-append.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can append using default format'
    echo $at_n "     $at_c"
  fi
  echo $at_n "30. $srcdir/c-append.m4:3     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s30(

# The test group starts at `c-append.m4:3'.  An error occurred while
# testing if cpio can append using default format.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-def; then
  cat list-mix | cpio -o > cpio-def 2> /dev/null
  cleanup="$cleanup cpio-def"
fi

echo mix/aptest > aplist
echo mix/tmp/aptest2 >> aplist
cp cpio-def archive
mv mix mix-save
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-append.m4:20: Testing if cpio can append using default format'
echo c-append.m4:20 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -idm < cpio-def
echo append > mix/aptest
echo append2 > mix/tmp/aptest2
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-append.m4:27: Testing if cpio can append using default format'
echo c-append.m4:27 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -oAO archive < aplist
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-append.m4:40: Testing if cpio can append using default format'
echo c-append.m4:40 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -id < ../archive
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-le $TIME < aplist
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

rm -rf mix
mv mix-save mix

# Snippet )s30)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 30"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=30
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup aplist archive mix-save unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c31(

rm -rf $cleanup aplist archive mix-save unmix stdout stderr
# Snippet )c31)
  echo c-append.m4:47 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can append using new portable format'
    echo $at_n "     $at_c"
  fi
  echo $at_n "31. $srcdir/c-append.m4:47    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s31(

# The test group starts at `c-append.m4:47'.  An error occurred while
# testing if cpio can append using new portable format.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-newc; then
  cat list-mix | cpio -oH newc > cpio-newc 2> /dev/null
  cleanup="$cleanup cpio-newc"
fi

echo mix/aptest > aplist
echo mix/tmp/aptest2 >> aplist
cp cpio-newc archive
mv mix mix-save
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-append.m4:64: Testing if cpio can append using new portable format'
echo c-append.m4:64 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -idm < cpio-newc
echo append > mix/aptest
echo append2 > mix/tmp/aptest2
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-append.m4:71: Testing if cpio can append using new portable format'
echo c-append.m4:71 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cpio -oAO archive -H newc < aplist
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-append.m4:84: Testing if cpio can append using new portable format'
echo c-append.m4:84 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -id -H newc < ../archive
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-le $TIME < aplist
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-append.m4:97: Testing if cpio can append using new portable format'
echo c-append.m4:97 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumI ../archive -H newc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-match < aplist
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

rm -rf mix
mv mix-save mix

# Snippet )s31)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 31"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=31
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup aplist archive mix-save unmix stdout stderr
  fi
fi

# Swapping options.					-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c32(

rm -rf $cleanup archive unmix xmix stdout stderr
# Snippet )c32)
  echo c-swap.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio byte swapping works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "32. $srcdir/c-swap.m4:3       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s32(

# The test group starts at `c-swap.m4:3'.  An error occurred while
# testing if cpio byte swapping works.

cleanup=
if test ! -d smix; then
  $at_srcdir/make-mix smix
  cleanup="$cleanup smix"
fi
if test ! -f list-smix; then
  find smix -depth -print > list-smix
  cleanup="$cleanup list-smix"
fi
if test ! -f listf-smix; then
  find smix -type f -depth -print > listf-smix
  cleanup="$cleanup listf-smix"
fi

mkdir unmix xmix

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:14: Testing if cpio byte swapping works'
echo c-swap.m4:14 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-smix | cpio -o -H newc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:24: Testing if cpio byte swapping works'
echo c-swap.m4:24 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd xmix
  cpio -id -H newc < ../archive
cd ..
verify -list -match-dir xmix -size-match -contents-match < list-smix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

cd xmix
  while read file; do
    swapb $file > temp
    rm $file
    mv temp $file
  done < ../listf-smix
cd ..

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:48: Testing if cpio byte swapping works'
echo c-swap.m4:48 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -ids -H newc < ../archive
cd ..
cd xmix
  verify -list -match-dir ../unmix -size-match -contents-match -mtime-le $TIME \
    < ../list-smix
cd ..
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: cannot swap bytes of smix/file3: odd number of bytes
cpio: cannot swap bytes of smix/file4: odd number of bytes
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:58: Testing if cpio byte swapping works'
echo c-swap.m4:58 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idu -H newc < ../archive
cd ..
verify -list -match-dir unmix -size-match -contents-match < list-smix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s32)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 32"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=32
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix xmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c33(

rm -rf $cleanup archive unmix xmix stdout stderr
# Snippet )c33)
  echo c-swap.m4:62 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio halfword swapping works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "33. $srcdir/c-swap.m4:62      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s33(

# The test group starts at `c-swap.m4:62'.  An error occurred while
# testing if cpio halfword swapping works.

cleanup=
if test ! -d smix; then
  $at_srcdir/make-mix smix
  cleanup="$cleanup smix"
fi
if test ! -f list-smix; then
  find smix -depth -print > list-smix
  cleanup="$cleanup list-smix"
fi
if test ! -f listf-smix; then
  find smix -type f -depth -print > listf-smix
  cleanup="$cleanup listf-smix"
fi

mkdir unmix xmix

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:73: Testing if cpio halfword swapping works'
echo c-swap.m4:73 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-smix | cpio -o -H newc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:83: Testing if cpio halfword swapping works'
echo c-swap.m4:83 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd xmix
  cpio -id -H newc < ../archive
cd ..
verify -list -match-dir xmix -size-match -contents-match < list-smix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

cd xmix
  while read file; do
    swaphw $file > temp
    rm $file
    mv temp $file
  done < ../listf-smix
cd ..

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:108: Testing if cpio halfword swapping works'
echo c-swap.m4:108 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idS -H newc < ../archive
cd ..
cd xmix
  verify -list -match-dir ../unmix -size-match -contents-match -mtime-le $TIME \
    < ../list-smix
cd ..
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: cannot swap halfwords of smix/file3: odd number of halfwords
cpio: cannot swap halfwords of smix/file4: odd number of halfwords
cpio: cannot swap halfwords of smix/file5: odd number of halfwords
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:118: Testing if cpio halfword swapping works'
echo c-swap.m4:118 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idu -H newc < ../archive
cd ..
verify -list -match-dir unmix -size-match -contents-match < list-smix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s33)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 33"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=33
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix xmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c34(

rm -rf $cleanup archive unmix xmix stdout stderr
# Snippet )c34)
  echo c-swap.m4:122 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio combined swapping works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "34. $srcdir/c-swap.m4:122     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s34(

# The test group starts at `c-swap.m4:122'.  An error occurred while
# testing if cpio combined swapping works.

cleanup=
if test ! -d smix; then
  $at_srcdir/make-mix smix
  cleanup="$cleanup smix"
fi
if test ! -f list-smix; then
  find smix -depth -print > list-smix
  cleanup="$cleanup list-smix"
fi
if test ! -f listf-smix; then
  find smix -type f -depth -print > listf-smix
  cleanup="$cleanup listf-smix"
fi

mkdir unmix xmix

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:133: Testing if cpio combined swapping works'
echo c-swap.m4:133 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-smix | cpio -o -H newc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:143: Testing if cpio combined swapping works'
echo c-swap.m4:143 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd xmix
  cpio -id -H newc < ../archive
cd ..
verify -list -match-dir xmix -size-match -contents-match < list-smix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

cd xmix
  while read file; do
    swapb $file > temp
    rm $file
    swaphw temp > $file
    rm temp
  done < ../listf-smix
cd ..

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:171: Testing if cpio combined swapping works'
echo c-swap.m4:171 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idsS -H newc < ../archive
cd ..
cd xmix
  verify -list -match-dir ../unmix -size-match -contents-match -mtime-le $TIME \
    < ../list-smix
cd ..
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: cannot swap halfwords of smix/file3: odd number of halfwords
cpio: cannot swap bytes of smix/file3: odd number of bytes
cpio: cannot swap halfwords of smix/file4: odd number of halfwords
cpio: cannot swap bytes of smix/file4: odd number of bytes
cpio: cannot swap halfwords of smix/file5: odd number of halfwords
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:190: Testing if cpio combined swapping works'
echo c-swap.m4:190 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idub -H newc < ../archive
cd ..
cd xmix
  verify -list -match-dir ../unmix -size-match -contents-match -mtime-le $TIME \
    < ../list-smix
cd ..
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: cannot swap halfwords of smix/file3: odd number of halfwords
cpio: cannot swap bytes of smix/file3: odd number of bytes
cpio: cannot swap halfwords of smix/file4: odd number of halfwords
cpio: cannot swap bytes of smix/file4: odd number of bytes
cpio: cannot swap halfwords of smix/file5: odd number of halfwords
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s34)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 34"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=34
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix xmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c35(

rm -rf $cleanup archive unmix xmix stdout stderr
# Snippet )c35)
  echo c-swap.m4:194 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio swapping with weird block sizes'
    echo $at_n "     $at_c"
  fi
  echo $at_n "35. $srcdir/c-swap.m4:194     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s35(

# The test group starts at `c-swap.m4:194'.  An error occurred while
# testing cpio swapping with weird block sizes.

cleanup=
if test ! -d smix; then
  $at_srcdir/make-mix smix
  cleanup="$cleanup smix"
fi
if test ! -f list-smix; then
  find smix -depth -print > list-smix
  cleanup="$cleanup list-smix"
fi

mkdir unmix xmix

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:205: Testing cpio swapping with weird block sizes'
echo c-swap.m4:205 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-smix | cpio -o -H newc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:215: Testing cpio swapping with weird block sizes'
echo c-swap.m4:215 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd xmix
  cpio -id -H newc < ../archive
cd ..
verify -list -match-dir xmix -size-match -contents-match < list-smix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

cd xmix
  while read file; do
    swapb $file > temp
    rm $file
    swaphw temp > $file
    rm temp
  done < ../listf-smix
cd ..

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:243: Testing cpio swapping with weird block sizes'
echo c-swap.m4:243 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idbC 7 -H newc < ../archive
cd ..
cd xmix
  verify -list -match-dir ../unmix -size-match -contents-match -mtime-le $TIME \
    < ../list-smix
cd ..
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: cannot swap halfwords of smix/file3: odd number of halfwords
cpio: cannot swap bytes of smix/file3: odd number of bytes
cpio: cannot swap halfwords of smix/file4: odd number of halfwords
cpio: cannot swap bytes of smix/file4: odd number of bytes
cpio: cannot swap halfwords of smix/file5: odd number of halfwords
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

rm -rf unmix
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:265: Testing cpio swapping with weird block sizes'
echo c-swap.m4:265 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idbC 3 -H newc < ../archive
cd ..
cd xmix
  verify -list -match-dir ../unmix -size-match -contents-match -mtime-le $TIME \
    < ../list-smix
cd ..
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: cannot swap halfwords of smix/file3: odd number of halfwords
cpio: cannot swap bytes of smix/file3: odd number of bytes
cpio: cannot swap halfwords of smix/file4: odd number of halfwords
cpio: cannot swap bytes of smix/file4: odd number of bytes
cpio: cannot swap halfwords of smix/file5: odd number of halfwords
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

rm -rf unmix
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-swap.m4:287: Testing cpio swapping with weird block sizes'
echo c-swap.m4:287 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idbC 1 -H newc < ../archive
cd ..
cd xmix
  verify -list -match-dir ../xmix -size-match -contents-match -mtime-le $TIME \
    < ../list-smix
cd ..
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: cannot swap halfwords of smix/file3: odd number of halfwords
cpio: cannot swap bytes of smix/file3: odd number of bytes
cpio: cannot swap halfwords of smix/file4: odd number of halfwords
cpio: cannot swap bytes of smix/file4: odd number of bytes
cpio: cannot swap halfwords of smix/file5: odd number of halfwords
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s35)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 35"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=35
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix xmix stdout stderr
  fi
fi

# A few FIXME remain in c-junk.m4.
# Corrupted cpio files.					-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c36(

rm -rf $cleanup unmix stdout stderr
# Snippet )c36)
  echo c-junk.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio usual formats with small corruption'
    echo $at_n "     $at_c"
  fi
  echo $at_n "36. $srcdir/c-junk.m4:3       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s36(

# The test group starts at `c-junk.m4:3'.  An error occurred while
# testing cpio usual formats with small corruption.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f minijunk; then
  echo junk > minijunk
  cleanup="$cleanup minijunk"
fi
if test ! -f cpio-def; then
  cat list-mix | cpio -o > cpio-def 2> /dev/null
  cleanup="$cleanup cpio-def"
fi
if test ! -f cpio-oldc; then
  cat list-mix | cpio -oc > cpio-oldc 2> /dev/null
  cleanup="$cleanup cpio-oldc"
fi
if test ! -f cpio-newc; then
  cat list-mix | cpio -oH newc > cpio-newc 2> /dev/null
  cleanup="$cleanup cpio-newc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:18: Testing cpio usual formats with small corruption'
echo c-junk.m4:18 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cat ../minijunk ../cpio-def | cpio -idm || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:29: Testing cpio usual formats with small corruption'
echo c-junk.m4:29 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cat ../minijunk ../cpio-oldc | cpio -idum -c || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:40: Testing cpio usual formats with small corruption'
echo c-junk.m4:40 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cat ../minijunk ../cpio-oldc | cpio -idum || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:63: Testing cpio usual formats with small corruption'
echo c-junk.m4:63 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cat ../minijunk ../cpio-oldc | cpio -idum || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s36)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 36"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=36
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c37(

rm -rf $cleanup unmix stdout stderr
# Snippet )c37)
  echo c-junk.m4:130 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio tar format with corruption'
    echo $at_n "     $at_c"
  fi
  echo $at_n "37. $srcdir/c-junk.m4:130     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s37(

# The test group starts at `c-junk.m4:130'.  An error occurred while
# testing cpio tar format with corruption.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-tar; then
  cat list-mix | cpio -oH tar > cpio-tar 2> /dev/null
  cleanup="$cleanup cpio-tar"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:149: Testing cpio tar format with corruption'
echo c-junk.m4:149 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cat ../minijunk ../cpio-tar | cpio -idH tar || exit 1
cd ..
cat list-mix \
| fgrep -v -x -f mix/extra1 \
| verify -list -match-dir unmix -mode-match -uid-match -gid-match \
    -size-match -contents-match -mtime-le $TIME \
| fgrep -v -x -f mix/extra2
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: invalid header: checksum error
cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:163: Testing cpio tar format with corruption'
echo c-junk.m4:163 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cat ../minijunk ../cpio-tar | cpio -idu || exit 1
cd ..
cat list-mix \
| fgrep -v -x -f mix/extra1 \
| verify -list -match-dir unmix -mode-match -uid-match -gid-match \
    -size-match -contents-match -mtime-le $TIME \
| fgrep -v -x -f mix/extra2
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s37)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 37"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=37
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c38(

rm -rf $cleanup unmix stdout stderr
# Snippet )c38)
  echo c-junk.m4:167 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio ustar format with corruption'
    echo $at_n "     $at_c"
  fi
  echo $at_n "38. $srcdir/c-junk.m4:167     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s38(

# The test group starts at `c-junk.m4:167'.  An error occurred while
# testing cpio ustar format with corruption.

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f minijunk; then
  echo junk > minijunk
  cleanup="$cleanup minijunk"
fi
if test ! -f maxijunk; then
  for loop in 1 2 3 4 5 6 7 8 9 10 11 12; do
    echo junkJUNKjunkJUNKjunkJUNKjunkawholelotofgarbagebecausewewant
    echo tomakesurepeeklooksatmorethan1recordofinput
  done > maxijunk
  cleanup="$cleanup maxijunk"
fi
if test ! -f cpio-ustar; then
  cat list-mix | cpio -oH ustar > cpio-ustar 2> /dev/null
  cleanup="$cleanup cpio-ustar"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:184: Testing cpio ustar format with corruption'
echo c-junk.m4:184 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cat ../minijunk ../cpio-ustar | cpio -idH ustar || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: invalid header: checksum error
cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:196: Testing cpio ustar format with corruption'
echo c-junk.m4:196 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cat ../minijunk ../cpio-ustar | cpio -idu || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: warning: skipped 5 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

rm -rf unmix
mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:212: Testing cpio ustar format with corruption'
echo c-junk.m4:212 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cat ../maxijunk ../cpio-ustar | cpio -idH ustar || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: invalid header: checksum error
cpio: warning: skipped 1248 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-junk.m4:224: Testing cpio ustar format with corruption'
echo c-junk.m4:224 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cat ../maxijunk ../cpio-ustar | cpio -idu || exit 1
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-le $TIME < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "cpio: warning: skipped 1248 bytes of junk
NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s38)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 38"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=38
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

# One FIXME remains in c-long.m4.
# Long files names in cpio.				-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c39(

rm -rf $cleanup archive unmix stdout stderr
# Snippet )c39)
  echo c-long.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio usual formats with long file names'
    echo $at_n "     $at_c"
  fi
  echo $at_n "39. $srcdir/c-long.m4:3       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s39(

# The test group starts at `c-long.m4:3'.  An error occurred while
# testing cpio usual formats with long file names.

cleanup=
if test ! -d lmix; then
  $at_srcdir/make-mix lmix
  cleanup="$cleanup lmix"
fi
if test ! -f list-lmix; then
  find lmix -depth -print > list-lmix
  cleanup="$cleanup list-lmix"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-long.m4:14: Testing cpio usual formats with long file names'
echo c-long.m4:14 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-lmix | cpio -o -H newc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-long.m4:25: Testing cpio usual formats with long file names'
echo c-long.m4:25 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idm -H newc < ../archive
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-match -ignore-dot-mtime < list-lmix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s39)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 39"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=39
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c40(

rm -rf $cleanup archive unmix stdout stderr
# Snippet )c40)
  echo c-long.m4:29 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio ustar format with long file names'
    echo $at_n "     $at_c"
  fi
  echo $at_n "40. $srcdir/c-long.m4:29      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s40(

# The test group starts at `c-long.m4:29'.  An error occurred while
# testing cpio ustar format with long file names.

cleanup=
if test ! -d lmix; then
  $at_srcdir/make-mix lmix
  cleanup="$cleanup lmix"
fi
if test ! -f list-lmix; then
  find lmix -depth -print > list-lmix
  cleanup="$cleanup list-lmix"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-long.m4:40: Testing cpio ustar format with long file names'
echo c-long.m4:40 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-lmix | cpio -oH ustar > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-long.m4:52: Testing cpio ustar format with long file names'
echo c-long.m4:52 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
TIME=`echotime`
cd unmix
  cpio -idH ustar < ../archive
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-le $TIME < list-lmix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s40)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 40"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=40
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c41(

rm -rf $cleanup archive stdout stderr experr
# Snippet )c41)
  echo c-long.m4:56 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio tar format with long file names'
    echo $at_n "     $at_c"
  fi
  echo $at_n "41. $srcdir/c-long.m4:56      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s41(

# The test group starts at `c-long.m4:56'.  An error occurred while
# testing cpio tar format with long file names.

cleanup=
if test ! -d lmix; then
  $at_srcdir/make-mix lmix
  cleanup="$cleanup lmix"
fi
if test ! -f lmix-one; then
  $at_srcdir/make-mix lmix-one
  cleanup="$cleanup lmix-one"
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-long.m4:66: Testing cpio tar format with long file names'
echo c-long.m4:66 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat lmix-one | cpio -oH tar > archive
sed -e 's,^,cpio: ,' -e 's,$,: file name too long,' < lmix-one > experr
echo 'NN blocks' >> experr
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  $at_diff experr stderr || exit 1
fi

# Snippet )s41)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 41"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=41
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive stdout stderr experr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c42(

rm -rf $cleanup archive unmix stdout stderr
# Snippet )c42)
  echo c-long.m4:70 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing cpio new portable format with longer file names'
    echo $at_n "     $at_c"
  fi
  echo $at_n "42. $srcdir/c-long.m4:70      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s42(

# The test group starts at `c-long.m4:70'.  An error occurred while
# testing cpio new portable format with longer file names.

cleanup=
if test ! -d mmix; then
  $at_srcdir/make-mix mmix
  cleanup="$cleanup mmix"
fi
if test ! -f list-mmix; then
  find mmix -depth -print > list-mmix
  cleanup="$cleanup list-mmix"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-long.m4:81: Testing cpio new portable format with longer file names'
echo c-long.m4:81 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cat list-mmix | cpio -o -H newc > archive
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-long.m4:92: Testing cpio new portable format with longer file names'
echo c-long.m4:92 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idum -H newc < ../archive
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match -size-match \
  -contents-match -mtime-match -ignore-dot-mtime < list-mmix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s42)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 42"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=42
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup archive unmix stdout stderr
  fi
fi

# A few FIXME remain in c-owner.m4.
# Ownership tests in cpio.				-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c43(

rm -rf $cleanup unmix stdout stderr
# Snippet )c43)
  echo c-owner.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if cpio can handle current owner/group'
    echo $at_n "     $at_c"
  fi
  echo $at_n "43. $srcdir/c-owner.m4:3      $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s43(

# The test group starts at `c-owner.m4:3'.  An error occurred while
# testing if cpio can handle current owner/group.

# FIXME: Why? :-(
rm -f cpio-crc

cleanup=
if test ! -d mix; then
  $at_srcdir/make-mix mix
  cleanup="$cleanup mix"
fi
if test ! -f list-mix; then
  find mix -depth -print > list-mix
  cleanup="$cleanup list-mix"
fi
if test ! -f cpio-crc; then
  cat list-mix | cpio -oH crc > cpio-crc 2> /dev/null
  cleanup="$cleanup cpio-crc"
fi

mkdir unmix

test -n "$at_verbose" \
  && echo $srcdir'/c-owner.m4:20: Testing if cpio can handle current owner/group'
echo c-owner.m4:20 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumH crc -R $UIDNAME.$GIDNAME < ../cpio-crc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-owner.m4:30: Testing if cpio can handle current owner/group'
echo c-owner.m4:30 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumH crc --no-preserve-owner < ../cpio-crc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-owner.m4:40: Testing if cpio can handle current owner/group'
echo c-owner.m4:40 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumH crc -R $XUID.$GID < ../cpio-crc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/c-owner.m4:50: Testing if cpio can handle current owner/group'
echo c-owner.m4:50 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
cd unmix
  cpio -idumH crc --no-preserve-owner < ../cpio-crc
cd ..
verify -list -match-dir unmix -mode-match -uid-match -gid-match \
  -size-match -contents-match -mtime-match -ignore-dot-mtime < list-mix
grep -v ': truncating inode number' stderr \
| sed 's/^[1-9][0-9]* blocks*/NN blocks/' > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "NN blocks
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s43)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 43"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=43
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf $cleanup unmix stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
  rm -rf mix list-mix cpio-def cpio-oldc
fi

at_skip_mode=

echo
echo 'tar tests.'
echo

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c44(

rm -rf archive file1 file2 stdout stderr
# Snippet )c44)
  echo t-create.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing that -- does not stop option decoding'
    echo $at_n "     $at_c"
  fi
  echo $at_n "44. $srcdir/t-create.m4:3     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s44(

# The test group starts at `t-create.m4:3'.  An error occurred while
# testing that -- does not stop option decoding.

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:11: Testing that -- does not stop option decoding'
echo t-create.m4:11 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x

touch file1 file2
tar cvf archive file1 -- file2

test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "file1
file2
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s44)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 44"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=44
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive file1 file2 stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c45(

rm -rf file stdout stderr
# Snippet )c45)
  echo t-create.m4:14 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if an interrupted write gets restarted on POSIX systems'
    echo $at_n "     $at_c"
  fi
  echo $at_n "45. $srcdir/t-create.m4:14    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s45(

# The test group starts at `t-create.m4:14'.  An error occurred while
# testing if an interrupted write gets restarted on POSIX systems.

# Skip test when fork is not available, like on DOSish systems.
# I do not know how to do this right, so just exclude DOSish for now.
# But cleanup does not occur, then!  FIXME!
test -z "$COMSPEC" || exit 77
test -z "$ComSpec" || exit 77

genfile -l 100000 > file

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:36: Testing if an interrupted write gets restarted on POSIX systems'
echo t-create.m4:36 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
( tar cf - file &
  process=$!
  sleep 2
  kill -STOP $process
  sleep 1
  kill -CONT $process
) |
( sleep 5
  cat > /dev/null
)

test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s45)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 45"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=45
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf file stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c46(

rm -rf archive directory stdout stderr
# Snippet )c46)
  echo t-create.m4:40 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if old archives receive directories'
    echo $at_n "     $at_c"
  fi
  echo $at_n "46. $srcdir/t-create.m4:40    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s46(

# The test group starts at `t-create.m4:40'.  An error occurred while
# testing if old archives receive directories.

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:52: Testing if old archives receive directories'
echo t-create.m4:52 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
mkdir directory
tar cfvo archive directory
tar tf archive
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "directory/
directory/
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s46)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 46"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=46
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive directory stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c47(

rm -rf directory file stdout stderr
# Snippet )c47)
  echo t-create.m4:56 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if --from-files and --directory may be used together'
    echo $at_n "     $at_c"
  fi
  echo $at_n "47. $srcdir/t-create.m4:56    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s47(

# The test group starts at `t-create.m4:56'.  An error occurred while
# testing if --from-files and --directory may be used together.

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:72: Testing if --from-files and --directory may be used together'
echo t-create.m4:72 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
> file
mkdir directory
cd directory
tar cfv archive -C .. file
tar cfCv archive .. file
echo file | tar cfCTv archive .. -
cd ..

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "file
file
file
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s47)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 47"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=47
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf directory file stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c48(

rm -rf archive directory file stdout stderr
# Snippet )c48)
  echo t-create.m4:76 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if --ignore-failed-read handles unreadable directories'
    echo $at_n "     $at_c"
  fi
  echo $at_n "48. $srcdir/t-create.m4:76    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s48(

# The test group starts at `t-create.m4:76'.  An error occurred while
# testing if --ignore-failed-read handles unreadable directories.

## Skip test when root.  These few lines (which warranted a few emails! :-)
## are kept here, but commented, as a reference for possible later use.
#
#touch file
#set - x`ls -l file`
#if test $3 = root; then
#  rm file
#  exit 77
#else
#  rm file
#fi

# Skip test when directory permissions are not enforced, like when
# on AFS filesystems, or DOSish systems.  It also takes care of
# the root case, so the check above does not need to be done anymore.

mkdir directory
chmod 000 directory
if touch 2>/dev/null directory/file; then
  rm -rf directory
  exit 77
else
  chmod 700 directory
  rm -rf directory
fi

touch file
mkdir directory
touch directory/file

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:120: Testing if --ignore-failed-read handles unreadable directories'
echo t-create.m4:120 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
chmod 000 file
tar cf archive file
status=$?
chmod 600 file
test $status = 2 || exit 1
sed 's/denied (.*)$/denied/' stderr > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "tar: Cannot add file file: Permission denied
tar: Processed all files possible, despite earlier errors
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:132: Testing if --ignore-failed-read handles unreadable directories'
echo t-create.m4:132 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
chmod 000 file
tar cf archive --ignore-failed-read file || exit 1
status=$?
chmod 600 file
test $status = 0 || exit 1
sed 's/denied (.*)$/denied/' stderr > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "tar: Cannot add file file: Permission denied
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:145: Testing if --ignore-failed-read handles unreadable directories'
echo t-create.m4:145 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
chmod 000 directory
tar cf archive directory
status=$?
chmod 700 directory
test $status = 2 || exit 1
sed 's/denied (.*)$/denied/' stderr > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "tar: Cannot add directory directory: Permission denied
tar: Processed all files possible, despite earlier errors
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/t-create.m4:157: Testing if --ignore-failed-read handles unreadable directories'
echo t-create.m4:157 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
chmod 000 directory
tar cf archive --ignore-failed-read directory || exit 1
status=$?
chmod 700 directory
test $status = 0 || exit 1
sed 's/denied (.*)$/denied/' stderr > stderr2
mv stderr2 stderr

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "tar: Cannot add directory directory: Permission denied
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s48)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 48"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=48
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive directory file stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c49(

rm -rf archive directory stdout stderr
# Snippet )c49)
  echo t-extract.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if diagnostic is suppressed when directory already exists'
    echo $at_n "     $at_c"
  fi
  echo $at_n "49. $srcdir/t-extract.m4:3    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s49(

# The test group starts at `t-extract.m4:3'.  An error occurred while
# testing if diagnostic is suppressed when directory already exists.

test -n "$at_verbose" \
  && echo $srcdir'/t-extract.m4:13: Testing if diagnostic is suppressed when directory already exists'
echo t-extract.m4:13 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
mkdir directory
touch directory/file
tar cf archive directory
tar xf archive
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s49)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 49"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=49
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive directory stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c50(

rm -rf archive file link stdout stderr
# Snippet )c50)
  echo t-extract.m4:17 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if symlinks can be extracted over existing files'
    echo $at_n "     $at_c"
  fi
  echo $at_n "50. $srcdir/t-extract.m4:17   $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s50(

# The test group starts at `t-extract.m4:17'.  An error occurred while
# testing if symlinks can be extracted over existing files.

# Skip test when file links are not available, like on DOSish systems.
test -z "$COMSPEC" || exit 77
test -z "$ComSpec" || exit 77

test -n "$at_verbose" \
  && echo $srcdir'/t-extract.m4:33: Testing if symlinks can be extracted over existing files'
echo t-extract.m4:33 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
touch file
ln -s file link 2> /dev/null || exit 77
tar cf archive link
rm link
touch link
tar xf archive
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s50)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 50"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=50
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive file link stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c51(

rm -rf archive directory stdout stderr
# Snippet )c51)
  echo t-extract.m4:37 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if paths going up and down avoid extraction loops'
    echo $at_n "     $at_c"
  fi
  echo $at_n "51. $srcdir/t-extract.m4:37   $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s51(

# The test group starts at `t-extract.m4:37'.  An error occurred while
# testing if paths going up and down avoid extraction loops.

test -n "$at_verbose" \
  && echo $srcdir'/t-extract.m4:45: Testing if paths going up and down avoid extraction loops'
echo t-extract.m4:45 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
mkdir directory
tar cfv archive directory/../directory

test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "directory/../directory/
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/t-extract.m4:49: Testing if paths going up and down avoid extraction loops'
echo t-extract.m4:49 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar xfv archive
test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "directory/../directory/
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s51)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 51"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=51
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive directory stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c52(

rm -rf archive directory stdout stderr
# Snippet )c52)
  echo t-extract.m4:53 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing that intermediate directories does not give protection errors'
    echo $at_n "     $at_c"
  fi
  echo $at_n "52. $srcdir/t-extract.m4:53   $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s52(

# The test group starts at `t-extract.m4:53'.  An error occurred while
# testing that intermediate directories does not give protection errors.

# While creating intermediate directories, there was a protection error
# while attemping to create short prefix directories owned by root.

mkdir directory
echo x > directory/file
test -n "$at_verbose" \
  && echo $srcdir'/t-extract.m4:61: Testing that intermediate directories does not give protection errors'
echo t-extract.m4:61 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar cfP archive `pwd`/directory/file
test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

rm -rf directory
test -n "$at_verbose" \
  && echo $srcdir'/t-extract.m4:64: Testing that intermediate directories does not give protection errors'
echo t-extract.m4:64 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar xfP archive `pwd`/directory/file
test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s52)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 52"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=52
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive directory stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c53(

rm -rf archive contents stdout stderr
# Snippet )c53)
  echo t-extract.m4:68 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if --recursive-unlink works as expected'
    echo $at_n "     $at_c"
  fi
  echo $at_n "53. $srcdir/t-extract.m4:68   $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s53(

# The test group starts at `t-extract.m4:68'.  An error occurred while
# testing if --recursive-unlink works as expected.

test -n "$at_verbose" \
  && echo $srcdir'/t-extract.m4:83: Testing if --recursive-unlink works as expected'
echo t-extract.m4:83 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
echo OK > contents
tar cf archive contents
rm contents
mkdir contents
touch contents/file
tar xf archive --recursive-unlink
cat contents
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "OK
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s53)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 53"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=53
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive contents stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c54(

rm -rf archive test-directory stdout stderr
# Snippet )c54)
  echo t-exclude.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if exclude correctly checks the last occurrence of the string'
    echo $at_n "     $at_c"
  fi
  echo $at_n "54. $srcdir/t-exclude.m4:3    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s54(

# The test group starts at `t-exclude.m4:3'.  An error occurred while
# testing if exclude correctly checks the last occurrence of the string.

test -n "$at_verbose" \
  && echo $srcdir'/t-exclude.m4:11: Testing if exclude correctly checks the last occurrence of the string'
echo t-exclude.m4:11 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
mkdir test-directory
touch test-directory/test
tar cvf archive --exclude=test test-directory

test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "test-directory/
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s54)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 54"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=54
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive test-directory stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c55(

rm -rf archive file1 file2 stdout stderr
# Snippet )c55)
  echo t-append.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if append works'
    echo $at_n "     $at_c"
  fi
  echo $at_n "55. $srcdir/t-append.m4:3     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s55(

# The test group starts at `t-append.m4:3'.  An error occurred while
# testing if append works.

test -n "$at_verbose" \
  && echo $srcdir'/t-append.m4:17: Testing if append works'
echo t-append.m4:17 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
touch file1
touch file2
tar cf archive file1
tar rf archive file2
tar tf archive
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "file1
file2
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s55)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 55"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=55
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive file1 file2 stdout stderr
  fi
fi

# One FIXME remains in t-delete.m4.
#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c56(

rm -rf archive file1 file2 stdout stderr
# Snippet )c56)
  echo t-delete.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if deleting a member after a big one leaves a good archive'
    echo $at_n "     $at_c"
  fi
  echo $at_n "56. $srcdir/t-delete.m4:3     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s56(

# The test group starts at `t-delete.m4:3'.  An error occurred while
# testing if deleting a member after a big one leaves a good archive.

test -n "$at_verbose" \
  && echo $srcdir'/t-delete.m4:16: Testing if deleting a member after a big one leaves a good archive'
echo t-delete.m4:16 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
genfile -l 50000 > file1
genfile -l 1024 > file2
tar cf archive file1 file2
tar f archive --delete file2
tar tf archive
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "file1
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s56)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 56"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=56
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive file1 file2 stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c57(

rm -rf archive archive2 1 2 3 stdout stderr
# Snippet )c57)
  echo t-delete.m4:20 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if deleting a member with the archive from stdin works correctly'
    echo $at_n "     $at_c"
  fi
  echo $at_n "57. $srcdir/t-delete.m4:20    $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s57(

# The test group starts at `t-delete.m4:20'.  An error occurred while
# testing if deleting a member with the archive from stdin works correctly.

test -n "$at_verbose" \
  && echo $srcdir'/t-delete.m4:36: Testing if deleting a member with the archive from stdin works correctly'
echo t-delete.m4:36 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
genfile -l 3073 -p zeros > 1
cp 1 2
cp 2 3
tar cf archive 1 2 3
tar tf archive
cat archive | tar f - --delete 2 > archive2
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "1
2
3
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s57)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 57"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=57
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive archive2 1 2 3 stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c58(

rm -rf archive directory stdout stderr
# Snippet )c58)
  echo t-incremen.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if directories older than the listed entry are processed'
    echo $at_n "     $at_c"
  fi
  echo $at_n "58. $srcdir/t-incremen.m4:3   $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s58(

# The test group starts at `t-incremen.m4:3'.  An error occurred while
# testing if directories older than the listed entry are processed.

# Cover for the DOS 2-seconds granularity in file timestamps.

mkdir directory
touch directory/file
sleep 2

test -n "$at_verbose" \
  && echo $srcdir'/t-incremen.m4:15: Testing if directories older than the listed entry are processed'
echo t-incremen.m4:15 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar cfv archive --listed=list directory
test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "directory/
directory/file
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

sleep 3
touch directory/file

test -n "$at_verbose" \
  && echo $srcdir'/t-incremen.m4:23: Testing if directories older than the listed entry are processed'
echo t-incremen.m4:23 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar cfv archive --listed=list directory
test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  echo $at_n "directory/
directory/file
$at_c" | $at_diff - stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s58)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 58"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=58
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive directory stdout stderr
  fi
fi

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c59(

rm -rf archiv-1 archiv-2 before after stdout stderr
# Snippet )c59)
  echo t-incremen.m4:27 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if existing directories are incrementally emptied at restore time'
    echo $at_n "     $at_c"
  fi
  echo $at_n "59. $srcdir/t-incremen.m4:27  $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s59(

# The test group starts at `t-incremen.m4:27'.  An error occurred while
# testing if existing directories are incrementally emptied at restore time.

test -n "$at_verbose" \
  && echo $srcdir'/t-incremen.m4:55: Testing if existing directories are incrementally emptied at restore time'
echo t-incremen.m4:55 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e

mkdir before
cd before
mkdir dir-a
echo alpha > dir-a/file-1
echo beta > file-2
tar cfg ../archiv-1 ../listed .
echo gamma > file-3
mkdir dir-b
echo delta > dir-b/file-4
rm dir-a/file-1 file-2
rmdir dir-a
tar cfg ../archiv-2 ../listed .
cd ..

mkdir after
cd after
tar xfg ../archiv-1 ../listed
tar xfg ../archiv-2 ../listed
cd ..

set +e
diff -r before after

test $? = 0 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

# Snippet )s59)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 59"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=59
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archiv-1 archiv-2 before after stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c60(

rm -rf stdout stderr
# Snippet )c60)
  echo t-gzip.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if tar detects that its gzip child failed'
    echo $at_n "     $at_c"
  fi
  echo $at_n "60. $srcdir/t-gzip.m4:3       $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s60(

# The test group starts at `t-gzip.m4:3'.  An error occurred while
# testing if tar detects that its gzip child failed.

# Skip test when /dev/null is not available.
# Hmph!  Seems it was only for DOS, where DJGPP now supports it.
#test -r /dev/null && exit 77

test -n "$at_verbose" \
  && echo $srcdir'/t-gzip.m4:15: Testing if tar detects that its gzip child failed'
echo t-gzip.m4:15 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar xfvz /dev/null
test $? = 2 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Processed all files possible, despite earlier errors
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s60)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 60"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=60
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf stdout stderr
  fi
fi

#							-*- shell-script -*-

if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
# Snippet (c61(

rm -rf archive stdout stderr
# Snippet )c61)
  echo t-volume.m4:3 > at-check-line
  if test -n "$at_verbose"; then
    echo 'testing if volume labels are checked on read by fnmatch'
    echo $at_n "     $at_c"
  fi
  echo $at_n "61. $srcdir/t-volume.m4:3     $at_c"
  if test -z "$at_skip_mode"; then
    (
# Snippet (s61(

# The test group starts at `t-volume.m4:3'.  An error occurred while
# testing if volume labels are checked on read by fnmatch.

# Skip test when /dev/null is not available.
# Hmph!  Seems it was only for DOS, where DJGPP now supports it.
test -r /dev/null || exit 77

test -n "$at_verbose" \
  && echo $srcdir'/t-volume.m4:17: Testing if volume labels are checked on read by fnmatch'
echo t-volume.m4:17 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
set -e
tar cfVT archive label /dev/null
tar xfV archive label
tar xfV archive 'la?el'
tar xfV archive 'l*l'
set +e

test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  test ! -s stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/t-volume.m4:22: Testing if volume labels are checked on read by fnmatch'
echo t-volume.m4:22 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar xfV archive lab
test $? = 2 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "tar: Volume \`label' does not match \`lab'
tar: Error is not recoverable: exiting now
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/t-volume.m4:27: Testing if volume labels are checked on read by fnmatch'
echo t-volume.m4:27 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar xfV archive bel
test $? = 2 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "tar: Volume \`label' does not match \`bel'
tar: Error is not recoverable: exiting now
$at_c" | $at_diff - stderr || exit 1
fi

test -n "$at_verbose" \
  && echo $srcdir'/t-volume.m4:32: Testing if volume labels are checked on read by fnmatch'
echo t-volume.m4:32 > at-check-line
test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
test -n "$at_tracex" && set -x
tar xfV archive babel
test $? = 2 || exit 1
test -n "$at_tracex" && set +x
if test -z "$at_no_redirs"; then
  exec 1>&5 2>&6
  test ! -s stdout || exit 1
  echo $at_n "tar: Volume \`label' does not match \`babel'
tar: Error is not recoverable: exiting now
$at_c" | $at_diff - stderr || exit 1
fi

# Snippet )s61)
    )
    case $? in
      0) echo ok
	 ;;
      77) echo "ignored near \``cat at-check-line`'"
	  at_ignore_count=`expr $at_ignore_count + 1`
	  ;;
      *) echo "FAILED near \``cat at-check-line`'"
	 at_failed_list="$at_failed_list 61"
	 ;;
    esac
  else
     echo "ignored near \``cat at-check-line`'"
     at_ignore_count=`expr $at_ignore_count + 1`
  fi
  at_test_count=61
  if test -z "$at_stop_on_error" || test -z "$at_failed_list"; then
    rm -rf archive stdout stderr
  fi
fi

# End of test suite.

# Wrap up the testing suite with summary statistics.

rm -f at-check-line
at_fail_count=0
if test -z "$at_failed_list"; then
  if test "$at_ignore_count" = 0; then
    at_banner="All $at_test_count tests were successful"
  else
    at_banner="All $at_test_count tests were successful ($at_ignore_count ignored)"
  fi
else
  echo
  echo $at_n "Writing \`debug-NN.sh' scripts, NN =$at_c"
  for at_group in $at_failed_list; do
    echo $at_n " $at_group$at_c"
    ( echo '#!/bin/sh'
      sed -n "/^# Snippet (1/,/^# Snippet )1/p" atconfig
      test -z "$at_silent" && echo 'at_verbose=1'
      sed -n "/^# Snippet (2/,/^# Snippet )2/p" atconfig
      sed -n "/^# Snippet (3/,/^# Snippet )3/p" $0
      sed -n "/^# Snippet (c$at_group(/,/^# Snippet )c$at_group)/p" $0
      echo 'test -n "$at_verbose" \
        && echo "$0:1: =================================================="'
      sed -n "/^# Snippet (s$at_group(/,/^# Snippet )s$at_group)/p" $0
      echo 'exit 0'
    ) | grep -v '^# Snippet' > debug-$at_group.sh
    chmod +x debug-$at_group.sh
    at_fail_count=`expr $at_fail_count + 1`
  done
  echo ', done'
  if test -n "$at_stop_on_error"; then
    at_banner="ERROR: One of the tests failed, inhibiting subsequent tests"
  else
    at_banner="ERROR: Suite unsuccessful, $at_fail_count of $at_test_count tests failed"
  fi
fi
at_dashes=`echo $at_banner | sed s/./=/g`
echo
echo "$at_dashes"
echo "$at_banner"
echo "$at_dashes"

if test -n "$at_failed_list"; then
  if test -z "$at_silent"; then
    echo
    echo "Now, failed tests will be executed again, with more details..."
    echo
    for at_group in $at_failed_list; do
      ./debug-$at_group.sh
    done
  fi
  exit 1
fi

exit 0
