X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=tests%2Ftestsuite;h=907e52032e759945c49eccdd8cede6784991d1db;hb=eb3ba7cb06fdd0f8627b8f117d8453e297e18b64;hp=880890c4162d5bfdf71b5c9dd113d5384dc81026;hpb=cf7169a2ede9bb08b71de68fe0c8bbecf827abe6;p=debian%2Ftar diff --git a/tests/testsuite b/tests/testsuite index 880890c4..907e5203 100755 --- a/tests/testsuite +++ b/tests/testsuite @@ -1,58 +1,78 @@ #! /bin/sh +# Generated from testsuite.at by GNU Autoconf 2.69. +# +# Copyright (C) 2009-2012 Free Software Foundation, Inc. # -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -61,20 +81,19 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -85,354 +104,341 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # CDPATH. -$as_unset CDPATH - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break fi - fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -fi -fi +} # as_fn_mkdir_p +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -exitcode=0 -if as_func_success; then - : +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. + as_expr=false fi -if as_func_ret_success; then - : +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename else - exitcode=1 - echo as_func_ret_success failed. + as_basename=false fi -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -449,9 +455,12 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -460,84 +469,55 @@ test \$exitcode = 0") || { exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -547,32 +527,13 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" -# Load the config file. -for at_file in atconfig atlocal -do - test -r $at_file || continue - . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2 - { (exit 1); exit 1; }; } -done - -# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: -: ${at_top_build_prefix=$at_top_builddir} - -# atconfig delivers names relative to the directory the test suite is -# in, but the groups themselves are run in testsuite-dir/group-dir. -if test -n "$at_top_srcdir"; then - builddir=../.. - for at_dir in srcdir top_srcdir top_build_prefix - do - at_val=`eval echo '${'at_$at_dir'}'` - eval "$at_dir=\$at_val/../.." - done -fi # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. @@ -583,9 +544,14 @@ at_times_p=false at_debug_args= # -e sets to true at_errexit_p=false -# Shall we be verbose? +# Shall we be verbose? ':' means no, empty means yes. at_verbose=: -at_quiet=echo +at_quiet= +# Running several jobs in parallel, 0 means as many as test groups. +at_jobs=1 +at_traceon=: +at_trace_echo=: +at_check_filter_trace=: # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. @@ -596,114 +562,241 @@ at_help_p=false at_version_p=false # List test groups? at_list_p=false +# --clean +at_clean=false # Test groups to run at_groups= +# Whether to rerun failed tests. +at_recheck= +# Whether a write failure occurred +at_write_fail=0 -# The directory we are in. +# The directory we run the suite in. Default to . if no -C option. at_dir=`pwd` -# The directory the whole suite works in. -# Should be absolutely to let the user `cd' at will. -at_suite_dir=$at_dir/$as_me.dir -# The file containing the suite. -at_suite_log=$at_dir/$as_me.log -# The file containing the location of the last AT_CHECK. -at_check_line_file=$at_suite_dir/at-check-line -# The file containing the exit status of the last command. -at_status_file=$at_suite_dir/at-status -# The files containing the output of the tested commands. -at_stdout=$at_suite_dir/at-stdout -at_stder1=$at_suite_dir/at-stder1 -at_stderr=$at_suite_dir/at-stderr -# The file containing dates. -at_times_file=$at_suite_dir/at-times +# An absolute reference to this testsuite script. +case $as_myself in + [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;; + * ) at_myself=$at_dir/$as_myself ;; +esac +# Whether -C is in effect. +at_change_dir=false +# Whether to enable colored test results. +at_color=no # List of the tested programs. at_tested='tar' -# List of the all the test groups. -at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77' # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. -at_format='??' +at_format='???' # Description of all the test groups. at_help_all="1;version.at:19;tar version;; 2;pipe.at:29;decompressing from stdin;pipe; 3;options.at:24;mixing options;options options00; 4;options02.at:26;interspersed options;options options02; -5;T-empty.at:26;files-from: empty entries;files-from empty; -6;T-null.at:21;files-from: 0-separated file without -0;files-from null T-null; -7;indexfile.at:26;tar --index-file=this_is_a_very_long_file_name_which_raises_issues.c --file=-;stdout indexfile; -8;verbose.at:26;tar cvf -;stdout verbose; -9;append.at:21;append;append append00; -10;append01.at:29;appending files with long names;append append01; -11;append02.at:40;append vs. create;append append02 append-gnu; -12;exclude.at:23;exclude;exclude; -13;delete01.at:23;deleting a member after a big one;delete delete01; -14;delete02.at:23;deleting a member from stdin archive;delete delete02; -15;delete03.at:21;deleting members with long names;delete delete03; -16;delete04.at:23;deleting a large last member;delete delete04; -17;delete05.at:27;deleting non-existing member;delete delete05; -18;extrac01.at:23;extract over an existing directory;extract extract01; -19;extrac02.at:23;extracting symlinks over an existing file;extract extract02 symlink; -20;extrac03.at:23;extraction loops;extract extract03; -21;extrac04.at:23;extract + fnmatch;extract extract04 fnmatch; -22;extrac05.at:30;extracting selected members from pax;extract extract05; -23;extrac06.at:33;mode of extracted directories;extract extract06 directory mode; -24;extrac07.at:27;extracting symlinks to a read-only dir;extract extract07 read-only symlink; -25;gzip.at:23;gzip;gzip; -26;incremental.at:23;incremental;incremental incr00; -27;incr01.at:27;restore broken symlinks from incremental;incremental incr01; -28;incr02.at:32;restoring timestamps from incremental;incremental timestamp restore incr02; -29;listed01.at:26;--listed for individual files;listed incremental listed01; -30;listed02.at:28;working --listed;listed incremental listed02; -31;incr03.at:28;renamed files in incrementals;incremental incr03 rename; -32;incr04.at:29;proper icontents initialization;incremental incr04 icontents; -33;rename01.at:24;renamed dirs in incrementals;incremental rename rename01; -34;rename02.at:24;move between hierarchies;incremental rename rename02; -35;rename03.at:23;cyclic renames;incremental rename rename03 cyclic-rename; -36;rename04.at:27;renamed directory containing subdirectories;incremental rename04 rename; -37;rename05.at:24;renamed subdirectories;incremental rename05 rename; -38;chtype.at:27;changed file types in incrementals;incremental chtype; -39;ignfail.at:23;ignfail;ignfail; -40;link01.at:33;link count gt 2;link01; -41;longv7.at:24;long names in V7 archives;longname longv7; -42;long01.at:28;long file names divisible by block size;longname long512; -43;lustar01.at:21;ustar: unsplittable file name;longname ustar lustar01; -44;lustar02.at:21;ustar: unsplittable path name;longname ustar lustar02; -45;lustar03.at:21;ustar: splitting long names;longname ustar lustar03; -46;multiv01.at:23;multivolume dumps from pipes;multivolume multiv multiv01; -47;multiv02.at:28;skipping a straddling member;multivolume multiv multiv02; -48;multiv03.at:30;MV archive & long filenames;multivolume multiv multiv03; -49;multiv04.at:36;split directory members in a MV archive;multivolume multiv incremental multiv04; -50;multiv05.at:26;Restoring after an out of sync volume;multivolume multiv multiv05 sync; -51;multiv06.at:27;Multivolumes with L=record_size;multivolume multiv multiv06; -52;old.at:23;old archives;old; -53;recurse.at:21;recurse;recurse; -54;same-order01.at:26;working -C with --same-order;same-order same-order01; -55;same-order02.at:25;multiple -C options;same-order same-order02; -56;shortrec.at:25;short records;shortrec.at; -57;sparse01.at:21;sparse files;sparse sparse01; -58;sparse02.at:21;extracting sparse file over a pipe;sparse sparse02; -59;sparse03.at:21;storing sparse files > 8G;sparse sparse03; -60;sparsemv.at:21;sparse files in MV archives;sparse multiv sparsemv; -61;spmvp00.at:21;sparse files in PAX MV archives, v.0.0;sparse multiv sparsemvp sparsemvp00; -62;spmvp01.at:21;sparse files in PAX MV archives, v.0.1;sparse multiv sparsemvp sparsemvp01; -63;spmvp10.at:21;sparse files in PAX MV archives, v.1.0;sparse multiv sparsemvp sparsemvp10; -64;update.at:27;update unchanged directories;update; -65;volume.at:23;volume;volume volcheck; -66;volsize.at:29;volume header size;volume volsize; -67;comprec.at:21;compressed format recognition;comprec; -68;shortfile.at:26;short input files;shortfile shortfile0; -69;shortupd.at:29;updating short archives;shortfile shortfile1 shortupd; -70;truncate.at:29;truncate;truncate filechange; -71;grow.at:24;grow;grow filechange; -72;gtarfail.at:21;gtarfail;star gtarfail; -73;gtarfail2.at:21;gtarfail2;star gtarfail2; -74;multi-fail.at:21;multi-fail;star multivolume multiv multi-fail; -75;ustar-big-2g.at:21;ustar-big-2g;star ustar-big-2g; -76;ustar-big-8g.at:21;ustar-big-8g;star ustar-big-8g; -77;pax-big-10g.at:21;pax-big-10g;star pax-big-10g; +5;opcomp01.at:21;occurrence compatibility;opcomp opcomp01; +6;opcomp02.at:21;occurrence compatibility;opcomp opcomp02; +7;opcomp03.at:21;--verify compatibility;opcomp opcomp03; +8;opcomp04.at:21;compress option compatibility;opcomp opcomp04; +9;opcomp05.at:21;--pax-option compatibility;opcomp opcomp05; +10;opcomp06.at:21;--pax-option compatibility;opcomp opcomp06; +11;T-mult.at:21;multiple file lists;files-from t-mult; +12;T-nest.at:21;nested file lists;files-from t-nest; +13;T-rec.at:21;recursive file lists;files-from t-rec; +14;T-cd.at:21;-C in file lists;files-from t-cd; +15;T-empty.at:26;empty entries;files-from empty-line; +16;T-null.at:21;0-separated file without -0;files-from null t-null; +17;T-zfile.at:26;empty file;files-from empty-file; +18;T-nonl.at:27;entries with missing newlines;files-from nonewline nonl t-nonl; +19;indexfile.at:26;tar --index-file=FILE --file=-;stdout indexfile; +20;verbose.at:26;tar cvf -;stdout verbose; +21;gzip.at:23;gzip;gzip; +22;recurse.at:21;recurse;recurse; +23;shortrec.at:25;short records;shortrec; +24;same-order01.at:26;working -C with --same-order;same-order same-order01; +25;same-order02.at:25;multiple -C options;same-order same-order02; +26;append.at:21;append;append append00; +27;append01.at:29;appending files with long names;append append01; +28;append02.at:54;append vs. create;append append02 append-gnu; +29;append03.at:21;append with name transformation;append append03; +30;append04.at:29;append with verify;append append04 verify append-verify; +31;xform-h.at:30;transforming hard links on create;transform xform xform-h; +32;xform01.at:26;transformations and GNU volume labels;transform xform xform01 volume; +33;exclude.at:23;exclude;exclude; +34;exclude01.at:19;exclude wildcards;exclude exclude01; +35;exclude02.at:19;exclude: anchoring;exclude exclude02; +36;exclude03.at:19;exclude: wildcards match slash;exclude exclude03; +37;exclude04.at:19;exclude: case insensitive;exclude exclude04; +38;exclude05.at:21;exclude: lots of excludes;exclude exclude05; +39;exclude06.at:26;exclude: long files in pax archives;exclude exclude06; +40;exclude07.at:19;exclude: --exclude-backups option;exclude exclude07; +41;exclude08.at:36;--exclude-tag option;exclude exclude-tag exclude08; +42;exclude09.at:37;--exclude-tag option and --listed-incremental;exclude exclude-tag listed incremental exclude09; +43;exclude10.at:38;--exclude-tag option in incremental pass;exclude exclude-tag listed incremental exclude10; +44;exclude11.at:36;--exclude-tag-under option;exclude exclude-tag exclude-tag-under exclude11; +45;exclude12.at:37;--exclude-tag-under and --listed-incremental;exclude exclude-tag exclude-tag-under listed incremental exclude12; +46;exclude13.at:39;--exclude-tag-under option in incremental pass;exclude exclude-tag exclude-tag-under listed incremental exclude13; +47;exclude14.at:36;--exclude-tag-all option;exclude exclude-tag exclude-tag-all exclude14; +48;exclude15.at:36;--exclude-tag-all and --listed-incremental;exclude exclude-tag exclude-tag-all listed incremental exclude15; +49;exclude16.at:38;--exclude-tag-all option in incremental pass;exclude exclude-tag exclude-tag-all listed incremental exclude16; +50;delete01.at:23;deleting a member after a big one;delete delete01; +51;delete02.at:23;deleting a member from stdin archive;delete delete02; +52;delete03.at:21;deleting members with long names;delete delete03; +53;delete04.at:23;deleting a large last member;delete delete04; +54;delete05.at:27;deleting non-existing member;delete delete05; +55;extrac01.at:23;extract over an existing directory;extract extract01; +56;extrac02.at:23;extracting symlinks over an existing file;extract extract02 symlink; +57;extrac03.at:23;extraction loops;extract extract03; +58;extrac04.at:23;extract + fnmatch;extract extract04 fnmatch; +59;extrac05.at:30;extracting selected members from pax;extract extract05; +60;extrac06.at:34;mode of extracted directories;extract extract06 directory mode; +61;extrac07.at:27;extracting symlinks to a read-only dir;extract extract07 read-only symlink; +62;extrac08.at:33;restoring mode on existing directory;extract extrac08; +63;extrac09.at:24;no need to save dir with unreadable . and ..;extract extrac09; +64;extrac10.at:29;-C and delayed setting of metadata;extract extrac10; +65;extrac11.at:25;scarce file descriptors;extract extrac11; +66;extrac12.at:25;extract dot permissions;extract extrac12; +67;extrac13.at:26;extract over symlinks;extract extrac13; +68;extrac14.at:25;extract -C symlink;extract extrac14; +69;extrac15.at:25;extract parent mkdir failure;extract extrac15; +70;extrac16.at:26;extract empty directory with -C;extract extrac16; +71;extrac17.at:21;name matching/transformation ordering;extract extrac17; +72;extrac18.at:34;keep-old-files;extract extrac18 old-files keep-old-files; +73;extrac19.at:21;skip-old-files;extract extrac19 old-files skip-old-files; +74;backup01.at:33;extracting existing dir with --backup;extract backup backup01; +75;label01.at:21;single-volume label;label label01; +76;label02.at:21;multi-volume label;label label02 multi-label multivolume multiv; +77;label03.at:27;test-label option;label label03 test-label; +78;label04.at:27;label with non-create option;label label04; +79;label05.at:24;label with non-create option;label label05; +80;incremental.at:23;incremental;incremental listed incr00; +81;incr01.at:27;restore broken symlinks from incremental;incremental incr01; +82;incr02.at:32;restoring timestamps from incremental;incremental timestamp restore incr02; +83;listed01.at:26;--listed for individual files;listed incremental listed01; +84;listed02.at:28;working --listed;listed incremental listed02; +85;listed03.at:24;incremental dump when the parent directory is unreadable;listed incremental listed03; +86;listed04.at:26;--listed-incremental and --one-file-system;listed incremental listed04; +87;listed05.at:33;--listed-incremental and remounted directories;listed incremental listed05; +88;incr03.at:28;renamed files in incrementals;incremental incr03 rename; +89;incr04.at:29;proper icontents initialization;incremental incr04 icontents; +90;incr05.at:21;incremental dumps with -C;incremental incr05; +91;incr06.at:21;incremental dumps of nested directories;incremental incr06; +92;incr07.at:18;incremental restores with -C;incremental extract incr07; +93;incr08.at:38;filename normalization;incremental create incr08; +94;incr09.at:26;incremental with alternating -C;incremental create incr09; +95;filerem01.at:36;file removed as we read it (ca. 22 seconds);create incremental listed filechange filerem filerem01; +96;filerem02.at:26;toplevel file removed (ca. 24 seconds);create incremental listed filechange filerem filerem02; +97;rename01.at:24;renamed dirs in incrementals;incremental rename rename01; +98;rename02.at:24;move between hierarchies;incremental rename rename02; +99;rename03.at:23;cyclic renames;incremental rename rename03 cyclic-rename; +100;rename04.at:27;renamed directory containing subdirectories;incremental rename04 rename; +101;rename05.at:24;renamed subdirectories;incremental rename05 rename; +102;chtype.at:27;changed file types in incrementals;incremental listed chtype; +103;ignfail.at:23;ignfail;ignfail; +104;link01.at:33;link count gt 2;hardlinks link01; +105;link02.at:32;preserve hard links with --remove-files;hardlinks link02; +106;link03.at:24;working -l with --remove-files;hardlinks link03; +107;link04.at:29;link count is 1 but multiple occurrences;hardlinks link04; +108;longv7.at:24;long names in V7 archives;longname longv7; +109;long01.at:28;long file names divisible by block size;longname long512; +110;lustar01.at:21;ustar: unsplittable file name;longname ustar lustar01; +111;lustar02.at:21;ustar: unsplittable path name;longname ustar lustar02; +112;lustar03.at:21;ustar: splitting long names;longname ustar lustar03; +113;old.at:23;old archives;old; +114;time01.at:20;time: tricky time stamps;time time01; +115;multiv01.at:23;multivolume dumps from pipes;multivolume multiv multiv01; +116;multiv02.at:28;skipping a straddling member;multivolume multiv multiv02; +117;multiv03.at:30;MV archive & long filenames;multivolume multiv multiv03; +118;multiv04.at:36;split directory members in a MV archive;multivolume multiv incremental listed multiv04; +119;multiv05.at:26;Restoring after an out of sync volume;multivolume multiv multiv05 sync; +120;multiv06.at:27;Multivolumes with L=record_size;multivolume multiv multiv06; +121;multiv07.at:28;volumes split at an extended header;multivolume multiv multiv07 xsplit; +122;multiv08.at:25;multivolume header creation;multivolume multiv multiv08; +123;owner.at:21;--owner and --group;owner; +124;sparse01.at:21;sparse files;sparse sparse01; +125;sparse02.at:21;extracting sparse file over a pipe;sparse sparse02; +126;sparse03.at:21;storing sparse files > 8G;sparse sparse03; +127;sparse04.at:21;storing long sparse file names;sparse sparse04; +128;sparsemv.at:21;sparse files in MV archives;sparse multiv sparsemv; +129;spmvp00.at:21;sparse files in PAX MV archives, v.0.0;sparse multivolume multiv sparsemvp sparsemvp00; +130;spmvp01.at:21;sparse files in PAX MV archives, v.0.1;sparse multiv sparsemvp sparsemvp01; +131;spmvp10.at:21;sparse files in PAX MV archives, v.1.0;sparse multivolume multiv sparsemvp sparsemvp10; +132;update.at:28;update unchanged directories;update update00; +133;update01.at:29;update directories;update update01; +134;update02.at:26;update changed files;update update02; +135;verify.at:25;verify;verify; +136;volume.at:23;volume;volume volcheck; +137;volsize.at:29;volume header size;volume volsize; +138;comprec.at:21;compressed format recognition;comprec; +139;shortfile.at:26;short input files;shortfile shortfile0; +140;shortupd.at:31;updating short archives;shortfile shortfile1 shortupd; +141;truncate.at:29;truncate;truncate filechange; +142;grow.at:24;grow;grow filechange; +143;sigpipe.at:21;sigpipe handling;sigpipe; +144;remfiles01.at:28;remove-files with compression;create remove-files remfiles01 gzip; +145;remfiles02.at:28;remove-files with compression: grand-child;create remove-files remfiles02 gzip; +146;remfiles03.at:28;remove-files with symbolic links;create remove-files remfiles03; +147;remfiles04a.at:25;remove-files with -C:rel in -c/non-incr. mode;create remove-files remfiles04 remfiles04a; +148;remfiles04b.at:33;remove-files with -C:rel in -c/incr. mode;create incremental remove-files remfiles04 remfiles04b; +149;remfiles04c.at:33;remove-files with -C:rel in -r mode;create append remove-files remfiles04 remfiles04c; +150;remfiles05a.at:34;remove-files with -C:rel,rel in -c/non-incr. mode;create remove-files remfiles05 remfiles05a; +151;remfiles05b.at:25;remove-files with -C:rel,rel in -c/incr. mode;create incremental remove-files remfiles05 remfiles05b; +152;remfiles05c.at:25;remove-files with -C:rel,rel in -r mode;create append remove-files remfiles05 remfiles05c; +153;remfiles06a.at:25;remove-files with -C:rel,abs in -c/non-incr. mode;create remove-files remfiles06 remfiles06a; +154;remfiles06b.at:25;remove-files with -C:rel,abs in -c/incr. mode;create incremental remove-files remfiles06 remfiles06b; +155;remfiles06c.at:25;remove-files with -C:rel,abs in -r mode;create append remove-files remfiles06 remfiles06c; +156;remfiles07a.at:25;remove-files with -C:rel,abs in -c/non-incr. mode;create remove-files remfiles07 remfiles07a; +157;remfiles07b.at:25;remove-files with -C:rel,abs in -c/incr. mode;create incremental remove-files remfiles07 remfiles07b; +158;remfiles07c.at:25;remove-files with -C:rel,abs in -r mode;create append remove-files remfiles07 remfiles07c; +159;remfiles08a.at:25;remove-files with -C:abs,rel in -c/non-incr. mode;create remove-files remfiles08 remfiles08a; +160;remfiles08b.at:25;remove-files with -C:abs,rel in -c/incr. mode;create incremental remove-files remfiles08 remfiles08b; +161;remfiles08c.at:25;remove-files with -C:abs,rel in -r mode;create append remove-files remfiles08 remfiles08c; +162;remfiles09a.at:25;remove-files on full directory in -c/non-incr. mode;create remove-files remfiles09 remfiles09a; +163;remfiles09b.at:29;remove-files on full directory in -c/incr. mode;create incremental remove-files remfiles09 remfiles09b; +164;remfiles09c.at:25;remove-files on full directory in -r mode;create append remove-files remfiles09 remfiles09c; +165;xattr01.at:25;xattrs: basic functionality;xattrs xattr01; +166;xattr02.at:25;xattrs: change directory with -C option;xattrs xattr02; +167;xattr03.at:25;xattrs: trusted.* attributes;xattrs xattr03; +168;xattr04.at:26;xattrs: s/open/openat/ regression;xattrs xattr04; +169;xattr05.at:28;xattrs: keywords with '=' and '%';xattrs xattr05; +170;acls01.at:25;acls: basic functionality;xattrs acls acls01; +171;acls02.at:25;acls: work with -C;xattrs acls acls02; +172;selnx01.at:25;selinux: basic store/restore;xattrs selinux selnx01; +173;selacl01.at:25;acls/selinux: special files & fifos;xattrs selinux acls selacls01; +174;capabs_raw01.at:25;capabilities: binary store/restore;xattrs capabilities capabs_raw01; +175;gtarfail.at:21;gtarfail;star gtarfail; +176;gtarfail2.at:21;gtarfail2;star gtarfail2; +177;multi-fail.at:21;multi-fail;star multivolume multiv multi-fail; +178;ustar-big-2g.at:21;ustar-big-2g;star ustar-big-2g; +179;ustar-big-8g.at:21;ustar-big-8g;star ustar-big-8g; +180;pax-big-10g.at:21;pax-big-10g;star pax-big-10g; " +# List of the all the test groups. +at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` + +# at_fn_validate_ranges NAME... +# ----------------------------- +# Validate and normalize the test group number contained in each variable +# NAME. Leading zeroes are treated as decimal. +at_fn_validate_ranges () +{ + for at_grp + do + eval at_value=\$$at_grp + if test $at_value -lt 1 || test $at_value -gt 180; then + $as_echo "invalid test group: $at_value" >&2 + exit 1 + fi + case $at_value in + 0*) # We want to treat leading 0 as decimal, like expr and test, but + # AS_VAR_ARITH treats it as octal if it uses $(( )). + # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the + # expr fork, but it is not worth the effort to determine if the + # shell supports XSI when the user can just avoid leading 0. + eval $at_grp='`expr $at_value + 0`' ;; + esac + done +} at_prev= for at_option @@ -715,8 +808,8 @@ do fi case $at_option in - *=*) at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` ;; - *) at_optarg= ;; + *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;; + *) at_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -735,10 +828,20 @@ do ;; --clean | -c ) - test -d "$at_suite_dir" && - find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; - rm -f -r "$at_suite_dir" "$at_suite_log" - exit 0 + at_clean=: + ;; + + --color ) + at_color=always + ;; + --color=* ) + case $at_optarg in + no | never | none) at_color=never ;; + auto | tty | if-tty) at_color=auto ;; + always | yes | force) at_color=always ;; + *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'` + as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;; + esac ;; --debug | -d ) @@ -751,30 +854,35 @@ do ;; --verbose | -v ) - at_verbose=echo; at_quiet=: + at_verbose=; at_quiet=: ;; --trace | -x ) - at_traceon='set -x'; at_traceoff='set +x' + at_traceon='set -x' + at_trace_echo=echo + at_check_filter_trace=at_fn_filter_trace ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) - at_groups="$at_groups$at_option " + at_fn_validate_ranges at_option + as_fn_append at_groups "$at_option$as_nl" ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d X-` - at_range=`echo " $at_groups_all " | \ - sed -e 's/^.* \('$at_range_start' \)/\1/'` - at_groups="$at_groups$at_range " + at_fn_validate_ranges at_range_start + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,$p'` + as_fn_append at_groups "$at_range$as_nl" ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d X-` - at_range=`echo " $at_groups_all " | \ - sed -e 's/\( '$at_range_end'\) .*$/\1/'` - at_groups="$at_groups$at_range " + at_fn_validate_ranges at_range_end + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '1,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ @@ -790,10 +898,38 @@ do at_range_end=$at_range_start at_range_start=$at_tmp fi - at_range=`echo " $at_groups_all " | \ - sed -e 's/^.*\( '$at_range_start' \)/\1/' \ - -e 's/\( '$at_range_end'\) .*$/\1/'` - at_groups="$at_groups$at_range " + at_fn_validate_ranges at_range_start at_range_end + at_range=`$as_echo "$at_groups_all" | \ + sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` + as_fn_append at_groups "$at_range$as_nl" + ;; + + # Directory selection. + --directory | -C ) + at_prev=--directory + ;; + --directory=* ) + at_change_dir=: + at_dir=$at_optarg + if test x- = "x$at_dir" ; then + at_dir=./- + fi + ;; + + # Parallel execution. + --jobs | -j ) + at_jobs=0 + ;; + --jobs=* | -j[0-9]* ) + if test -n "$at_optarg"; then + at_jobs=$at_optarg + else + at_jobs=`expr X$at_option : 'X-j\(.*\)'` + fi + case $at_jobs in *[!0-9]*) + at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'` + as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;; + esac ;; # Keywords. @@ -817,85 +953,97 @@ do ;; esac # It is on purpose that we match the test group titles too. - at_groups_selected=`echo "$at_groups_selected" | + at_groups_selected=`$as_echo "$at_groups_selected" | grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` done - at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'` - # Smash the newlines. - at_groups="$at_groups`echo $at_groups_selected` " + # Smash the keywords. + at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'` + as_fn_append at_groups "$at_groups_selected$as_nl" + ;; + --recheck) + at_recheck=: ;; *=*) at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $at_envvar" >&2 - { (exit 1); exit 1; }; } - at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$at_envvar='$at_value'" + case $at_envvar in + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$at_envvar'" ;; + esac + at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` + # Export now, but save eval for later and for debug scripts. export $at_envvar - # Propagate to debug scripts. - at_debug_args="$at_debug_args $at_envvar='$at_value'" + as_fn_append at_debug_args " $at_envvar='$at_value'" ;; - *) echo "$as_me: invalid option: $at_option" >&2 - echo "Try \`$0 --help' for more information." >&2 + *) $as_echo "$as_me: invalid option: $at_option" >&2 + $as_echo "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done +# Verify our last option didn't require an argument +if test -n "$at_prev"; then : + as_fn_error $? "\`$at_prev' requires an argument" +fi + +# The file containing the suite. +at_suite_log=$at_dir/$as_me.log + # Selected test groups. -if test -z "$at_groups"; then +if test -z "$at_groups$at_recheck"; then at_groups=$at_groups_all else - # Sort the tests, removing duplicates: - at_groups=`echo $at_groups | tr ' ' "$as_nl" | sort -nu` - # and add banners. (Passing at_groups_all is tricky--see the comment - # starting with "Passing at_groups is tricky.") - at_groups=`echo "$at_groups$as_nl $at_groups_all" | - awk 'BEGIN { FS = "@" } # Effectively switch off field splitting. - /^$/ { next } # Ignore the empty line. - !/ / { groups++; selected[$ 0] = 1; next } - # The last line, containing at_groups_all. - { - n = split($ 0, a, " ") - # If there are several tests, select their banners: - if (groups > 1) { - for (i = 1; i <= n; i++) { - if (a[i] ~ /^banner-/) - banner = a[i] - else if (banner != "" && selected[a[i]] == 1) - selected[banner] = 1 - } - } - for (i = 1; i <= n; i++) - if (selected[a[i]] == 1) - list = list " " a[i] - print list - }'` + if test -n "$at_recheck" && test -r "$at_suite_log"; then + at_oldfails=`sed -n ' + /^Failed tests:$/,/^Skipped tests:$/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^Unexpected passes:$/,/^## Detailed failed tests/{ + s/^[ ]*\([1-9][0-9]*\):.*/\1/p + } + /^## Detailed failed tests/q + ' "$at_suite_log"` + as_fn_append at_groups "$at_oldfails$as_nl" + fi + # Sort the tests, removing duplicates. + at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'` +fi + +if test x"$at_color" = xalways \ + || { test x"$at_color" = xauto && test -t 1; }; then + at_red=`printf '\033[0;31m'` + at_grn=`printf '\033[0;32m'` + at_lgn=`printf '\033[1;32m'` + at_blu=`printf '\033[1;34m'` + at_std=`printf '\033[m'` +else + at_red= at_grn= at_lgn= at_blu= at_std= fi # Help message. if $at_help_p; then - cat <<_ATEOF + cat <<_ATEOF || at_write_fail=1 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] Run all the tests, or the selected TESTS, given by numeric ranges, and save a detailed log file. Upon failure, create debugging scripts. -You should not change environment variables unless explicitly passed -as command line arguments. Set \`AUTOTEST_PATH' to select the executables +Do not change environment variables directly. Instead, set them via +command line arguments. Set \`AUTOTEST_PATH' to select the executables to exercise. Each relative directory is expanded as build and source -directories relatively to the top level of this distribution. E.g., +directories relative to the top level of this distribution. +E.g., from within the build directory /tmp/foo-1.0, invoking this: $ $0 AUTOTEST_PATH=bin -possibly amounts into +is equivalent to the following, assuming the source directory is /src/foo-1.0: - PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH + PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0 _ATEOF -cat <<_ATEOF +cat <<_ATEOF || at_write_fail=1 Operation modes: -h, --help print the help message, then exit @@ -903,95 +1051,290 @@ Operation modes: -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS _ATEOF -cat <<_ATEOF +cat <<_ATEOF || at_write_fail=1 Execution tuning: + -C, --directory=DIR + change to directory DIR before starting + --color[=never|auto|always] + enable colored test results on terminal, or always + -j, --jobs[=N] + Allow N jobs at once; infinite jobs with no arg (default 1) -k, --keywords=KEYWORDS - select the tests matching all the comma-separated KEYWORDS - multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD + select the tests matching all the comma-separated KEYWORDS + multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD + --recheck select all tests that failed or passed unexpectedly last time -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output - default for debugging scripts + default for debugging scripts -d, --debug inhibit clean up and top-level logging - default for debugging scripts + default for debugging scripts -x, --trace enable tests shell tracing _ATEOF -cat <<_ATEOF +cat <<_ATEOF || at_write_fail=1 Report bugs to . +General help using GNU software: . _ATEOF - exit 0 + exit $at_write_fail fi # List of tests. if $at_list_p; then - cat <<_ATEOF -GNU tar 1.21 test suite test groups: + cat <<_ATEOF || at_write_fail=1 +GNU tar 1.27.1 test suite test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF - # Passing at_groups is tricky. We cannot use it to form a literal string - # or regexp because of the limitation of AIX awk. And Solaris' awk - # doesn't grok more than 99 fields in a record, so we have to use `split'. - echo "$at_groups$as_nl$at_help_all" | - awk 'BEGIN { FS = ";" } - NR == 1 { - for (n = split($ 0, a, " "); n; n--) selected[a[n]] = 1 + # Pass an empty line as separator between selected groups and help. + $as_echo "$at_groups$as_nl$as_nl$at_help_all" | + awk 'NF == 1 && FS != ";" { + selected[$ 1] = 1 next } - { + /^$/ { FS = ";" } + NF > 0 { if (selected[$ 1]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 - if ($ 4) printf " %s\n", $ 4 + if ($ 4) { + lmax = 79 + indent = " " + line = indent + len = length (line) + n = split ($ 4, a, " ") + for (i = 1; i <= n; i++) { + l = length (a[i]) + 1 + if (i > 1 && len + l > lmax) { + print line + line = indent " " a[i] + len = length (line) + } else { + line = line " " a[i] + len += l + } + } + if (n) + print line + } } - }' - exit 0 + }' || at_write_fail=1 + exit $at_write_fail fi if $at_version_p; then - echo "$as_me (GNU tar 1.21)" - cat <<\_ACEOF + $as_echo "$as_me (GNU tar 1.27.1)" && + cat <<\_ATEOF || at_write_fail=1 -Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software -Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 +_ATEOF + exit $at_write_fail +fi + +# Should we print banners? Yes if more than one test is run. +case $at_groups in #( + *$as_nl* ) + at_print_banners=: ;; #( + * ) at_print_banners=false ;; +esac +# Text for banner N, set to a single space once printed. +# Banner 1. testsuite.at:191 +# Category starts at test group 5. +at_banner_text_1="Option compatibility" +# Banner 2. testsuite.at:199 +# Category starts at test group 11. +at_banner_text_2="The -T option" +# Banner 3. testsuite.at:209 +# Category starts at test group 19. +at_banner_text_3="Various options" +# Banner 4. testsuite.at:216 +# Category starts at test group 24. +at_banner_text_4="The --same-order option" +# Banner 5. testsuite.at:220 +# Category starts at test group 26. +at_banner_text_5="Append" +# Banner 6. testsuite.at:227 +# Category starts at test group 31. +at_banner_text_6="Transforms" +# Banner 7. testsuite.at:231 +# Category starts at test group 33. +at_banner_text_7="Exclude" +# Banner 8. testsuite.at:250 +# Category starts at test group 50. +at_banner_text_8="Deletions" +# Banner 9. testsuite.at:257 +# Category starts at test group 55. +at_banner_text_9="Extracting" +# Banner 10. testsuite.at:279 +# Category starts at test group 75. +at_banner_text_10="Volume label operations" +# Banner 11. testsuite.at:286 +# Category starts at test group 80. +at_banner_text_11="Incremental archives" +# Banner 12. testsuite.at:303 +# Category starts at test group 95. +at_banner_text_12="Files removed while archiving" +# Banner 13. testsuite.at:307 +# Category starts at test group 97. +at_banner_text_13="Renames" +# Banner 14. testsuite.at:315 +# Category starts at test group 103. +at_banner_text_14="Ignore failing reads" +# Banner 15. testsuite.at:318 +# Category starts at test group 104. +at_banner_text_15="Link handling" +# Banner 16. testsuite.at:324 +# Category starts at test group 108. +at_banner_text_16="Specific archive formats" +# Banner 17. testsuite.at:334 +# Category starts at test group 115. +at_banner_text_17="Multivolume archives" +# Banner 18. testsuite.at:344 +# Category starts at test group 123. +at_banner_text_18="Owner and Groups" +# Banner 19. testsuite.at:347 +# Category starts at test group 124. +at_banner_text_19="Sparse files" +# Banner 20. testsuite.at:357 +# Category starts at test group 132. +at_banner_text_20="Updates" +# Banner 21. testsuite.at:362 +# Category starts at test group 135. +at_banner_text_21="Verifying the archive" +# Banner 22. testsuite.at:365 +# Category starts at test group 136. +at_banner_text_22="Volume operations" +# Banner 23. testsuite.at:369 +# Category starts at test group 138. +at_banner_text_23="" +# Banner 24. testsuite.at:378 +# Category starts at test group 144. +at_banner_text_24="Removing files after archiving" +# Banner 25. testsuite.at:401 +# Category starts at test group 165. +at_banner_text_25="Extended attributes" +# Banner 26. testsuite.at:416 +# Category starts at test group 175. +at_banner_text_26="Star tests" + +# Take any -C into account. +if $at_change_dir ; then + test x != "x$at_dir" && cd "$at_dir" \ + || as_fn_error $? "unable to change directory" + at_dir=`pwd` +fi + +# Load the config files for any default variable assignments. +for at_file in atconfig atlocal +do + test -r $at_file || continue + . ./$at_file || as_fn_error $? "invalid content: $at_file" +done + +# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: +: "${at_top_build_prefix=$at_top_builddir}" + +# Perform any assignments requested during argument parsing. +eval "$at_debug_args" + +# atconfig delivers names relative to the directory the test suite is +# in, but the groups themselves are run in testsuite-dir/group-dir. +if test -n "$at_top_srcdir"; then + builddir=../.. + for at_dir_var in srcdir top_srcdir top_build_prefix + do + eval at_val=\$at_$at_dir_var + case $at_val in + [\\/$]* | ?:[\\/]* ) at_prefix= ;; + *) at_prefix=../../ ;; + esac + eval "$at_dir_var=\$at_prefix\$at_val" + done +fi + +## -------------------- ## +## Directory structure. ## +## -------------------- ## + +# This is the set of directories and files used by this script +# (non-literals are capitalized): +# +# TESTSUITE - the testsuite +# TESTSUITE.log - summarizes the complete testsuite run +# TESTSUITE.dir/ - created during a run, remains after -d or failed test +# + at-groups/ - during a run: status of all groups in run +# | + NNN/ - during a run: meta-data about test group NNN +# | | + check-line - location (source file and line) of current AT_CHECK +# | | + status - exit status of current AT_CHECK +# | | + stdout - stdout of current AT_CHECK +# | | + stder1 - stderr, including trace +# | | + stderr - stderr, with trace filtered out +# | | + test-source - portion of testsuite that defines group +# | | + times - timestamps for computing duration +# | | + pass - created if group passed +# | | + xpass - created if group xpassed +# | | + fail - created if group failed +# | | + xfail - created if group xfailed +# | | + skip - created if group skipped +# + at-stop - during a run: end the run if this file exists +# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction +# + 0..NNN/ - created for each group NNN, remains after -d or failed test +# | + TESTSUITE.log - summarizes the group results +# | + ... - files created during the group + +# The directory the whole suite works in. +# Should be absolute to let the user `cd' at will. +at_suite_dir=$at_dir/$as_me.dir +# The file containing the suite ($at_dir might have changed since earlier). +at_suite_log=$at_dir/$as_me.log +# The directory containing helper files per test group. +at_helper_dir=$at_suite_dir/at-groups +# Stop file: if it exists, do not start new jobs. +at_stop_file=$at_suite_dir/at-stop +# The fifo used for the job dispatcher. +at_job_fifo=$at_suite_dir/at-job-fifo + +if $at_clean; then + test -d "$at_suite_dir" && + find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; + rm -f -r "$at_suite_dir" "$at_suite_log" + exit $? fi # Don't take risks: use only absolute directories in PATH. # -# For stand-alone test suites, AUTOTEST_PATH is relative to `.'. +# For stand-alone test suites (ie. atconfig was not found), +# AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. -AUTOTEST_PATH=`echo $AUTOTEST_PATH | sed "s&:&$PATH_SEPARATOR&g"` +AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -n "$at_path" && at_path=$at_path$PATH_SEPARATOR + test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR case $as_dir in [\\/]* | ?:[\\/]* ) - at_path=$at_path$as_dir + as_fn_append at_path "$as_dir" ;; * ) if test -z "$at_top_build_prefix"; then # Stand-alone test suite. - at_path=$at_path$as_dir + as_fn_append at_path "$as_dir" else # Embedded test suite. - at_path=$at_path$at_top_build_prefix$as_dir$PATH_SEPARATOR - at_path=$at_path$at_top_srcdir/$as_dir + as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR" + as_fn_append at_path "$at_top_srcdir/$as_dir" fi ;; esac -done + done IFS=$as_save_IFS @@ -999,31 +1342,33 @@ IFS=$as_save_IFS # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. -PATH= +at_new_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` -test -d "$as_dir" || continue -case $PATH in - $as_dir | \ - $as_dir$PATH_SEPARATOR* | \ - *$PATH_SEPARATOR$as_dir | \ - *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; - - '') PATH=$as_dir ;; - *) PATH=$PATH$PATH_SEPARATOR$as_dir ;; + test -d "$as_dir" || continue +case $as_dir in + [\\/]* | ?:[\\/]* ) ;; + * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;; esac -done +case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in + *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;; + $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;; + *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;; +esac + done IFS=$as_save_IFS +PATH=$at_new_path export PATH # Setting up the FDs. -# 5 is the log file. Not to be overwritten if `-d'. + + +# 5 is the log file. Not to be overwritten if `-d'. if $at_debug_p; then at_suite_log=/dev/null else @@ -1032,42 +1377,31 @@ fi exec 5>>"$at_suite_log" # Banners and logs. -cat <<\_ASBOX -## ------------------------ ## -## GNU tar 1.21 test suite. ## -## ------------------------ ## -_ASBOX +$as_echo "## -------------------------- ## +## GNU tar 1.27.1 test suite. ## +## -------------------------- ##" { - cat <<\_ASBOX -## ------------------------ ## -## GNU tar 1.21 test suite. ## -## ------------------------ ## -_ASBOX + $as_echo "## -------------------------- ## +## GNU tar 1.27.1 test suite. ## +## -------------------------- ##" echo - echo "$as_me: command line was:" - echo " $ $0 $at_cli_args" + $as_echo "$as_me: command line was:" + $as_echo " \$ $0 $at_cli_args" echo - # Try to find a few ChangeLogs in case it might help determining the - # exact version. Use the relative dir: if the top dir is a symlink, - # find will not follow it (and options to follow the links are not - # portable), which would result in no output here. - if test -n "$at_top_srcdir"; then - cat <<\_ASBOX -## ----------- ## -## ChangeLogs. ## -## ----------- ## -_ASBOX + # If ChangeLog exists, list a few lines in case it might help determining + # the exact version. + if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then + $as_echo "## ---------- ## +## ChangeLog. ## +## ---------- ##" echo - for at_file in `find "$at_top_srcdir" -name ChangeLog -print` - do - echo "$as_me: $at_file:" - sed 's/^/| /;10q' $at_file - echo - done + sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" + echo + fi - { + { cat <<_ASUNAME ## --------- ## ## Platform. ## @@ -1097,28 +1431,179 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS } - echo - fi + echo # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue - echo "$as_me: $at_file:" + $as_echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done +} >&5 + + +## ------------------------- ## +## Autotest shell functions. ## +## ------------------------- ## + +# at_fn_banner NUMBER +# ------------------- +# Output banner NUMBER, provided the testsuite is running multiple groups and +# this particular banner has not yet been printed. +at_fn_banner () +{ + $at_print_banners || return 0 + eval at_banner_text=\$at_banner_text_$1 + test "x$at_banner_text" = "x " && return 0 + eval "at_banner_text_$1=\" \"" + if test -z "$at_banner_text"; then + $at_first || echo + else + $as_echo "$as_nl$at_banner_text$as_nl" + fi +} # at_fn_banner + +# at_fn_check_prepare_notrace REASON LINE +# --------------------------------------- +# Perform AT_CHECK preparations for the command at LINE for an untraceable +# command; REASON is the reason for disabling tracing. +at_fn_check_prepare_notrace () +{ + $at_trace_echo "Not enabling shell tracing (command contains $1)" + $as_echo "$2" >"$at_check_line_file" + at_check_trace=: at_check_filter=: + : >"$at_stdout"; : >"$at_stderr" +} + +# at_fn_check_prepare_trace LINE +# ------------------------------ +# Perform AT_CHECK preparations for the command at LINE for a traceable +# command. +at_fn_check_prepare_trace () +{ + $as_echo "$1" >"$at_check_line_file" + at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace + : >"$at_stdout"; : >"$at_stderr" +} - cat <<\_ASBOX -## ---------------- ## +# at_fn_check_prepare_dynamic COMMAND LINE +# ---------------------------------------- +# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate +# preparation function. +at_fn_check_prepare_dynamic () +{ + case $1 in + *$as_nl*) + at_fn_check_prepare_notrace 'an embedded newline' "$2" ;; + *) + at_fn_check_prepare_trace "$2" ;; + esac +} + +# at_fn_filter_trace +# ------------------ +# Remove the lines in the file "$at_stderr" generated by "set -x" and print +# them to stderr. +at_fn_filter_trace () +{ + mv "$at_stderr" "$at_stder1" + grep '^ *+' "$at_stder1" >&2 + grep -v '^ *+' "$at_stder1" >"$at_stderr" +} + +# at_fn_log_failure FILE-LIST +# --------------------------- +# Copy the files in the list on stdout with a "> " prefix, and exit the shell +# with a failure exit code. +at_fn_log_failure () +{ + for file + do $as_echo "$file:"; sed 's/^/> /' "$file"; done + echo 1 > "$at_status_file" + exit 1 +} + +# at_fn_check_skip EXIT-CODE LINE +# ------------------------------- +# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit +# the test group subshell with that same exit code. Use LINE in any report +# about test failure. +at_fn_check_skip () +{ + case $1 in + 99) echo 99 > "$at_status_file"; at_failed=: + $as_echo "$2: hard failure"; exit 99;; + 77) echo 77 > "$at_status_file"; exit 77;; + esac +} + +# at_fn_check_status EXPECTED EXIT-CODE LINE +# ------------------------------------------ +# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing. +# Otherwise, if it is 77 or 99, exit the test group subshell with that same +# exit code; if it is anything else print an error message referring to LINE, +# and fail the test. +at_fn_check_status () +{ + case $2 in + $1 ) ;; + 77) echo 77 > "$at_status_file"; exit 77;; + 99) echo 99 > "$at_status_file"; at_failed=: + $as_echo "$3: hard failure"; exit 99;; + *) $as_echo "$3: exit code was $2, expected $1" + at_failed=:;; + esac +} + +# at_fn_diff_devnull FILE +# ----------------------- +# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff +# invocations. +at_fn_diff_devnull () +{ + test -s "$1" || return 0 + $at_diff "$at_devnull" "$1" +} + +# at_fn_test NUMBER +# ----------------- +# Parse out test NUMBER from the tail of this file. +at_fn_test () +{ + eval at_sed=\$at_sed$1 + sed "$at_sed" "$at_myself" > "$at_test_source" +} + +# at_fn_create_debugging_script +# ----------------------------- +# Create the debugging script $at_group_dir/run which will reproduce the +# current test group. +at_fn_create_debugging_script () +{ + { + echo "#! /bin/sh" && + echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' && + $as_echo "cd '$at_dir'" && + $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" && + echo 'exit 1' + } >"$at_group_dir/run" && + chmod +x "$at_group_dir/run" +} + +## -------------------------------- ## +## End of autotest shell functions. ## +## -------------------------------- ## +{ + $as_echo "## ---------------- ## ## Tested programs. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo } >&5 @@ -1126,52 +1611,44 @@ _ASBOX for at_program in : $at_tested do test "$at_program" = : && continue - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $at_program in + [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;; + * ) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -f "$as_dir/$at_program" && break -done + test -f "$as_dir/$at_program" && break + done IFS=$as_save_IFS - if test -f "$as_dir/$at_program"; then + at_program_=$as_dir/$at_program ;; + esac + if test -f "$at_program_"; then { - echo "$at_srcdir/testsuite.at:92: $as_dir/$at_program --version" - "$as_dir/$at_program" --version + $as_echo "$at_srcdir/testsuite.at:180: $at_program_ --version" + "$at_program_" --version &5 2>&1 else - { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5 -echo "$as_me: error: cannot find $at_program" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find $at_program" "$LINENO" 5 fi done { - cat <<\_ASBOX -## ------------------ ## + $as_echo "## ------------------ ## ## Running the tests. ## -## ------------------ ## -_ASBOX +## ------------------ ##" } >&5 at_start_date=`date` at_start_time=`date +%s 2>/dev/null` -echo "$as_me: starting at: $at_start_date" >&5 -at_xpass_list= -at_xfail_list= -at_pass_list= -at_fail_list= -at_skip_list= -at_group_count=0 +$as_echo "$as_me: starting at: $at_start_date" >&5 # Create the master directory if it doesn't already exist. -test -d "$at_suite_dir" || - mkdir "$at_suite_dir" || - { { echo "$as_me:$LINENO: error: cannot create '$at_suite_dir'" >&5 -echo "$as_me: error: cannot create '$at_suite_dir'" >&2;} - { (exit 1); exit 1; }; } +as_dir="$at_suite_dir"; as_fn_mkdir_p || + as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5 # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then @@ -1189,235 +1666,661 @@ else at_diff=diff fi +# Get the last needed group. +for at_group in : $at_groups; do :; done + +# Extract the start and end lines of each test group at the tail +# of this file +awk ' +BEGIN { FS="" } +/^#AT_START_/ { + start = NR +} +/^#AT_STOP_/ { + test = substr ($ 0, 10) + print "at_sed" test "=\"1," start "d;" (NR-1) "q\"" + if (test == "'"$at_group"'") exit +}' "$at_myself" > "$at_suite_dir/at-source-lines" && +. "$at_suite_dir/at-source-lines" || + as_fn_error $? "cannot create test line number cache" "$LINENO" 5 +rm -f "$at_suite_dir/at-source-lines" + +# Set number of jobs for `-j'; avoid more jobs than test groups. +set X $at_groups; shift; at_max_jobs=$# +if test $at_max_jobs -eq 0; then + at_jobs=1 +fi +if test $at_jobs -ne 1 && + { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then + at_jobs=$at_max_jobs +fi + +# If parallel mode, don't output banners, don't split summary lines. +if test $at_jobs -ne 1; then + at_print_banners=false + at_quiet=: +fi + +# Set up helper dirs. +rm -rf "$at_helper_dir" && +mkdir "$at_helper_dir" && +cd "$at_helper_dir" && +{ test -z "$at_groups" || mkdir $at_groups; } || +as_fn_error $? "testsuite directory setup failed" "$LINENO" 5 + +# Functions for running a test group. We leave the actual +# test group execution outside of a shell function in order +# to avoid hitting zsh 4.x exit status bugs. + +# at_fn_group_prepare +# ------------------- +# Prepare for running a test group. +at_fn_group_prepare () +{ + # The directory for additional per-group helper files. + at_job_dir=$at_helper_dir/$at_group + # The file containing the location of the last AT_CHECK. + at_check_line_file=$at_job_dir/check-line + # The file containing the exit status of the last command. + at_status_file=$at_job_dir/status + # The files containing the output of the tested commands. + at_stdout=$at_job_dir/stdout + at_stder1=$at_job_dir/stder1 + at_stderr=$at_job_dir/stderr + # The file containing the code for a test group. + at_test_source=$at_job_dir/test-source + # The file containing dates. + at_times_file=$at_job_dir/times -for at_group in $at_groups -do # Be sure to come back to the top test directory. cd "$at_suite_dir" - case $at_group in - banner-*) - at_group_log=$at_suite_log - ;; + # Clearly separate the test groups when verbose. + $at_first || $at_verbose echo - *) - at_group_normalized=$at_group + at_group_normalized=$at_group - while :; do + eval 'while :; do case $at_group_normalized in #( - $at_format*) break;; + '"$at_format"'*) break;; esac at_group_normalized=0$at_group_normalized - done - - - # Create a fresh directory for the next test group, and enter. - at_group_dir=$at_suite_dir/$at_group_normalized - at_group_log=$at_group_dir/$as_me.log - if test -d "$at_group_dir"; then - find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; - rm -fr "$at_group_dir" - fi - # Be tolerant if the above `rm' was not able to remove the directory. - { as_dir=$at_group_dir - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - cd $at_group_dir - ;; - esac + done' + + + # Create a fresh directory for the next test group, and enter. + # If one already exists, the user may have invoked ./run from + # within that directory; we remove the contents, but not the + # directory itself, so that we aren't pulling the rug out from + # under the shell's notion of the current directory. + at_group_dir=$at_suite_dir/$at_group_normalized + at_group_log=$at_group_dir/$as_me.log + if test -d "$at_group_dir"; then + find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; + rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* +fi || + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 +$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} + # Be tolerant if the above `rm' was not able to remove the directory. + as_dir="$at_group_dir"; as_fn_mkdir_p echo 0 > "$at_status_file" - # Clearly separate the test groups when verbose. - test $at_group_count != 0 && $at_verbose - # In verbose mode, append to the log file *and* show on - # the standard output; in quiet mode only write to the log - if test $at_verbose = echo; then + # the standard output; in quiet mode only write to the log. + if test -z "$at_verbose"; then at_tee_pipe='tee -a "$at_group_log"' else at_tee_pipe='cat >> "$at_group_log"' fi +} - case $at_group in - 1 ) # 1. version.at:19: tar version - at_setup_line='version.at:19' - at_desc="tar version" - $at_quiet $ECHO_N " 1: tar version $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "1. version.at:19: testing ..." - $at_traceon +# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER] +# ------------------------------------------------- +# Declare the test group ORDINAL, located at LINE with group description DESC, +# and residing under BANNER. Use PAD to align the status column. +at_fn_group_banner () +{ + at_setup_line="$2" + test -n "$5" && at_fn_banner $5 + at_desc="$3" + case $1 in + [0-9]) at_desc_line=" $1: ";; + [0-9][0-9]) at_desc_line=" $1: " ;; + *) at_desc_line="$1: " ;; + esac + as_fn_append at_desc_line "$3$4" + $at_quiet $as_echo_n "$at_desc_line" + echo "# -*- compilation -*-" >> "$at_group_log" +} + +# at_fn_group_postprocess +# ----------------------- +# Perform cleanup after running a test group. +at_fn_group_postprocess () +{ + # Be sure to come back to the suite directory, in particular + # since below we might `rm' the group directory we are in currently. + cd "$at_suite_dir" + + if test ! -f "$at_check_line_file"; then + sed "s/^ */$as_me: WARNING: /" <<_ATEOF + A failure happened in a test group before any test could be + run. This means that test suite is improperly designed. Please + report this failure to . +_ATEOF + $as_echo "$at_setup_line" >"$at_check_line_file" + at_status=99 + fi + $at_verbose $as_echo_n "$at_group. $at_setup_line: " + $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log" + case $at_xfail:$at_status in + yes:0) + at_msg="UNEXPECTED PASS" + at_res=xpass + at_errexit=$at_errexit_p + at_color=$at_red + ;; + no:0) + at_msg="ok" + at_res=pass + at_errexit=false + at_color=$at_grn + ;; + *:77) + at_msg='skipped ('`cat "$at_check_line_file"`')' + at_res=skip + at_errexit=false + at_color=$at_blu + ;; + no:* | *:99) + at_msg='FAILED ('`cat "$at_check_line_file"`')' + at_res=fail + at_errexit=$at_errexit_p + at_color=$at_red + ;; + yes:*) + at_msg='expected failure ('`cat "$at_check_line_file"`')' + at_res=xfail + at_errexit=false + at_color=$at_lgn + ;; + esac + echo "$at_res" > "$at_job_dir/$at_res" + # In parallel mode, output the summary line only afterwards. + if test $at_jobs -ne 1 && test -n "$at_verbose"; then + $as_echo "$at_desc_line $at_color$at_msg$at_std" + else + # Make sure there is a separator even with long titles. + $as_echo " $at_color$at_msg$at_std" + fi + at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" + case $at_status in + 0|77) + # $at_times_file is only available if the group succeeded. + # We're not including the group log, so the success message + # is written in the global log separately. But we also + # write to the group log in case they're using -d. + if test -f "$at_times_file"; then + at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')' + rm -f "$at_times_file" + fi + $as_echo "$at_log_msg" >> "$at_group_log" + $as_echo "$at_log_msg" >&5 + + # Cleanup the group directory, unless the user wants the files + # or the success was unexpected. + if $at_debug_p || test $at_res = xpass; then + at_fn_create_debugging_script + if test $at_res = xpass && $at_errexit; then + echo stop > "$at_stop_file" + fi + else + if test -d "$at_group_dir"; then + find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; + rm -fr "$at_group_dir" + fi + rm -f "$at_test_source" + fi + ;; + *) + # Upon failure, include the log into the testsuite's global + # log. The failure message is written in the group log. It + # is later included in the global log. + $as_echo "$at_log_msg" >> "$at_group_log" + + # Upon failure, keep the group directory for autopsy, and create + # the debugging script. With -e, do not start any further tests. + at_fn_create_debugging_script + if $at_errexit; then + echo stop > "$at_stop_file" + fi + ;; + esac +} -$at_traceoff -echo "$at_srcdir/version.at:21: tar --version | sed 1q" -echo version.at:21 >"$at_check_line_file" +## ------------ ## +## Driver loop. ## +## ------------ ## -at_trace_this= -if test -n "$at_traceon"; then - at_trace_this=yes -fi -if test -n "$at_trace_this"; then - ( $at_traceon; tar --version | sed 1q ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" +if (set -m && set +m && set +b) >/dev/null 2>&1; then + set +b + at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=- else - ( :; tar --version | sed 1q ) >"$at_stdout" 2>"$at_stderr" - at_status=$? + at_job_control_on=: at_job_control_off=: at_job_group= fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "tar (GNU tar) 1.21 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/version.at:21: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - cat >$XFAILFILE <<'_EOT' +for at_signal in 1 2 15; do + trap 'set +x; set +e + $at_job_control_off + at_signal='"$at_signal"' + echo stop > "$at_stop_file" + trap "" $at_signal + at_pgids= + for at_pgid in `jobs -p 2>/dev/null`; do + at_pgids="$at_pgids $at_job_group$at_pgid" + done + test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null + wait + if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then + echo >&2 + fi + at_signame=`kill -l $at_signal 2>&1 || echo $at_signal` + set x $at_signame + test 0 -gt 2 && at_signame=$at_signal + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5 +$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;} + as_fn_arith 128 + $at_signal && exit_status=$as_val + as_fn_exit $exit_status' $at_signal +done -============================================================== -WARNING: Not using the proper version, *all* checks dubious... -============================================================== -_EOT +rm -f "$at_stop_file" +at_first=: +if test $at_jobs -ne 1 && + rm -f "$at_job_fifo" && + test -n "$at_job_group" && + ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null +then + # FIFO job dispatcher. - echo 1 > "$at_status_file" - exit 1 -else - rm -f $XFAILFILE + trap 'at_pids= + for at_pid in `jobs -p`; do + at_pids="$at_pids $at_job_group$at_pid" + done + if test -n "$at_pids"; then + at_sig=TSTP + test "${TMOUT+set}" = set && at_sig=STOP + kill -$at_sig $at_pids 2>/dev/null + fi + kill -STOP $$ + test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP + + echo + # Turn jobs into a list of numbers, starting from 1. + at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` + + set X $at_joblist + shift + for at_group in $at_groups; do + $at_job_control_on 2>/dev/null + ( + # Start one test group. + $at_job_control_off + if $at_first; then + exec 7>"$at_job_fifo" + else + exec 6<&- + fi + trap 'set +x; set +e + trap "" PIPE + echo stop > "$at_stop_file" + echo >&7 + as_fn_exit 141' PIPE + at_fn_group_prepare + if cd "$at_group_dir" && + at_fn_test $at_group && + . "$at_test_source" + then :; else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 +$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} + at_failed=: + fi + at_fn_group_postprocess + echo >&7 + ) & + $at_job_control_off + if $at_first; then + at_first=false + exec 6<"$at_job_fifo" 7>"$at_job_fifo" + fi + shift # Consume one token. + if test $# -gt 0; then :; else + read at_token <&6 || break + set x $* + fi + test -f "$at_stop_file" && break + done + exec 7>&- + # Read back the remaining ($at_jobs - 1) tokens. + set X $at_joblist + shift + if test $# -gt 0; then + shift + for at_job + do + read at_token + done <&6 + fi + exec 6<&- + wait +else + # Run serially, avoid forks and other potential surprises. + for at_group in $at_groups; do + at_fn_group_prepare + if cd "$at_group_dir" && + at_fn_test $at_group && + . "$at_test_source"; then :; else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 +$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} + at_failed=: + fi + at_fn_group_postprocess + test -f "$at_stop_file" && break + at_first=false + done fi -$at_traceon +# Wrap up the test suite with summary statistics. +cd "$at_helper_dir" + +# Use ?..???? when the list must remain sorted, the faster * otherwise. +at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'` +at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'` +at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'` +at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do + echo $f; done | sed '/?/d; s,/xpass,,'` +at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do + echo $f; done | sed '/?/d; s,/fail,,'` + +set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list +shift; at_group_count=$# +set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$* +set X $at_xfail_list; shift; at_xfail_count=$# +set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$* +set X $at_skip_list; shift; at_skip_count=$# + +as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val +as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val +as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val +# Back to the top directory. +cd "$at_dir" +rm -rf "$at_helper_dir" - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` +# Compute the duration of the suite. +at_stop_date=`date` +at_stop_time=`date +%s 2>/dev/null` +$as_echo "$as_me: ending at: $at_stop_date" >&5 +case $at_start_time,$at_stop_time in + [0-9]*,[0-9]*) + as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val + as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val + as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val + as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val + as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val + at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" + $as_echo "$as_me: test suite duration: $at_duration" >&5 ;; +esac - 2 ) # 2. pipe.at:29: decompressing from stdin - at_setup_line='pipe.at:29' - at_desc="decompressing from stdin" - $at_quiet $ECHO_N " 2: decompressing from stdin $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "2. pipe.at:29: testing ..." - $at_traceon +echo +$as_echo "## ------------- ## +## Test results. ## +## ------------- ##" +echo +{ + echo + $as_echo "## ------------- ## +## Test results. ## +## ------------- ##" + echo +} >&5 +if test $at_run_count = 1; then + at_result="1 test" + at_were=was +else + at_result="$at_run_count tests" + at_were=were +fi +if $at_errexit_p && test $at_unexpected_count != 0; then + if test $at_xpass_count = 1; then + at_result="$at_result $at_were run, one passed" + else + at_result="$at_result $at_were run, one failed" + fi + at_result="$at_result unexpectedly and inhibited subsequent tests." + at_color=$at_red +else + # Don't you just love exponential explosion of the number of cases? + at_color=$at_red + case $at_xpass_count:$at_fail_count:$at_xfail_count in + # So far, so good. + 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;; + 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;; + # Some unexpected failures + 0:*:0) at_result="$at_result $at_were run, +$at_fail_count failed unexpectedly." ;; + # Some failures, both expected and unexpected + 0:*:1) at_result="$at_result $at_were run, +$at_total_fail_count failed ($at_xfail_count expected failure)." ;; + 0:*:*) at_result="$at_result $at_were run, +$at_total_fail_count failed ($at_xfail_count expected failures)." ;; + # No unexpected failures, but some xpasses + *:0:*) at_result="$at_result $at_were run, +$at_xpass_count passed unexpectedly." ;; + # No expected failures, but failures and xpasses + *:1:0) at_result="$at_result $at_were run, +$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; + *:*:0) at_result="$at_result $at_were run, +$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; - $at_traceoff -echo "$at_srcdir/pipe.at:33: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" -export TAR_OPTIONS -rm -rf * + # All of them. + *:*:1) at_result="$at_result $at_were run, +$at_xpass_count passed unexpectedly, +$at_total_fail_count failed ($at_xfail_count expected failure)." ;; + *:*:*) at_result="$at_result $at_were run, +$at_xpass_count passed unexpectedly, +$at_total_fail_count failed ($at_xfail_count expected failures)." ;; + esac + if test $at_skip_count = 0 && test $at_run_count -gt 1; then + at_result="All $at_result" + fi +fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +# Now put skips in the mix. +case $at_skip_count in + 0) ;; + 1) at_result="$at_result +1 test was skipped." ;; + *) at_result="$at_result +$at_skip_count tests were skipped." ;; +esac +if test $at_unexpected_count = 0; then + echo "$at_color$at_result$at_std" + echo "$at_result" >&5 +else + echo "${at_color}ERROR: $at_result$at_std" >&2 + echo "ERROR: $at_result" >&5 + { + echo + $as_echo "## ------------------------ ## +## Summary of the failures. ## +## ------------------------ ##" -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory|sort -mv directory orig -cat archive | tar xfv - | sort -echo \"separator\" -cmp orig/file1 directory/file1 -echo \"separator\" -cmp orig/file2 directory/file2)" -echo pipe.at:33 >"$at_check_line_file" + # Summary of failed and skipped tests. + if test $at_fail_count != 0; then + echo "Failed tests:" + $SHELL "$at_myself" $at_fail_list --list + echo + fi + if test $at_skip_count != 0; then + echo "Skipped tests:" + $SHELL "$at_myself" $at_skip_list --list + echo + fi + if test $at_xpass_count != 0; then + echo "Unexpected passes:" + $SHELL "$at_myself" $at_xpass_list --list + echo + fi + if test $at_fail_count != 0; then + $as_echo "## ---------------------- ## +## Detailed failed tests. ## +## ---------------------- ##" + echo + for at_group in $at_fail_list + do + at_group_normalized=$at_group + + eval 'while :; do + case $at_group_normalized in #( + '"$at_format"'*) break;; + esac + at_group_normalized=0$at_group_normalized + done' + + cat "$at_suite_dir/$at_group_normalized/$as_me.log" + echo + done + echo + fi + if test -n "$at_top_srcdir"; then + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## ${at_top_build_prefix}config.log ## +_ASBOX + sed 's/^/| /' ${at_top_build_prefix}config.log + echo + fi + } >&5 + + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## $as_me.log was created. ## +_ASBOX -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' + echo + if $at_debug_p; then + at_msg='per-test log files' + else + at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'" + fi + $as_echo "Please send $at_msg and all information you think might help: + + To: + Subject: [GNU tar 1.27.1] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} + +You may investigate any problem if you feel able to do so, in which +case the test suite provides a good starting point. Its output may +be found below \`${at_testdir+${at_testdir}/}$as_me.dir'. +" + exit 1 +fi + +exit 0 + +## ------------- ## +## Actual tests. ## +## ------------- ## +#AT_START_1 +at_fn_group_banner 1 'version.at:19' \ + "tar version" " " +at_xfail=no +( + $as_echo "1. $at_setup_line: testing $at_desc ..." + $at_traceon + + +{ set +x +$as_echo "$at_srcdir/version.at:21: tar --version | sed 1q" +at_fn_check_prepare_notrace 'a shell pipeline' "version.at:21" +( $at_check_trace; tar --version | sed 1q +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "tar (GNU tar) 1.27.1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/version.at:21" +if $at_failed; then : + cat >$XFAILFILE <<'_EOT' + +============================================================== +WARNING: Not using the proper version, *all* checks dubious... +============================================================== +_EOT + +else + rm -f $XFAILFILE fi +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_1 +#AT_START_2 +at_fn_group_banner 2 'pipe.at:29' \ + "decompressing from stdin" " " +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "2. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + -if test -n "$at_trace_this"; then - ( $at_traceon; + { set +x +$as_echo "$at_srcdir/pipe.at:33: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort -echo "separator" +cat archive | tar xfv - --warning=no-timestamp | sort +echo \"separator\" cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo \"separator\" +cmp orig/file2 directory/file2)" +at_fn_check_prepare_notrace 'a `...` command substitution' "pipe.at:33" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -1433,40 +2336,30 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo "separator" cmp orig/file1 directory/file1 echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ +cmp orig/file2 directory/file2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ directory/file1 directory/file2 separator separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/pipe.at:33: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/pipe.at:33: +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/pipe.at:33" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/pipe.at:33: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -1476,55 +2369,21 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo \"separator\" cmp orig/file1 directory/file1 echo \"separator\" cmp orig/file2 directory/file2)" -echo pipe.at:33 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory|sort -mv directory orig -cat archive | tar xfv - | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'a `...` command substitution' "pipe.at:33" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -1540,40 +2399,30 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo "separator" cmp orig/file1 directory/file1 echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ +cmp orig/file2 directory/file2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ directory/file1 directory/file2 separator separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/pipe.at:33: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/pipe.at:33: +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/pipe.at:33" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/pipe.at:33: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -1583,28 +2432,21 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo \"separator\" cmp orig/file1 directory/file1 echo \"separator\" cmp orig/file2 directory/file2)" -echo pipe.at:33 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "pipe.at:33" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -1620,67 +2462,30 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo "separator" cmp orig/file1 directory/file1 echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory|sort -mv directory orig -cat archive | tar xfv - | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ +cmp orig/file2 directory/file2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ directory/file1 directory/file2 separator separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/pipe.at:33: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/pipe.at:33: +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/pipe.at:33" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/pipe.at:33: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -1690,55 +2495,21 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo \"separator\" cmp orig/file1 directory/file1 echo \"separator\" cmp orig/file2 directory/file2)" -echo pipe.at:33 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory|sort -mv directory orig -cat archive | tar xfv - | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'a `...` command substitution' "pipe.at:33" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -1754,40 +2525,30 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo "separator" cmp orig/file1 directory/file1 echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ +cmp orig/file2 directory/file2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ directory/file1 directory/file2 separator separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/pipe.at:33: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/pipe.at:33: +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/pipe.at:33" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/pipe.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -1797,55 +2558,21 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo \"separator\" cmp orig/file1 directory/file1 echo \"separator\" cmp orig/file2 directory/file2)" -echo pipe.at:33 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory|sort -mv directory orig -cat archive | tar xfv - | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'a `...` command substitution' "pipe.at:33" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -1861,333 +2588,407 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkdir directory genfile --length 10240 --pattern zeros --file directory/file1 genfile --length 13 --file directory/file2 -tar cf archive directory|sort +tar cf archive directory mv directory orig -cat archive | tar xfv - | sort +cat archive | tar xfv - --warning=no-timestamp | sort echo "separator" cmp orig/file1 directory/file1 echo "separator" -cmp orig/file2 directory/file2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ +cmp orig/file2 directory/file2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ directory/file1 directory/file2 separator separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/pipe.at:33: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/pipe.at:33" +$at_failed && at_fn_log_failure +$at_traceon; } - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 3 ) # 3. options.at:24: mixing options - at_setup_line='options.at:24' - at_desc="mixing options" - $at_quiet $ECHO_N " 3: mixing options $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "3. options.at:24: testing ..." - $at_traceon + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_2 +#AT_START_3 +at_fn_group_banner 3 'options.at:24' \ + "mixing options" " " +at_xfail=no +( + $as_echo "3. $at_setup_line: testing $at_desc ..." + $at_traceon -$at_traceoff -echo "$at_srcdir/options.at:27: +{ set +x +$as_echo "$at_srcdir/options.at:27: echo > file1 TAR_OPTIONS=--numeric-owner tar chof archive file1 tar tf archive " -echo options.at:27 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -echo > file1 -TAR_OPTIONS=--numeric-owner tar chof archive file1 -tar tf archive - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "options.at:27" +( $at_check_trace; echo > file1 TAR_OPTIONS=--numeric-owner tar chof archive file1 tar tf archive - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/options.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 4 ) # 4. options02.at:26: interspersed options - at_setup_line='options02.at:26' - at_desc="interspersed options" - $at_quiet $ECHO_N " 4: interspersed options $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "4. options02.at:26: testing ..." - $at_traceon +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/options.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_3 +#AT_START_4 +at_fn_group_banner 4 'options02.at:26' \ + "interspersed options" " " +at_xfail=no +( + $as_echo "4. $at_setup_line: testing $at_desc ..." + $at_traceon -$at_traceoff -echo "$at_srcdir/options02.at:29: +{ set +x +$as_echo "$at_srcdir/options02.at:29: echo > file1 tar c file1 -f archive tar tf archive " -echo options02.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -echo > file1 -tar c file1 -f archive -tar tf archive - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "options02.at:29" +( $at_check_trace; echo > file1 tar c file1 -f archive tar tf archive - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/options02.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/options02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_4 +#AT_START_5 +at_fn_group_banner 5 'opcomp01.at:21' \ + "occurrence compatibility" " " 1 +at_xfail=no +( + $as_echo "5. $at_setup_line: testing $at_desc ..." + $at_traceon - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon +{ set +x +$as_echo "$at_srcdir/opcomp01.at:24: +tar --occurrence=1 -cf test.tar . +" +at_fn_check_prepare_notrace 'an embedded newline' "opcomp01.at:24" +( $at_check_trace; +tar --occurrence=1 -cf test.tar . + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: --occurrence cannot be used with -c +Try 'tar --help' or 'tar --usage' for more information. +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/opcomp01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_5 +#AT_START_6 +at_fn_group_banner 6 'opcomp02.at:21' \ + "occurrence compatibility" " " 1 +at_xfail=no +( + $as_echo "6. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 5 ) # 5. T-empty.at:26: files-from: empty entries - at_setup_line='T-empty.at:26' - at_desc="files-from: empty entries" - $at_quiet $ECHO_N " 5: files-from: empty entries $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "5. T-empty.at:26: testing ..." - $at_traceon +{ set +x +$as_echo "$at_srcdir/opcomp02.at:24: +tar --occurrence=1 -tf test.tar +" +at_fn_check_prepare_notrace 'an embedded newline' "opcomp02.at:24" +( $at_check_trace; +tar --occurrence=1 -tf test.tar + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: --occurrence is meaningless without a file list +Try 'tar --help' or 'tar --usage' for more information. +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/opcomp02.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_6 +#AT_START_7 +at_fn_group_banner 7 'opcomp03.at:21' \ + "--verify compatibility" " " 1 +at_xfail=no +( + $as_echo "7. $at_setup_line: testing $at_desc ..." + $at_traceon -cat >file-list <<'_ATEOF' -jeden -dwa +{ set +x +$as_echo "$at_srcdir/opcomp03.at:24: +tar -tWf test.tar . +" +at_fn_check_prepare_notrace 'an embedded newline' "opcomp03.at:24" +( $at_check_trace; +tar -tWf test.tar . + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: --verify cannot be used with -t +Try 'tar --help' or 'tar --usage' for more information. +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/opcomp03.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_7 +#AT_START_8 +at_fn_group_banner 8 'opcomp04.at:21' \ + "compress option compatibility" " " 1 +at_xfail=no +( + $as_echo "8. $at_setup_line: testing $at_desc ..." + $at_traceon -trzy -_ATEOF +{ set +x +$as_echo "$at_srcdir/opcomp04.at:24: +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - $at_traceoff -echo "$at_srcdir/T-empty.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" -export TAR_OPTIONS -rm -rf * +genfile --file file +tar czf test.tar file +genfile --file newfile +tar rzf test.tar newfile +" +at_fn_check_prepare_notrace 'an embedded newline' "opcomp04.at:24" +( $at_check_trace; +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 +genfile --file file +tar czf test.tar file +genfile --file newfile +tar rzf test.tar newfile + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: Cannot update compressed archives +Try 'tar --help' or 'tar --usage' for more information. +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/opcomp04.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_8 +#AT_START_9 +at_fn_group_banner 9 'opcomp05.at:21' \ + "--pax-option compatibility" " " 1 +at_xfail=no +( + $as_echo "9. $at_setup_line: testing $at_desc ..." + $at_traceon -genfile --file jeden -genfile --file dwa -genfile --file trzy -tar cfvT archive ../file-list | sort -)" -echo T-empty.at:36 >"$at_check_line_file" +{ set +x +$as_echo "$at_srcdir/opcomp05.at:24: +tar -Hgnu -cf test.tar --pax-option user:=root . +" +at_fn_check_prepare_notrace 'an embedded newline' "opcomp05.at:24" +( $at_check_trace; +tar -Hgnu -cf test.tar --pax-option user:=root . + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: --pax-option can be used only on POSIX archives +Try 'tar --help' or 'tar --usage' for more information. +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/opcomp05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_9 +#AT_START_10 +at_fn_group_banner 10 'opcomp06.at:21' \ + "--pax-option compatibility" " " 1 +at_xfail=no +( + $as_echo "10. $at_setup_line: testing $at_desc ..." + $at_traceon -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +{ set +x +$as_echo "$at_srcdir/opcomp06.at:24: -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) -genfile --file jeden -genfile --file dwa -genfile --file trzy + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar cfvT archive ../file-list | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -genfile --file jeden -genfile --file dwa -genfile --file trzy +genfile --file file +tar -cf test.tar --acls -Hgnu file +" +at_fn_check_prepare_notrace 'a $(...) command substitution' "opcomp06.at:24" +( $at_check_trace; -tar cfvT archive ../file-list | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "dwa -jeden -trzy -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/T-empty.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - # Testing one format is enough + rm -rf $file - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - 6 ) # 6. T-null.at:21: files-from: 0-separated file without -0 - at_setup_line='T-null.at:21' - at_desc="files-from: 0-separated file without -0" - $at_quiet $ECHO_N " 6: files-from: 0-separated file without -0 $ECHO_C" - at_xfail=no +genfile --file file +tar -cf test.tar --acls -Hgnu file + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: --acls can be used only on POSIX archives +Try 'tar --help' or 'tar --usage' for more information. +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/opcomp06.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_10 +#AT_START_11 +at_fn_group_banner 11 'T-mult.at:21' \ + "multiple file lists" " " 2 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "6. T-null.at:21: testing ..." - $at_traceon - - +( + $as_echo "11. $at_setup_line: testing $at_desc ..." + $at_traceon -cat >expout <<'_ATEOF' -jeden\ndwa -trzy -_ATEOF - $at_traceoff -echo "$at_srcdir/T-null.at:28: + { set +x +$as_echo "$at_srcdir/T-mult.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -2196,31 +2997,25 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +file2 +_ATEOF -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -echo dwa > temp -echo trzy >> temp -cat temp | tr '\\n' '\\0' > temp1 -echo jeden > file-list -cat temp1 >> file-list - -genfile -f \"jeden -dwa\" || exit 77 -genfile -f trzy +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF -tar cfTv archive file-list | sort +tar cf archive -T F1 -T F2 +tar tf archive )" -echo T-null.at:28 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "T-mult.at:24" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -2229,286 +3024,335 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +file2 +_ATEOF -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF +tar cf archive -T F1 -T F2 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +file3 +file4 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-mult.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -echo dwa > temp -echo trzy >> temp -cat temp | tr '\n' '\0' > temp1 -echo jeden > file-list -cat temp1 >> file-list -genfile -f "jeden -dwa" || exit 77 -genfile -f trzy -tar cfTv archive file-list | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_11 +#AT_START_12 +at_fn_group_banner 12 'T-nest.at:21' \ + "nested file lists" " " 2 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "12. $at_setup_line: testing $at_desc ..." + $at_traceon -test -z "`sort < /dev/null 2>&1`" || exit 77 -echo dwa > temp -echo trzy >> temp -cat temp | tr '\n' '\0' > temp1 -echo jeden > file-list -cat temp1 >> file-list -genfile -f "jeden -dwa" || exit 77 -genfile -f trzy -tar cfTv archive file-list | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + { set +x +$as_echo "$at_srcdir/T-nest.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -at_failed=false -echo >>"$at_stderr"; echo "tar: file-list: file name read contains nul character -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/T-null.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +-T F2 +file2 +_ATEOF +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF - echo 1 > "$at_status_file" - exit 1 -fi +tar cf archive -T F1 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "T-nest.at:24" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -$at_traceon +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +-T F2 +file2 +_ATEOF + +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF + +tar cf archive -T F1 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file3 +file4 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-nest.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } - # Testing one format is enough - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 7 ) # 7. indexfile.at:26: tar --index-file=FILE --file=- - at_setup_line='indexfile.at:26' - at_desc="tar --index-file=FILE --file=-" - $at_quiet $ECHO_N " 7: tar --index-file=FILE --file=- $ECHO_C" - at_xfail=no + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_12 +#AT_START_13 +at_fn_group_banner 13 'T-rec.at:21' \ + "recursive file lists" " " 2 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "7. indexfile.at:26: testing ..." - $at_traceon +( + $as_echo "13. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/indexfile.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + { set +x +$as_echo "$at_srcdir/T-rec.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * +>file1 +>file2 +cat >F1 <<'_ATEOF' +file1 +-T F2 +_ATEOF -mkdir directory -genfile --file=directory/a --length=1035 - -echo \"Creating the archive\" -tar -c -v -f - --index-file=idx directory > archive +cat >F2 <<'_ATEOF' +file2 +-T F1 +_ATEOF -echo \"Testing the archive\" -tar -tf archive +tar cf archive -T F1 +echo \$? +tar tf archive )" -echo indexfile.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +at_fn_check_prepare_notrace 'an embedded newline' "T-rec.at:24" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +>file1 +>file2 +cat >F1 <<'_ATEOF' +file1 +-T F2 +_ATEOF -mkdir directory -genfile --file=directory/a --length=1035 +cat >F2 <<'_ATEOF' +file2 +-T F1 +_ATEOF -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +tar cf archive -T F1 +echo $? +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: F1: file list requested from F2 already read from command line +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "2 +file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-rec.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -echo "Testing the archive" -tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_13 +#AT_START_14 +at_fn_group_banner 14 'T-cd.at:21' \ + "-C in file lists" " " 2 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "14. $at_setup_line: testing $at_desc ..." + $at_traceon -echo "Testing the archive" -tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive -Testing the archive -directory/ -directory/a -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/indexfile.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/indexfile.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + { set +x +$as_echo "$at_srcdir/T-cd.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo \"Creating the archive\" -tar -c -v -f - --index-file=idx directory > archive +>file1 +mkdir dir +>dir/file2 +>dir/file3 +cat >F1 <<'_ATEOF' +file1 +-C dir +. +_ATEOF -echo \"Testing the archive\" -tar -tf archive +tar cf archive -T F1 +tar tf archive | sort )" -echo indexfile.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +at_fn_check_prepare_notrace 'a `...` command substitution' "T-cd.at:24" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +>file1 +mkdir dir +>dir/file2 +>dir/file3 +cat >F1 <<'_ATEOF' +file1 +-C dir +. +_ATEOF -echo "Testing the archive" -tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +tar cf archive -T F1 +tar tf archive | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "./ +./file2 +./file3 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-cd.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir directory -genfile --file=directory/a --length=1035 -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive -echo "Testing the archive" -tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_14 +#AT_START_15 +at_fn_group_banner 15 'T-empty.at:26' \ + "empty entries" " " 2 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "15. $at_setup_line: testing $at_desc ..." + $at_traceon -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive -Testing the archive -directory/ -directory/a -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/indexfile.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi +cat >file-list <<'_ATEOF' +jeden +dwa + +trzy +_ATEOF + -$at_traceon -$at_traceoff -echo "$at_srcdir/indexfile.at:29: + + + { set +x +$as_echo "$at_srcdir/T-empty.at:36: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -2518,24 +3362,14 @@ export TAR_OPTIONS rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 - -echo \"Creating the archive\" -tar -c -v -f - --index-file=idx directory > archive +genfile --file jeden +genfile --file dwa +genfile --file trzy -echo \"Testing the archive\" -tar -tf archive +tar cfvT archive ../file-list )" -echo indexfile.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "T-empty.at:36" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -2545,69 +3379,321 @@ export TAR_OPTIONS rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 +genfile --file jeden +genfile --file dwa +genfile --file trzy -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +tar cfvT archive ../file-list +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "jeden +dwa +trzy +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-empty.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } -echo "Testing the archive" -tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + # Testing one format is enough + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_15 +#AT_START_16 +at_fn_group_banner 16 'T-null.at:21' \ + "0-separated file without -0" " " 2 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "16. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/T-null.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive -echo "Testing the archive" -tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +echo jeden > temp +echo dwa >> temp +echo trzy >> temp +cat temp | tr '\\n' '\\0' > file-list -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive -Testing the archive -directory/ -directory/a -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/indexfile.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile -f jeden +genfile -f dwa +genfile -f trzy +tar cfTv archive file-list +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "T-null.at:24" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/indexfile.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +echo jeden > temp +echo dwa >> temp +echo trzy >> temp +cat temp | tr '\n' '\0' > file-list + +genfile -f jeden +genfile -f dwa +genfile -f trzy + +tar cfTv archive file-list +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: file-list: file name read contains nul character +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "jeden +dwa +trzy +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-null.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Testing one format is enough + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_16 +#AT_START_17 +at_fn_group_banner 17 'T-zfile.at:26' \ + "empty file" " " 2 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "17. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/T-zfile.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +genfile --length=0 --file empty +genfile --file a +genfile --file b +cat >valid <<'_ATEOF' +a +b +_ATEOF + + +tar cf archive -T empty -T valid +tar tf archive +echo \"==\" +tar cf archive -T valid -T empty +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "T-zfile.at:29" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --length=0 --file empty +genfile --file a +genfile --file b +cat >valid <<'_ATEOF' +a +b +_ATEOF + + +tar cf archive -T empty -T valid +tar tf archive +echo "==" +tar cf archive -T valid -T empty +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "a +b +== +a +b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-zfile.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Testing one format is enough + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_17 +#AT_START_18 +at_fn_group_banner 18 'T-nonl.at:27' \ + "entries with missing newlines" " " 2 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "18. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/T-nonl.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +genfile --length=0 --file empty +\$as_echo_n c > 1.nonl +echo d > 2.nonl +\$as_echo_n e >> 2.nonl +touch a b c d e +cat >filelist <<'_ATEOF' +a +b +_ATEOF + + +tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist +tar tf archive +echo == +tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "T-nonl.at:30" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --length=0 --file empty +$as_echo_n c > 1.nonl +echo d > 2.nonl +$as_echo_n e >> 2.nonl +touch a b c d e +cat >filelist <<'_ATEOF' +a +b +_ATEOF + + +tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist +tar tf archive +echo == +tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "c +d +e +a +b +== +d +e +a +b +c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/T-nonl.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_18 +#AT_START_19 +at_fn_group_banner 19 'indexfile.at:26' \ + "tar --index-file=FILE --file=-" " " 3 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "19. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/indexfile.at:29: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * @@ -2621,20 +3707,13 @@ tar -c -v -f - --index-file=idx directory > archive echo \"Testing the archive\" tar -tf archive )" -echo indexfile.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -2647,17 +3726,48 @@ tar -c -v -f - --index-file=idx directory > archive echo "Testing the archive" tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive +Testing the archive +directory/ +directory/a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/indexfile.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +mkdir directory +genfile --file=directory/a --length=1035 + +echo \"Creating the archive\" +tar -c -v -f - --index-file=idx directory > archive + +echo \"Testing the archive\" +tar -tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -2670,38 +3780,82 @@ tar -c -v -f - --index-file=idx directory > archive echo "Testing the archive" tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive Testing the archive directory/ directory/a -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/indexfile.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/indexfile.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +mkdir directory +genfile --file=directory/a --length=1035 -$at_traceon -$at_traceoff -echo "$at_srcdir/indexfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +echo \"Creating the archive\" +tar -c -v -f - --index-file=idx directory > archive + +echo \"Testing the archive\" +tar -tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +mkdir directory +genfile --file=directory/a --length=1035 + +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive +Testing the archive +directory/ +directory/a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/indexfile.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * @@ -2715,20 +3869,47 @@ tar -c -v -f - --index-file=idx directory > archive echo \"Testing the archive\" tar -tf archive )" -echo indexfile.at:29 >"$at_check_line_file" +at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; +mkdir directory +genfile --file=directory/a --length=1035 + +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive +Testing the archive +directory/ +directory/a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/indexfile.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * @@ -2736,17 +3917,14 @@ rm -rf * mkdir directory genfile --file=directory/a --length=1035 -echo "Creating the archive" +echo \"Creating the archive\" tar -c -v -f - --index-file=idx directory > archive -echo "Testing the archive" +echo \"Testing the archive\" tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +)" +at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -2764,57 +3942,44 @@ tar -c -v -f - --index-file=idx directory > archive echo "Testing the archive" tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive Testing the archive directory/ directory/a -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/indexfile.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 8 ) # 8. verbose.at:26: tar cvf - - at_setup_line='verbose.at:26' - at_desc="tar cvf -" - $at_quiet $ECHO_N " 8: tar cvf - $ECHO_C" - at_xfail=no + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_19 +#AT_START_20 +at_fn_group_banner 20 'verbose.at:26' \ + "tar cvf -" " " 3 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "8. verbose.at:26: testing ..." - $at_traceon +( + $as_echo "20. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/verbose.at:29: + { set +x +$as_echo "$at_srcdir/verbose.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -2829,15 +3994,8 @@ tar cvf - file > archive echo Testing the archive tar tf archive )" -echo verbose.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -2851,17 +4009,29 @@ echo Creating the archive tar cvf - file > archive echo Testing the archive tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "file +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive +Testing the archive +file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verbose.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * @@ -2870,115 +4040,40 @@ echo Creating the archive tar cvf - file > archive echo Testing the archive tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "file -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive -Testing the archive -file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/verbose.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/verbose.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -)" -echo verbose.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +)" +at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * genfile --file file --length 10240 echo Creating the archive tar cvf - file > archive echo Testing the archive tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "file -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "file +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive Testing the archive file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/verbose.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/verbose.at:29: +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verbose.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -2993,34 +4088,8 @@ tar cvf - file > archive echo Testing the archive tar tf archive )" -echo verbose.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3034,33 +4103,24 @@ echo Creating the archive tar cvf - file > archive echo Testing the archive tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "file -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "file +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive Testing the archive file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/verbose.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/verbose.at:29: +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verbose.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -3075,34 +4135,8 @@ tar cvf - file > archive echo Testing the archive tar tf archive )" -echo verbose.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -3116,33 +4150,24 @@ echo Creating the archive tar cvf - file > archive echo Testing the archive tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "file -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "file +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive Testing the archive file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/verbose.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/verbose.at:29: +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verbose.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -3157,34 +4182,8 @@ tar cvf - file > archive echo Testing the archive tar tf archive )" -echo verbose.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -3198,57 +4197,95 @@ echo Creating the archive tar cvf - file > archive echo Testing the archive tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "file -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating the archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "file +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating the archive Testing the archive file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/verbose.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_20 +#AT_START_21 +at_fn_group_banner 21 'gzip.at:23' \ + "gzip" " " 3 +at_xfail=no +( + $as_echo "21. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +unset TAR_OPTIONS + +{ set +x +$as_echo "$at_srcdir/gzip.at:28: + +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +tar xfvz /dev/null 2>err +RC=\$? +sed -n '/^tar:/p' err >&2 +exit \$RC +" +at_fn_check_prepare_notrace 'an embedded newline' "gzip.at:28" +( $at_check_trace; - 9 ) # 9. append.at:21: append - at_setup_line='append.at:21' - at_desc="append" - $at_quiet $ECHO_N " 9: append $ECHO_C" - at_xfail=no +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +tar xfvz /dev/null 2>err +RC=$? +sed -n '/^tar:/p' err >&2 +exit $RC + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: Child returned status 1 +tar: Error is not recoverable: exiting now +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/gzip.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_21 +#AT_START_22 +at_fn_group_banner 22 'recurse.at:21' \ + "recurse" " " 3 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "9. append.at:21: testing ..." - $at_traceon +( + $as_echo "22. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/append.at:24: + { set +x +$as_echo "$at_srcdir/recurse.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3256,37 +4293,14 @@ export TEST_TAR_FORMAT TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive)" -echo append.at:24 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3294,35 +4308,25 @@ export TEST_TAR_FORMAT TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/append.at:24: +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/recurse.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -3330,37 +4334,14 @@ export TEST_TAR_FORMAT TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive)" -echo append.at:24 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -3368,35 +4349,25 @@ export TEST_TAR_FORMAT TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/append.at:24: +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/recurse.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3404,20 +4375,14 @@ export TEST_TAR_FORMAT TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive)" -echo append.at:24 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3425,52 +4390,25 @@ export TEST_TAR_FORMAT TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/append.at:24: +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/recurse.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -3478,37 +4416,14 @@ export TEST_TAR_FORMAT TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive)" -echo append.at:24 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -3516,35 +4431,25 @@ export TEST_TAR_FORMAT TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/append.at:24: +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/recurse.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -3552,37 +4457,14 @@ export TEST_TAR_FORMAT TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive)" -echo append.at:24 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -3590,103 +4472,112 @@ export TEST_TAR_FORMAT TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 10 ) # 10. append01.at:29: appending files with long names - at_setup_line='append01.at:29' - at_desc="appending files with long names" - $at_quiet $ECHO_N " 10: appending files with long names $ECHO_C" - at_xfail=no +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_22 +#AT_START_23 +at_fn_group_banner 23 'shortrec.at:25' \ + "short records" " " 3 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "10. append01.at:29: testing ..." - $at_traceon - - +( + $as_echo "23. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/append01.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + { set +x +$as_echo "$at_srcdir/shortrec.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null + +rm -r directory )" -echo append01.at:34 >"$at_check_line_file" +at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -if test -n "$at_trace_this"; then - ( $at_traceon; +rm -r directory +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortrec.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null + +rm -r directory +)" +at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -3695,36 +4586,26 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append01.at:34: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -$at_traceon -$at_traceoff -echo "$at_srcdir/append01.at:34: +rm -r directory +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortrec.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3733,40 +4614,17 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -)" -echo append01.at:34 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -r directory +)" +at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3775,36 +4633,26 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append01.at:34: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -$at_traceon -$at_traceoff -echo "$at_srcdir/append01.at:34: +rm -r directory +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortrec.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -3813,21 +4661,17 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -)" -echo append01.at:34 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -if test -n "$at_trace_this"; then - ( $at_traceon; +rm -r directory +)" +at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -3836,97 +4680,45 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null + +rm -r directory +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortrec.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append01.at:34: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/append01.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive +rm -r directory )" -echo append01.at:34 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -3935,60 +4727,47 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append01.at:34: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null - 11 ) # 11. append02.at:40: append vs. create - at_setup_line='append02.at:40' - at_desc="append vs. create" - $at_quiet $ECHO_N " 11: append vs. create $ECHO_C" - at_xfail=no +rm -r directory +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_23 +#AT_START_24 +at_fn_group_banner 24 'same-order01.at:26' \ + "working -C with --same-order" " " 4 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "11. append02.at:40: testing ..." - $at_traceon +( + $as_echo "24. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/append02.at:43: + { set +x +$as_echo "$at_srcdir/same-order01.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3997,38 +4776,21 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 -# Make sure file timestamps in the archive will not differ -MTIME=\"--mtime=@0\" +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test \$TEST_TAR_FORMAT = posix; then - TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" -fi -echo Creating archive.1 -tar \$MTIME -cf archive.1 file1 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.2 -tar \$MTIME -cf archive.2 -T /dev/null -tar \$MTIME -rf archive.2 file1 -tar \$MTIME -rf archive.2 file2 +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -echo Comparing archives -cmp archive.1 archive.2 +ls directory|sort )" -echo append02.at:43 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4037,562 +4799,572 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +test -z "`sort < /dev/null 2>&1`" || exit 77 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +ls directory|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order01.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 - -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating archive.1 -Creating archive.2 -Comparing archives -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append02.at:43: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 - echo 1 > "$at_status_file" - exit 1 -fi +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -$at_traceon -$at_traceoff -echo "$at_srcdir/append02.at:43: +ls directory|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME=\"--mtime=@0\" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test \$TEST_TAR_FORMAT = posix; then - TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" -fi -echo Creating archive.1 -tar \$MTIME -cf archive.1 file1 file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Creating archive.2 -tar \$MTIME -cf archive.2 -T /dev/null -tar \$MTIME -rf archive.2 file1 -tar \$MTIME -rf archive.2 file2 -echo Comparing archives -cmp archive.1 archive.2 -)" -echo append02.at:43 >"$at_check_line_file" +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +ls directory|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order01.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +ls directory|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +test -z "`sort < /dev/null 2>&1`" || exit 77 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +ls directory|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order01.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating archive.1 -Creating archive.2 -Comparing archives -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append02.at:43: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/append02.at:43: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 + +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 + +ls directory|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME=\"--mtime=@0\" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test \$TEST_TAR_FORMAT = posix; then - TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" -fi -echo Creating archive.1 -tar \$MTIME -cf archive.1 file1 file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Creating archive.2 -tar \$MTIME -cf archive.2 -T /dev/null -tar \$MTIME -rf archive.2 file1 -tar \$MTIME -rf archive.2 file2 -echo Comparing archives -cmp archive.1 archive.2 -)" -echo append02.at:43 >"$at_check_line_file" +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +ls directory|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order01.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +ls directory|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +test -z "`sort < /dev/null 2>&1`" || exit 77 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +ls directory|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating archive.1 -Creating archive.2 -Comparing archives -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append02.at:43: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/append02.at:43: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_24 +#AT_START_25 +at_fn_group_banner 25 'same-order02.at:25' \ + "multiple -C options" " " 4 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "25. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/same-order02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -# Make sure file timestamps in the archive will not differ -MTIME=\"--mtime=@0\" +mkdir en +mkdir to -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test \$TEST_TAR_FORMAT = posix; then - TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" -fi +HERE=\`pwd\` +tar -xf archive --same-order --warning=no-timestamp \\ + -C \$HERE/en file1 \\ + -C \$HERE/to file2 || exit 1 -echo Creating archive.1 -tar \$MTIME -cf archive.1 file1 file2 +ls en +echo separator +ls to +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -echo Creating archive.2 -tar \$MTIME -cf archive.2 -T /dev/null -tar \$MTIME -rf archive.2 file1 -tar \$MTIME -rf archive.2 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Comparing archives -cmp archive.1 archive.2 -)" -echo append02.at:43 >"$at_check_line_file" +mkdir en +mkdir to -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +ls en +echo separator +ls to +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +separator +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +mkdir en +mkdir to -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +HERE=\`pwd\` +tar -xf archive --same-order --warning=no-timestamp \\ + -C \$HERE/en file1 \\ + -C \$HERE/to file2 || exit 1 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +ls en +echo separator +ls to +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +mkdir en +mkdir to -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +ls en +echo separator +ls to +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +separator +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order02.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir en +mkdir to -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating archive.1 -Creating archive.2 -Comparing archives -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append02.at:43: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +HERE=\`pwd\` +tar -xf archive --same-order --warning=no-timestamp \\ + -C \$HERE/en file1 \\ + -C \$HERE/to file2 || exit 1 +ls en +echo separator +ls to +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -$at_traceon -$at_traceoff -echo "$at_srcdir/append02.at:43: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir en +mkdir to + +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 + +ls en +echo separator +ls to +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +separator +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -# Make sure file timestamps in the archive will not differ -MTIME=\"--mtime=@0\" +mkdir en +mkdir to -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test \$TEST_TAR_FORMAT = posix; then - TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" -fi +HERE=\`pwd\` +tar -xf archive --same-order --warning=no-timestamp \\ + -C \$HERE/en file1 \\ + -C \$HERE/to file2 || exit 1 -echo Creating archive.1 -tar \$MTIME -cf archive.1 file1 file2 +ls en +echo separator +ls to +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -echo Creating archive.2 -tar \$MTIME -cf archive.2 -T /dev/null -tar \$MTIME -rf archive.2 file1 -tar \$MTIME -rf archive.2 file2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Comparing archives -cmp archive.1 archive.2 -)" -echo append02.at:43 >"$at_check_line_file" +mkdir en +mkdir to -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -if test -n "$at_trace_this"; then - ( $at_traceon; +ls en +echo separator +ls to +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +separator +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/same-order02.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +mkdir en +mkdir to -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +HERE=\`pwd\` +tar -xf archive --same-order --warning=no-timestamp \\ + -C \$HERE/en file1 \\ + -C \$HERE/to file2 || exit 1 -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +ls en +echo separator +ls to +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4601,78 +5373,138 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 - -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 - -echo Comparing archives -cmp archive.1 archive.2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating archive.1 -Creating archive.2 -Comparing archives -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/append02.at:43: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 +mkdir en +mkdir to - echo 1 > "$at_status_file" - exit 1 -fi +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -$at_traceon +ls en +echo separator +ls to +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +separator +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 12 ) # 12. exclude.at:23: exclude - at_setup_line='exclude.at:23' - at_desc="exclude" - $at_quiet $ECHO_N " 12: exclude $ECHO_C" - at_xfail=no + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_25 +#AT_START_26 +at_fn_group_banner 26 'append.at:21' \ + "append" " " 5 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "12. exclude.at:23: testing ..." - $at_traceon +( + $as_echo "26. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/exclude.at:26: + { set +x +$as_echo "$at_srcdir/append.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "append.at:24" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "append.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4680,48 +5512,13 @@ export TEST_TAR_FORMAT TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir dir -echo blues > dir/blues -echo jazz > dir/jazz -mkdir dir/folk -echo tagfile > dir/folk/tagfile -echo sanjuan > dir/folk/sanjuan -mkdir dir/rock -echo \"Signature: 8a477f597d28d172789f06886806bc55\" > dir/rock/CACHEDIR.TAG -echo \"test\" > dir/rock/file - -for option in exclude-caches exclude-caches-under exclude-caches-all -do - echo OPTION \$option - tar -cf archive.tar --\$option -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done - -for option in exclude-tag exclude-tag-under exclude-tag-all -do - echo OPTION \$option - tar -cf archive.tar --\${option}=tagfile -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done -)" -echo exclude.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a ${...} parameter expansion)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "append.at:24" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4729,44 +5526,188 @@ export TEST_TAR_FORMAT TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "append.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "append.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir dir -echo blues > dir/blues -echo jazz > dir/jazz -mkdir dir/folk -echo tagfile > dir/folk/tagfile -echo sanjuan > dir/folk/sanjuan -mkdir dir/rock -echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG -echo "test" > dir/rock/file + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_26 +#AT_START_27 +at_fn_group_banner 27 'append01.at:29' \ + "appending files with long names" " " 5 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "27. $at_setup_line: testing $at_desc ..." + $at_traceon -for option in exclude-caches exclude-caches-under exclude-caches-all -do - echo OPTION $option - tar -cf archive.tar --$option -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done -for option in exclude-tag exclude-tag-under exclude-tag-all -do - echo OPTION $option - tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + + + + + { set +x +$as_echo "$at_srcdir/append01.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append01.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4775,186 +5716,136 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append01.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append01.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -mkdir dir -echo blues > dir/blues -echo jazz > dir/jazz -mkdir dir/folk -echo tagfile > dir/folk/tagfile -echo sanjuan > dir/folk/sanjuan -mkdir dir/rock -echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG -echo "test" > dir/rock/file +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -for option in exclude-caches exclude-caches-under exclude-caches-all -do - echo OPTION $option - tar -cf archive.tar --$option -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } -for option in exclude-tag exclude-tag-under exclude-tag-all -do - echo OPTION $option - tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "OPTION exclude-caches -dir/ -dir/blues -dir/folk/ -dir/folk/sanjuan -dir/folk/tagfile -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped -ARCHIVE -dir/ -dir/blues -dir/folk/ -dir/folk/sanjuan -dir/folk/tagfile -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -OPTION exclude-caches-under -dir/ -dir/blues -dir/folk/ -dir/folk/sanjuan -dir/folk/tagfile -dir/jazz -dir/rock/ -tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped -ARCHIVE -dir/ -dir/blues -dir/folk/ -dir/folk/sanjuan -dir/folk/tagfile -dir/jazz -dir/rock/ -OPTION exclude-caches-all -dir/ -dir/blues -dir/folk/ -dir/folk/sanjuan -dir/folk/tagfile -dir/jazz -tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped -ARCHIVE -dir/ -dir/blues -dir/folk/ -dir/folk/sanjuan -dir/folk/tagfile -dir/jazz -OPTION exclude-tag -dir/ -dir/blues -dir/folk/ -dir/folk/tagfile -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -dir/rock/file -tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped -ARCHIVE -dir/ -dir/blues -dir/folk/ -dir/folk/tagfile -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -dir/rock/file -OPTION exclude-tag-under -dir/ -dir/blues -dir/folk/ -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -dir/rock/file -tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped -ARCHIVE -dir/ -dir/blues -dir/folk/ -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -dir/rock/file -OPTION exclude-tag-all -dir/ -dir/blues -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -dir/rock/file -tar: dir/folk/: contains a cache directory tag tagfile; directory not dumped -ARCHIVE -dir/ -dir/blues -dir/jazz -dir/rock/ -dir/rock/CACHEDIR.TAG -dir/rock/file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/exclude.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 13 ) # 13. delete01.at:23: deleting a member after a big one - at_setup_line='delete01.at:23' - at_desc="deleting a member after a big one" - $at_quiet $ECHO_N " 13: deleting a member after a big one $ECHO_C" - at_xfail=no + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_27 +#AT_START_28 +at_fn_group_banner 28 'append02.at:54' \ + "append vs. create" " " 5 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "13. delete01.at:23: testing ..." - $at_traceon +( + $as_echo "28. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/delete01.at:26: + { set +x +$as_echo "$at_srcdir/append02.at:57: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4963,38 +5854,31 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive)" -echo delete01.at:26 >"$at_check_line_file" +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME=\"--mtime=@0\" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test \$TEST_TAR_FORMAT = posix; then + TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +echo Creating archive.1 +tar \$MTIME -cf archive.1 file1 file2 -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo Creating archive.2 +tar \$MTIME -cf archive.2 -T /dev/null +tar \$MTIME -rf archive.2 file1 +tar \$MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -5003,34 +5887,44 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile --file file1 +genfile --file file2 +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" - echo 1 > "$at_status_file" - exit 1 +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete01.at:26: +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating archive.1 +Creating archive.2 +Comparing archives +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append02.at:57: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -5039,38 +5933,31 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive)" -echo delete01.at:26 >"$at_check_line_file" +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME=\"--mtime=@0\" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test \$TEST_TAR_FORMAT = posix; then + TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +echo Creating archive.1 +tar \$MTIME -cf archive.1 file1 file2 -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo Creating archive.2 +tar \$MTIME -cf archive.2 -T /dev/null +tar \$MTIME -rf archive.2 file1 +tar \$MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -5079,34 +5966,44 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile --file file1 +genfile --file file2 +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" - echo 1 > "$at_status_file" - exit 1 +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete01.at:26: +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating archive.1 +Creating archive.2 +Comparing archives +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append02.at:57: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5115,20 +6012,31 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive)" -echo delete01.at:26 >"$at_check_line_file" +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME=\"--mtime=@0\" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test \$TEST_TAR_FORMAT = posix; then + TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" fi -if test -n "$at_trace_this"; then - ( $at_traceon; +echo Creating archive.1 +tar \$MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar \$MTIME -cf archive.2 -T /dev/null +tar \$MTIME -rf archive.2 file1 +tar \$MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5137,52 +6045,44 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +genfile --file file1 +genfile --file file2 -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 - echo 1 > "$at_status_file" - exit 1 -fi +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 -$at_traceon -$at_traceoff -echo "$at_srcdir/delete01.at:26: +echo Comparing archives +cmp archive.1 archive.2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating archive.1 +Creating archive.2 +Comparing archives +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append02.at:57: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5191,38 +6091,31 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive)" -echo delete01.at:26 >"$at_check_line_file" +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME=\"--mtime=@0\" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test \$TEST_TAR_FORMAT = posix; then + TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +echo Creating archive.1 +tar \$MTIME -cf archive.1 file1 file2 -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo Creating archive.2 +tar \$MTIME -cf archive.2 -T /dev/null +tar \$MTIME -rf archive.2 file1 +tar \$MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5231,34 +6124,44 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile --file file1 +genfile --file file2 +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" - echo 1 > "$at_status_file" - exit 1 +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete01.at:26: +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating archive.1 +Creating archive.2 +Comparing archives +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append02.at:57: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5267,38 +6170,31 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive)" -echo delete01.at:26 >"$at_check_line_file" +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME=\"--mtime=@0\" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test \$TEST_TAR_FORMAT = posix; then + TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\" fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +echo Creating archive.1 +tar \$MTIME -cf archive.1 file1 file2 -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo Creating archive.2 +tar \$MTIME -cf archive.2 -T /dev/null +tar \$MTIME -rf archive.2 file1 +tar \$MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5307,104 +6203,86 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar f archive --delete file2 -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile --file file1 +genfile --file file2 +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" - echo 1 > "$at_status_file" - exit 1 +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" fi -$at_traceon +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 +echo Comparing archives +cmp archive.1 archive.2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating archive.1 +Creating archive.2 +Comparing archives +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 14 ) # 14. delete02.at:23: deleting a member from stdin archive - at_setup_line='delete02.at:23' - at_desc="deleting a member from stdin archive" - $at_quiet $ECHO_N " 14: deleting a member from stdin archive $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "14. delete02.at:23: testing ..." - $at_traceon + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_28 +#AT_START_29 +at_fn_group_banner 29 'append03.at:21' \ + "append with name transformation" " " 5 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "29. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/delete02.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" -export TAR_OPTIONS -rm -rf * +# Description: Make sure filenames are transformed during append. -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2)" -echo delete02.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; + { set +x +$as_echo "$at_srcdir/append03.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +genfile --file file.1 +genfile --file file.2 + +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +)" +at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -5413,42 +6291,33 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "1 -2 -3 -separator -1 -3 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete02.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +genfile --file file.1 +genfile --file file.2 -$at_traceon -$at_traceoff -echo "$at_srcdir/delete02.at:26: +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Appending +plik.1 +Testing +plik.1 +plik.2 +plik.1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append03.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -5457,23 +6326,17 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2)" -echo delete02.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +genfile --file file.1 +genfile --file file.2 -if test -n "$at_trace_this"; then - ( $at_traceon; +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -5482,88 +6345,52 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +genfile --file file.1 +genfile --file file.2 + +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Appending +plik.1 +Testing +plik.1 +plik.2 +plik.1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append03.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +genfile --file file.1 +genfile --file file.2 + +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "1 -2 -3 -separator -1 -3 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete02.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/delete02.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" -export TAR_OPTIONS -rm -rf * - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2)" -echo delete02.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +)" +at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5572,63 +6399,33 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +genfile --file file.1 +genfile --file file.2 -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "1 -2 -3 -separator -1 -3 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete02.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/delete02.at:26: +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Appending +plik.1 +Testing +plik.1 +plik.2 +plik.1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append03.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5637,44 +6434,17 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2)" -echo delete02.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +genfile --file file.1 +genfile --file file.2 -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +)" +at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5683,42 +6453,33 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "1 -2 -3 -separator -1 -3 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete02.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +genfile --file file.1 +genfile --file file.2 -$at_traceon -$at_traceoff -echo "$at_srcdir/delete02.at:26: +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Appending +plik.1 +Testing +plik.1 +plik.2 +plik.1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5727,44 +6488,17 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2)" -echo delete02.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +genfile --file file.1 +genfile --file file.2 -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +)" +at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5773,264 +6507,270 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "1 -2 -3 -separator -1 -3 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete02.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon +genfile --file file.1 +genfile --file file.2 - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 15 ) # 15. delete03.at:21: deleting members with long names - at_setup_line='delete03.at:21' - at_desc="deleting members with long names" - $at_quiet $ECHO_N " 15: deleting members with long names $ECHO_C" - at_xfail=no +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Appending +plik.1 +Testing +plik.1 +plik.2 +plik.1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_29 +#AT_START_30 +at_fn_group_banner 30 'append04.at:29' \ + "append with verify" " " 5 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "15. delete03.at:21: testing ..." - $at_traceon - - +( + $as_echo "30. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/delete03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + { set +x +$as_echo "$at_srcdir/append04.at:32: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f \$prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch \$prefix\$i -done -tar -cf archive ./\$prefix* && - tar --delete -f archive ./\${prefix}5 && - tar -tf archive -)" -echo delete03.at:26 >"$at_check_line_file" +# Create an archive: +tar cpfW archive.tar file1 file2 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a ${...} parameter expansion)' -fi +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +# Create an archive: +tar cpfW archive.tar file1 file2 + +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +== +file1 +file2 +file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append04.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# Create an archive: +tar cpfW archive.tar file1 file2 +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 - echo 1 > "$at_status_file" - exit 1 -fi +# Append it to the already created archive: +tar rpfW archive.tar file3 -$at_traceon -$at_traceoff -echo "$at_srcdir/delete03.at:26: +# Verify content of the new archive: +tar -tf archive.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f \$prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch \$prefix\$i -done -tar -cf archive ./\$prefix* && - tar --delete -f archive ./\${prefix}5 && - tar -tf archive -)" -echo delete03.at:26 >"$at_check_line_file" +# Create an archive: +tar cpfW archive.tar file1 file2 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a ${...} parameter expansion)' -fi +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +== +file1 +file2 +file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append04.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +# Create an archive: +tar cpfW archive.tar file1 file2 + +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# Create an archive: +tar cpfW archive.tar file1 file2 +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 - echo 1 > "$at_status_file" - exit 1 -fi +# Append it to the already created archive: +tar rpfW archive.tar file3 -$at_traceon -$at_traceoff -echo "$at_srcdir/delete03.at:26: +# Verify content of the new archive: +tar -tf archive.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +== +file1 +file2 +file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append04.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6039,25 +6779,26 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f \$prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch \$prefix\$i -done -tar -cf archive ./\$prefix* && - tar --delete -f archive ./\${prefix}5 && - tar -tf archive -)" -echo delete03.at:26 >"$at_check_line_file" +# Create an archive: +tar cpfW archive.tar file1 file2 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a ${...} parameter expansion)' -fi +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -if test -n "$at_trace_this"; then - ( $at_traceon; +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6066,93 +6807,137 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +# Create an archive: +tar cpfW archive.tar file1 file2 + +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +== +file1 +file2 +file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/append04.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +# Create an archive: +tar cpfW archive.tar file1 file2 -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8 -./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 +# Append it to the already created archive: +tar rpfW archive.tar file3 - echo 1 > "$at_status_file" - exit 1 -fi +# Verify content of the new archive: +tar -tf archive.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -$at_traceon +# Create two empty files: +touch file1 file2 +# Create an archive: +tar cpfW archive.tar file1 file2 +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +== +file1 +file2 +file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 16 ) # 16. delete04.at:23: deleting a large last member - at_setup_line='delete04.at:23' - at_desc="deleting a large last member" - $at_quiet $ECHO_N " 16: deleting a large last member $ECHO_C" - at_xfail=no + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_30 +#AT_START_31 +at_fn_group_banner 31 'xform-h.at:30' \ + "transforming hard links on create" " " 6 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "16. delete04.at:23: testing ..." - $at_traceon +( + $as_echo "31. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/delete04.at:26: + + + { set +x +$as_echo "$at_srcdir/xform-h.at:39: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6161,56 +6946,28 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -)" -echo delete04.at:26 >"$at_check_line_file" +mkdir basedir +echo \"hello\" > basedir/test +ln basedir/test basedir/test_link -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +echo \"Default transform scope\" +tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + +echo \"Transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo \"Not transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +)" +at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6219,51 +6976,44 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -file3 -file4 -file5 -file6 -file7 -file8 -file9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete04.at:26: +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Default transform scope +test +Transforming hard links +test +Not transforming hard links +basedir/test +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xform-h.at:39: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6272,29 +7022,28 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -)" -echo delete04.at:26 >"$at_check_line_file" +mkdir basedir +echo \"hello\" > basedir/test +ln basedir/test basedir/test_link -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; +echo \"Default transform scope\" +tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo \"Transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo \"Not transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +)" +at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6303,78 +7052,44 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -file3 -file4 -file5 -file6 -file7 -file8 -file9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' - echo 1 > "$at_status_file" - exit 1 -fi +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + -$at_traceon -$at_traceoff -echo "$at_srcdir/delete04.at:26: +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Default transform scope +test +Transforming hard links +test +Not transforming hard links +basedir/test +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xform-h.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6383,56 +7098,28 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -)" -echo delete04.at:26 >"$at_check_line_file" +mkdir basedir +echo \"hello\" > basedir/test +ln basedir/test basedir/test_link -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +echo \"Default transform scope\" +tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + +echo \"Transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo \"Not transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +)" +at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6441,51 +7128,44 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -file3 -file4 -file5 -file6 -file7 -file8 -file9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete04.at:26: +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Default transform scope +test +Transforming hard links +test +Not transforming hard links +basedir/test +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xform-h.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6494,56 +7174,28 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -)" -echo delete04.at:26 >"$at_check_line_file" +mkdir basedir +echo \"hello\" > basedir/test +ln basedir/test basedir/test_link -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +echo \"Default transform scope\" +tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + +echo \"Transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo \"Not transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +)" +at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6552,51 +7204,44 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -file3 -file4 -file5 -file6 -file7 -file8 -file9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete04.at:26: +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Default transform scope +test +Transforming hard links +test +Not transforming hard links +basedir/test +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xform-h.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6605,56 +7250,28 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -)" -echo delete04.at:26 >"$at_check_line_file" +mkdir basedir +echo \"hello\" > basedir/test +ln basedir/test basedir/test_link -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +echo \"Default transform scope\" +tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + +echo \"Transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo \"Not transforming hard links\" +tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +)" +at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6663,257 +7280,128 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -file3 -file4 -file5 -file6 -file7 -file8 -file9 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Default transform scope +test +Transforming hard links +test +Not transforming hard links +basedir/test +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 17 ) # 17. delete05.at:27: deleting non-existing member - at_setup_line='delete05.at:27' - at_desc="deleting non-existing member" - $at_quiet $ECHO_N " 17: deleting non-existing member $ECHO_C" - at_xfail=no + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_31 +#AT_START_32 +at_fn_group_banner 32 'xform01.at:26' \ + "transformations and GNU volume labels" " " 6 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "17. delete05.at:27: testing ..." - $at_traceon +( + $as_echo "32. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/delete05.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + { set +x +$as_echo "$at_srcdir/xform01.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive +genfile --file file +tar -cf archive.tar -V /label/ file +tar tf archive.tar )" -echo delete05.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "tar: tre: Not found in archive -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "en -to -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete05.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/delete05.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +at_fn_check_prepare_notrace 'an embedded newline' "xform01.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -)" -echo delete05.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +genfile --file file +tar -cf archive.tar -V /label/ file +tar tf archive.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "/label/ +file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xform01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_32 +#AT_START_33 +at_fn_group_banner 33 'exclude.at:23' \ + "exclude" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "33. $at_setup_line: testing $at_desc ..." + $at_traceon -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: tre: Not found in archive -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "en -to -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete05.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete05.at:30: + { set +x +$as_echo "$at_srcdir/exclude.at:26: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6922,46 +7410,40 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -)" -echo delete05.at:30 >"$at_check_line_file" +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +mkdir dir +echo blues > dir/blues +echo jazz > dir/jazz +mkdir dir/folk +echo tagfile > dir/folk/tagfile +echo sanjuan > dir/folk/sanjuan +mkdir dir/rock +echo \"Signature: 8a477f597d28d172789f06886806bc55\" > dir/rock/CACHEDIR.TAG +echo \"test\" > dir/rock/file -genfile -l 1024 -f en -genfile -l 1024 -f to +for option in exclude-caches exclude-caches-under exclude-caches-all +do + echo OPTION \$option + tar -cf archive.tar --\$option -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +for option in exclude-tag exclude-tag-under exclude-tag-all +do + echo OPTION \$option + tar -cf archive.tar --\${option}=tagfile -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude.at:26" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6970,287 +7452,218 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "tar: tre: Not found in archive -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "en -to -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete05.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/delete05.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -)" -echo delete05.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile -l 1024 -f en -genfile -l 1024 -f to -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +mkdir dir +echo blues > dir/blues +echo jazz > dir/jazz +mkdir dir/folk +echo tagfile > dir/folk/tagfile +echo sanjuan > dir/folk/sanjuan +mkdir dir/rock +echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG +echo "test" > dir/rock/file -genfile -l 1024 -f en -genfile -l 1024 -f to +for option in exclude-caches exclude-caches-under exclude-caches-all +do + echo OPTION $option + tar -cf archive.tar --$option -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "tar: tre: Not found in archive -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "en -to -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete05.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +for option in exclude-tag exclude-tag-under exclude-tag-all +do + echo OPTION $option + tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "OPTION exclude-caches +dir/ +dir/blues +dir/folk/ +dir/folk/sanjuan +dir/folk/tagfile +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped +ARCHIVE +dir/ +dir/blues +dir/folk/ +dir/folk/sanjuan +dir/folk/tagfile +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +OPTION exclude-caches-under +dir/ +dir/blues +dir/folk/ +dir/folk/sanjuan +dir/folk/tagfile +dir/jazz +dir/rock/ +tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped +ARCHIVE +dir/ +dir/blues +dir/folk/ +dir/folk/sanjuan +dir/folk/tagfile +dir/jazz +dir/rock/ +OPTION exclude-caches-all +dir/ +dir/blues +dir/folk/ +dir/folk/sanjuan +dir/folk/tagfile +dir/jazz +tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped +ARCHIVE +dir/ +dir/blues +dir/folk/ +dir/folk/sanjuan +dir/folk/tagfile +dir/jazz +OPTION exclude-tag +dir/ +dir/blues +dir/folk/ +dir/folk/tagfile +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +dir/rock/file +tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped +ARCHIVE +dir/ +dir/blues +dir/folk/ +dir/folk/tagfile +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +dir/rock/file +OPTION exclude-tag-under +dir/ +dir/blues +dir/folk/ +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +dir/rock/file +tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped +ARCHIVE +dir/ +dir/blues +dir/folk/ +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +dir/rock/file +OPTION exclude-tag-all +dir/ +dir/blues +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +dir/rock/file +tar: dir/folk/: contains a cache directory tag tagfile; directory not dumped +ARCHIVE +dir/ +dir/blues +dir/jazz +dir/rock/ +dir/rock/CACHEDIR.TAG +dir/rock/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/delete05.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_33 +#AT_START_34 +at_fn_group_banner 34 'exclude01.at:19' \ + "exclude wildcards" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "34. $at_setup_line: testing $at_desc ..." + $at_traceon -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -)" -echo delete05.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + { set +x +$as_echo "$at_srcdir/exclude01.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "tar: tre: Not found in archive -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "en -to -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/delete05.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 18 ) # 18. extrac01.at:23: extract over an existing directory - at_setup_line='extrac01.at:23' - at_desc="extract over an existing directory" - $at_quiet $ECHO_N " 18: extract over an existing directory $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "18. extrac01.at:23: testing ..." - $at_traceon - +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* +tar cf archive --exclude=testdir/dir1/\\* \\ + --no-wildcards \\ + --exclude=testdir/dir2/\\* \\ + --wildcards \\ + --exclude=testdir/dir3/\\* \\ + testdir +tar tf archive | sort +echo \"NEXT\" +tar cf archive testdir +tar t \"testdir/dir1/*\" -f archive | sort +echo \"NEXT\" +tar cf archive testdir/dir1 +tar t --no-wildcards \"testdir/dir1/*\" -f archive | sort - $at_traceoff -echo "$at_srcdir/extrac01.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" -export TAR_OPTIONS -rm -rf * +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards \"testdir/dir1/*\" -f archive | sort -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 +rm -rf testdir )" -echo extrac01.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7259,33 +7672,65 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac01.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir2/ +testdir/dir2/file2 +testdir/dir3/ +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude01.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7294,38 +7739,43 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -)" -echo extrac01.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude=testdir/dir1/\\* \\ + --no-wildcards \\ + --exclude=testdir/dir2/\\* \\ + --wildcards \\ + --exclude=testdir/dir3/\\* \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir/dir1 +tar t --no-wildcards \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards \"testdir/dir1/*\" -f archive | sort + +rm -rf testdir +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7334,33 +7784,65 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac01.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir2/ +testdir/dir2/file2 +testdir/dir3/ +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude01.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7369,38 +7851,43 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -)" -echo extrac01.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude=testdir/dir1/\\* \\ + --no-wildcards \\ + --exclude=testdir/dir2/\\* \\ + --wildcards \\ + --exclude=testdir/dir3/\\* \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir/dir1 +tar t --no-wildcards \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards \"testdir/dir1/*\" -f archive | sort + +rm -rf testdir +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7409,33 +7896,65 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac01.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir2/ +testdir/dir2/file2 +testdir/dir3/ +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude01.at:22: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7444,38 +7963,43 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -)" -echo extrac01.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude=testdir/dir1/\\* \\ + --no-wildcards \\ + --exclude=testdir/dir2/\\* \\ + --wildcards \\ + --exclude=testdir/dir3/\\* \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir/dir1 +tar t --no-wildcards \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards \"testdir/dir1/*\" -f archive | sort + +rm -rf testdir +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7484,33 +8008,65 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac01.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir2/ +testdir/dir2/file2 +testdir/dir3/ +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude01.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7519,38 +8075,43 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -)" -echo extrac01.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude=testdir/dir1/\\* \\ + --no-wildcards \\ + --exclude=testdir/dir2/\\* \\ + --wildcards \\ + --exclude=testdir/dir3/\\* \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir/dir1 +tar t --no-wildcards \"testdir/dir1/*\" -f archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards \"testdir/dir1/*\" -f archive | sort + +rm -rf testdir +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7559,59 +8120,86 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac01.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - +test -z "`sort < /dev/null 2>&1`" || exit 77 - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 19 ) # 19. extrac02.at:23: extracting symlinks over an existing file - at_setup_line='extrac02.at:23' - at_desc="extracting symlinks over an existing file" - $at_quiet $ECHO_N " 19: extracting symlinks over an existing file $ECHO_C" - at_xfail=no +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir2/ +testdir/dir2/file2 +testdir/dir3/ +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +NEXT +testdir/dir1/* +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_34 +#AT_START_35 +at_fn_group_banner 35 'exclude02.at:19' \ + "exclude: anchoring" " " 7 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "19. extrac02.at:23: testing ..." - $at_traceon - +( + $as_echo "35. $at_setup_line: testing $at_desc ..." + $at_traceon -# FIXME: Skip if symlinks are not supported on the system - $at_traceoff -echo "$at_srcdir/extrac02.at:28: + { set +x +$as_echo "$at_srcdir/exclude02.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7620,42 +8208,47 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -)" -echo extrac02.at:28 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 1\" +tar cf archive --no-anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 2\" +tar cf archive --anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 3\" +tar cf archive testdir file1.txt +tar t \"file1.txt\" -f archive | sort + +echo \"SUB 4\" +tar t --no-anchored \"file1.txt\" -f archive | sort + +echo \"SUB 5\" +tar t --anchored \"file1.txt\" -f archive | sort + +rm -rf testdir file1.txt + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7664,35 +8257,73 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac02.at:28: +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file2 +SUB 1 +testdir/ +testdir/file2 +SUB 2 +testdir/ +testdir/file1.txt +testdir/file2 +SUB 3 +file1.txt +SUB 4 +file1.txt +testdir/file1.txt +SUB 5 +file1.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude02.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7701,42 +8332,47 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -)" -echo extrac02.at:28 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 1\" +tar cf archive --no-anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 2\" +tar cf archive --anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 3\" +tar cf archive testdir file1.txt +tar t \"file1.txt\" -f archive | sort + +echo \"SUB 4\" +tar t --no-anchored \"file1.txt\" -f archive | sort + +echo \"SUB 5\" +tar t --anchored \"file1.txt\" -f archive | sort + +rm -rf testdir file1.txt + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7745,35 +8381,73 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac02.at:28: +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file2 +SUB 1 +testdir/ +testdir/file2 +SUB 2 +testdir/ +testdir/file1.txt +testdir/file2 +SUB 3 +file1.txt +SUB 4 +file1.txt +testdir/file1.txt +SUB 5 +file1.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude02.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7782,42 +8456,47 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -)" -echo extrac02.at:28 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 1\" +tar cf archive --no-anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 2\" +tar cf archive --anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 3\" +tar cf archive testdir file1.txt +tar t \"file1.txt\" -f archive | sort + +echo \"SUB 4\" +tar t --no-anchored \"file1.txt\" -f archive | sort + +echo \"SUB 5\" +tar t --anchored \"file1.txt\" -f archive | sort + +rm -rf testdir file1.txt + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7826,35 +8505,73 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac02.at:28: +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file2 +SUB 1 +testdir/ +testdir/file2 +SUB 2 +testdir/ +testdir/file1.txt +testdir/file2 +SUB 3 +file1.txt +SUB 4 +file1.txt +testdir/file1.txt +SUB 5 +file1.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude02.at:22: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7863,42 +8580,47 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -)" -echo extrac02.at:28 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 1\" +tar cf archive --no-anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 2\" +tar cf archive --anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 3\" +tar cf archive testdir file1.txt +tar t \"file1.txt\" -f archive | sort + +echo \"SUB 4\" +tar t --no-anchored \"file1.txt\" -f archive | sort + +echo \"SUB 5\" +tar t --anchored \"file1.txt\" -f archive | sort + +rm -rf testdir file1.txt + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7907,35 +8629,73 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac02.at:28: +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file2 +SUB 1 +testdir/ +testdir/file2 +SUB 2 +testdir/ +testdir/file1.txt +testdir/file2 +SUB 3 +file1.txt +SUB 4 +file1.txt +testdir/file1.txt +SUB 5 +file1.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude02.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7944,42 +8704,47 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -)" -echo extrac02.at:28 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 1\" +tar cf archive --no-anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 2\" +tar cf archive --anchored \\ + --exclude=\"file1.txt\" \\ + testdir +tar tf archive | sort + +echo \"SUB 3\" +tar cf archive testdir file1.txt +tar t \"file1.txt\" -f archive | sort + +echo \"SUB 4\" +tar t --no-anchored \"file1.txt\" -f archive | sort + +echo \"SUB 5\" +tar t --anchored \"file1.txt\" -f archive | sort + +rm -rf testdir file1.txt + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7988,59 +8753,94 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - +test -z "`sort < /dev/null 2>&1`" || exit 77 - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 20 ) # 20. extrac03.at:23: extraction loops - at_setup_line='extrac03.at:23' - at_desc="extraction loops" - $at_quiet $ECHO_N " 20: extraction loops $ECHO_C" - at_xfail=no +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file2 +SUB 1 +testdir/ +testdir/file2 +SUB 2 +testdir/ +testdir/file1.txt +testdir/file2 +SUB 3 +file1.txt +SUB 4 +file1.txt +testdir/file1.txt +SUB 5 +file1.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_35 +#AT_START_36 +at_fn_group_banner 36 'exclude03.at:19' \ + "exclude: wildcards match slash" " " 7 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "20. extrac03.at:23: testing ..." - $at_traceon +( + $as_echo "36. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/extrac03.at:26: + { set +x +$as_echo "$at_srcdir/exclude03.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -8049,36 +8849,43 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive)" -echo extrac03.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\\*f\\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude='testdir*f*1' \\ + --no-wildcards-match-slash \\ + --exclude='testdir*f*2' \\ + --wildcards-match-slash \\ + --exclude='testdir*f*3' \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -8087,35 +8894,69 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/../directory/ -separator -directory/../directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac03.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir1/* +testdir/dir2/ +testdir/dir2/* +testdir/dir2/file2 +testdir/dir3/ +testdir/dir3/* +NEXT +testdir/*f*1 +testdir/dir1/file1 +NEXT +testdir/*f*1 +NEXT +testdir/*f*1 +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude03.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8124,36 +8965,43 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive)" -echo extrac03.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\\*f\\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude='testdir*f*1' \\ + --no-wildcards-match-slash \\ + --exclude='testdir*f*2' \\ + --wildcards-match-slash \\ + --exclude='testdir*f*3' \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8162,35 +9010,69 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/../directory/ -separator -directory/../directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac03.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir1/* +testdir/dir2/ +testdir/dir2/* +testdir/dir2/file2 +testdir/dir3/ +testdir/dir3/* +NEXT +testdir/*f*1 +testdir/dir1/file1 +NEXT +testdir/*f*1 +NEXT +testdir/*f*1 +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude03.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8199,36 +9081,43 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive)" -echo extrac03.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\\*f\\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude='testdir*f*1' \\ + --no-wildcards-match-slash \\ + --exclude='testdir*f*2' \\ + --wildcards-match-slash \\ + --exclude='testdir*f*3' \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8237,35 +9126,69 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/../directory/ -separator -directory/../directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac03.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir1/* +testdir/dir2/ +testdir/dir2/* +testdir/dir2/file2 +testdir/dir3/ +testdir/dir3/* +NEXT +testdir/*f*1 +testdir/dir1/file1 +NEXT +testdir/*f*1 +NEXT +testdir/*f*1 +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude03.at:22: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8274,36 +9197,43 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive)" -echo extrac03.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\\*f\\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude='testdir*f*1' \\ + --no-wildcards-match-slash \\ + --exclude='testdir*f*2' \\ + --wildcards-match-slash \\ + --exclude='testdir*f*3' \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8312,35 +9242,69 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/../directory/ -separator -directory/../directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac03.at:26: +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir1/* +testdir/dir2/ +testdir/dir2/* +testdir/dir2/file2 +testdir/dir3/ +testdir/dir3/* +NEXT +testdir/*f*1 +testdir/dir1/file1 +NEXT +testdir/*f*1 +NEXT +testdir/*f*1 +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude03.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8349,36 +9313,43 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive)" -echo extrac03.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\\*f\\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\\* +touch testdir/dir2/file2 +touch testdir/dir2/\\* +touch testdir/dir3/file3 +touch testdir/dir3/\\* + +tar cf archive --exclude='testdir*f*1' \\ + --no-wildcards-match-slash \\ + --exclude='testdir*f*2' \\ + --wildcards-match-slash \\ + --exclude='testdir*f*3' \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo \"NEXT\" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8387,59 +9358,90 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/../directory/ -separator -directory/../directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 21 ) # 21. extrac04.at:23: extract + fnmatch - at_setup_line='extrac04.at:23' - at_desc="extract + fnmatch" - $at_quiet $ECHO_N " 21: extract + fnmatch $ECHO_C" - at_xfail=no +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir1/ +testdir/dir1/* +testdir/dir2/ +testdir/dir2/* +testdir/dir2/file2 +testdir/dir3/ +testdir/dir3/* +NEXT +testdir/*f*1 +testdir/dir1/file1 +NEXT +testdir/*f*1 +NEXT +testdir/*f*1 +testdir/dir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_36 +#AT_START_37 +at_fn_group_banner 37 'exclude04.at:19' \ + "exclude: case insensitive" " " 7 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "21. extrac04.at:23: testing ..." - $at_traceon +( + $as_echo "37. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/extrac04.at:26: + { set +x +$as_echo "$at_srcdir/exclude04.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -8449,59 +9451,45 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \\ - --exclude='./*1' \\ - --exclude='d*/*1' \\ - --exclude='d*/s*/*2' | sort -)" -echo extrac04.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +tar cf archive --exclude=FILE2 \\ + --exclude=file1 \\ + --ignore-case \\ + --exclude=file3 \\ + --no-ignore-case \\ + --exclude=FILE2 \\ + --exclude=file4 \\ + testdir +tar tf archive | sort +echo \"SUB 1\" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo \"SUB 2\" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo \"SUB 3\" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -8513,44 +9501,66 @@ rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/file2 -directory/subdirectory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac04.at:26: +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 + +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort + +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort + +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir/ +testdir/dir/File1 +testdir/dir/File2 +testdir/dir/File4 +testdir/file2 +SUB 1 +testdir/dir/File2 +SUB 2 +testdir/dir/File2 +testdir/file2 +SUB 3 +testdir/dir/File2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude04.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8560,59 +9570,45 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \\ - --exclude='./*1' \\ - --exclude='d*/*1' \\ - --exclude='d*/s*/*2' | sort -)" -echo extrac04.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +tar cf archive --exclude=FILE2 \\ + --exclude=file1 \\ + --ignore-case \\ + --exclude=file3 \\ + --no-ignore-case \\ + --exclude=FILE2 \\ + --exclude=file4 \\ + testdir +tar tf archive | sort +echo \"SUB 1\" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo \"SUB 2\" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo \"SUB 3\" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8624,44 +9620,66 @@ rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/file2 -directory/subdirectory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac04.at:26: +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 + +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort + +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort + +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir/ +testdir/dir/File1 +testdir/dir/File2 +testdir/dir/File4 +testdir/file2 +SUB 1 +testdir/dir/File2 +SUB 2 +testdir/dir/File2 +testdir/file2 +SUB 3 +testdir/dir/File2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude04.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8671,59 +9689,45 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \\ - --exclude='./*1' \\ - --exclude='d*/*1' \\ - --exclude='d*/s*/*2' | sort -)" -echo extrac04.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +tar cf archive --exclude=FILE2 \\ + --exclude=file1 \\ + --ignore-case \\ + --exclude=file3 \\ + --no-ignore-case \\ + --exclude=FILE2 \\ + --exclude=file4 \\ + testdir +tar tf archive | sort +echo \"SUB 1\" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo \"SUB 2\" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo \"SUB 3\" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8735,44 +9739,66 @@ rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/file2 -directory/subdirectory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac04.at:26: +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 + +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort + +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort + +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir/ +testdir/dir/File1 +testdir/dir/File2 +testdir/dir/File4 +testdir/file2 +SUB 1 +testdir/dir/File2 +SUB 2 +testdir/dir/File2 +testdir/file2 +SUB 3 +testdir/dir/File2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude04.at:22: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8782,59 +9808,45 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \\ - --exclude='./*1' \\ - --exclude='d*/*1' \\ - --exclude='d*/s*/*2' | sort -)" -echo extrac04.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +tar cf archive --exclude=FILE2 \\ + --exclude=file1 \\ + --ignore-case \\ + --exclude=file3 \\ + --no-ignore-case \\ + --exclude=FILE2 \\ + --exclude=file4 \\ + testdir +tar tf archive | sort +echo \"SUB 1\" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo \"SUB 2\" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo \"SUB 3\" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8846,44 +9858,66 @@ rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/file2 -directory/subdirectory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac04.at:26: +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 + +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort + +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort + +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir/ +testdir/dir/File1 +testdir/dir/File2 +testdir/dir/File4 +testdir/file2 +SUB 1 +testdir/dir/File2 +SUB 2 +testdir/dir/File2 +testdir/file2 +SUB 3 +testdir/dir/File2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude04.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8893,59 +9927,45 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \\ - --exclude='./*1' \\ - --exclude='d*/*1' \\ - --exclude='d*/s*/*2' | sort -)" -echo extrac04.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +tar cf archive --exclude=FILE2 \\ + --exclude=file1 \\ + --ignore-case \\ + --exclude=file3 \\ + --no-ignore-case \\ + --exclude=FILE2 \\ + --exclude=file4 \\ + testdir +tar tf archive | sort +echo \"SUB 1\" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo \"SUB 2\" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo \"SUB 3\" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8957,439 +9977,704 @@ rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/file2 -directory/subdirectory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac04.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 + +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort + +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort + +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/dir/ +testdir/dir/File1 +testdir/dir/File2 +testdir/dir/File4 +testdir/file2 +SUB 1 +testdir/dir/File2 +SUB 2 +testdir/dir/File2 +testdir/file2 +SUB 3 +testdir/dir/File2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_37 +#AT_START_38 +at_fn_group_banner 38 'exclude05.at:21' \ + "exclude: lots of excludes" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "38. $at_setup_line: testing $at_desc ..." + $at_traceon - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + { set +x +$as_echo "$at_srcdir/exclude05.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 22 ) # 22. extrac05.at:30: extracting selected members from pax - at_setup_line='extrac05.at:30' - at_desc="extracting selected members from pax" - $at_quiet $ECHO_N " 22: extracting selected members from pax $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "22. extrac05.at:30: testing ..." - $at_traceon +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print \"testdir/file\" i; }}' < /dev/null | \\ + while read name + do + genfile --file \$name + done -cat >list <<'_ATEOF' -jeden -cztery -_ATEOF +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print \"testdir/file\" i }}' < /dev/null > exclfile +tar cf archive --anchored --exclude-from=exclfile \\ + testdir +tar tf archive | sort +echo \"NEXT\" +tar cf archive --exclude-from=exclfile \\ + testdir +tar tf archive | sort +rm -rf testdir exclfile - $at_traceoff -echo "$at_srcdir/extrac05.at:38: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --length 118 --file jeden -genfile --length 223 --file dwa -genfile --length 517 --file trzy -genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL -genfile --length 110 --file cztery - -tar cf archive jeden dwa trzy cztery || exit 1 - -mkdir dir -cd dir - -tar xvfT ../archive ../../list || exit 1 -cd .. -)" -echo extrac05.at:38 >"$at_check_line_file" +test -z "`sort < /dev/null 2>&1`" || exit 77 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +NEXT +testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude05.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile --length 118 --file jeden -genfile --length 223 --file dwa -genfile --length 517 --file trzy -genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL -genfile --length 110 --file cztery -tar cf archive jeden dwa trzy cztery || exit 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -mkdir dir -cd dir -tar xvfT ../archive ../../list || exit 1 +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print \"testdir/file\" i; }}' < /dev/null | \\ + while read name + do + genfile --file \$name + done -cd .. -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print \"testdir/file\" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \\ + testdir +tar tf archive | sort + +echo \"NEXT\" +tar cf archive --exclude-from=exclfile \\ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --length 118 --file jeden -genfile --length 223 --file dwa -genfile --length 517 --file trzy -genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL -genfile --length 110 --file cztery -tar cf archive jeden dwa trzy cztery || exit 1 - -mkdir dir -cd dir +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar xvfT ../archive ../../list || exit 1 -cd .. -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +NEXT +testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude05.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "jeden -cztery -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac05.at:38: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print \"testdir/file\" i; }}' < /dev/null | \\ + while read name + do + genfile --file \$name + done +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print \"testdir/file\" i }}' < /dev/null > exclfile +tar cf archive --anchored --exclude-from=exclfile \\ + testdir +tar tf archive | sort - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +echo \"NEXT\" +tar cf archive --exclude-from=exclfile \\ + testdir +tar tf archive | sort - 23 ) # 23. extrac06.at:33: mode of extracted directories - at_setup_line='extrac06.at:33' - at_desc="mode of extracted directories" - $at_quiet $ECHO_N " 23: mode of extracted directories $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "23. extrac06.at:33: testing ..." - $at_traceon +rm -rf testdir exclfile +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 - $at_traceoff -echo "$at_srcdir/extrac06.at:36: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +NEXT +testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude05.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print \"testdir/file\" i; }}' < /dev/null | \\ + while read name + do + genfile --file \$name + done -# Archive it -tar cf arc directory +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print \"testdir/file\" i }}' < /dev/null > exclfile -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +tar cf archive --anchored --exclude-from=exclfile \\ + testdir +tar tf archive | sort -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory +echo \"NEXT\" +tar cf archive --exclude-from=exclfile \\ + testdir +tar tf archive | sort -tar xf arc directory -genfile --stat=mode:777 directory +rm -rf testdir exclfile -# After both restores, the directory mode should be 755 )" -echo extrac06.at:36 >"$at_check_line_file" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +NEXT +testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude05.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print \"testdir/file\" i; }}' < /dev/null | \\ + while read name + do + genfile --file \$name + done -# Archive it -tar cf arc directory +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print \"testdir/file\" i }}' < /dev/null > exclfile -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +tar cf archive --anchored --exclude-from=exclfile \\ + testdir +tar tf archive | sort -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory +echo \"NEXT\" +tar cf archive --exclude-from=exclfile \\ + testdir +tar tf archive | sort -tar xf arc directory -genfile --stat=mode:777 directory +rm -rf testdir exclfile -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +NEXT +testdir/ +testdir/file10 +testdir/file11 +testdir/file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_38 +#AT_START_39 +at_fn_group_banner 39 'exclude06.at:26' \ + "exclude: long files in pax archives" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "39. $at_setup_line: testing $at_desc ..." + $at_traceon -# Archive it -tar cf arc directory -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory -tar xf arc directory -genfile --stat=mode:777 directory -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "777 -755 -755 -755 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac06.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + { set +x +$as_echo "$at_srcdir/exclude06.at:31: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac06.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c + +tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen +mkdir out +tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp +find out -type f +)" +at_fn_check_prepare_notrace 'an embedded newline' "exclude06.at:31" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 +install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" +tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen +mkdir out +tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp +find out -type f +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "out/one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude06.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_39 +#AT_START_40 +at_fn_group_banner 40 'exclude07.at:19' \ + "exclude: --exclude-backups option" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "40. $at_setup_line: testing $at_desc ..." + $at_traceon -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory -# Archive it -tar cf arc directory -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory -tar xf arc directory -genfile --stat=mode:777 directory + { set +x +$as_echo "$at_srcdir/exclude07.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * -# After both restores, the directory mode should be 755 -)" -echo extrac06.at:36 >"$at_check_line_file" +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file \"dir/.#file\" +genfile --file \"dir/#file#\" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +tar -v -c -f archive --exclude-backups dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -if test -n "$at_trace_this"; then - ( $at_traceon; +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude07.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file \"dir/.#file\" +genfile --file \"dir/#file#\" -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory - -tar xf arc directory -genfile --stat=mode:777 directory - -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar -v -c -f archive --exclude-backups dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9398,146 +10683,305 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude07.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -# Force umask -umask 022 +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file \"dir/.#file\" +genfile --file \"dir/#file#\" -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" +tar -v -c -f archive --exclude-backups dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude07.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -# Archive it -tar cf arc directory +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file \"dir/.#file\" +genfile --file \"dir/#file#\" -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +tar -v -c -f archive --exclude-backups dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude07.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -tar xf arc directory -genfile --stat=mode:777 directory +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file \"dir/.#file\" +genfile --file \"dir/#file#\" -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar -v -c -f archive --exclude-backups dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "777 -755 -755 -755 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac06.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_40 +#AT_START_41 +at_fn_group_banner 41 'exclude08.at:36' \ + "--exclude-tag option" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "41. $at_setup_line: testing $at_desc ..." + $at_traceon - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac06.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + + + { set +x +$as_echo "$at_srcdir/exclude08.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory -# Archive it -tar cf arc directory +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/subdir/excludeme +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude08.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory -tar xf arc directory -genfile --stat=mode:777 directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# After both restores, the directory mode should be 755 +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort )" -echo extrac06.at:36 >"$at_check_line_file" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/subdir/excludeme +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude08.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory - -tar xf arc directory -genfile --stat=mode:777 directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -9547,59 +10991,29 @@ export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory - -tar xf arc directory -genfile --stat=mode:777 directory - -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "777 -755 -755 -755 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac06.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac06.at:36: +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/subdir/excludeme +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude08.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9609,42 +11023,13 @@ export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory - -tar xf arc directory -genfile --stat=mode:777 directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# After both restores, the directory mode should be 755 +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort )" -echo extrac06.at:36 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9654,100 +11039,98 @@ export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory - -tar xf arc directory -genfile --stat=mode:777 directory +test -z "`sort < /dev/null 2>&1`" || exit 77 -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/subdir/excludeme +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude08.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# Archive it -tar cf arc directory +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar xf arc directory -genfile --stat=mode:777 directory +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/subdir/excludeme +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_41 +#AT_START_42 +at_fn_group_banner 42 'exclude09.at:37' \ + "--exclude-tag option and --listed-incremental" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "42. $at_setup_line: testing $at_desc ..." + $at_traceon -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "777 -755 -755 -755 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac06.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac06.at:36: + { set +x +$as_echo "$at_srcdir/exclude09.at:40: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9757,42 +11140,13 @@ export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory - -tar xf arc directory -genfile --stat=mode:777 directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# After both restores, the directory mode should be 755 +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort )" -echo extrac06.at:36 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude09.at:40" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9802,124 +11156,146 @@ export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new +tar: etest/subdir: Directory is new +tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/subdir/excludeme +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude09.at:40" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_42 +#AT_START_43 +at_fn_group_banner 43 'exclude10.at:38' \ + "--exclude-tag option in incremental pass" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "43. $at_setup_line: testing $at_desc ..." + $at_traceon -# Archive it -tar cf arc directory -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory -tar xf arc directory -genfile --stat=mode:777 directory -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + { set +x +$as_echo "$at_srcdir/exclude10.at:41: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory -genfile --stat=mode:777 directory - -tar xf arc directory -genfile --stat=mode:777 directory - -# After both restores, the directory mode should be 755 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "777 -755 -755 -755 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac06.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -$at_traceon +mkexcltest etest +rm etest/subdir/excludeme +decho \"# Level 0\" +tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile +decho \"# Level 1\" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude10.at:41" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +test -z "`sort < /dev/null 2>&1`" || exit 77 - 24 ) # 24. extrac07.at:27: extracting symlinks to a read-only dir - at_setup_line='extrac07.at:27' - at_desc="extracting symlinks to a read-only dir" - $at_quiet $ECHO_N " 24: extracting symlinks to a read-only dir $ECHO_C" - at_xfail=no +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Level 0 +tar: etest: Directory is new +tar: etest/subdir: Directory is new +# Level 1 +tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Level 0 +etest/ +etest/subdir/ +etest/subdir/subdir-file +etest/top-level-file +# Level 1 +etest/ +etest/subdir/ +etest/subdir/excludeme +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude10.at:41" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_43 +#AT_START_44 +at_fn_group_banner 44 'exclude11.at:36' \ + "--exclude-tag-under option" " " 7 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "24. extrac07.at:27: testing ..." - $at_traceon +( + $as_echo "44. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/extrac07.at:30: + { set +x +$as_echo "$at_srcdir/exclude11.at:39: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -9928,32 +11304,14 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 -chmod +w dir +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Extract -mkdir out -tar -C out -xvf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort )" -echo extrac07.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -9962,82 +11320,29 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir -echo Create the archive -tar cf archive dir || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -chmod +w dir - -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 - -chmod +w dir - -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Prepare the directory -Create the archive -Extract -dir/ -dir/foo -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac07.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -else - ustar -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac07.at:30: +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude11.at:39: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10046,62 +11351,14 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 -chmod +w dir +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Extract -mkdir out -tar -C out -xvf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort )" -echo extrac07.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 - -chmod +w dir - -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10110,52 +11367,29 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 - -chmod +w dir - -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Prepare the directory -Create the archive -Extract -dir/ -dir/foo -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac07.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - echo 1 > "$at_status_file" - exit 1 -else - ustar -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac07.at:30: +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude11.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -10164,62 +11398,14 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 -chmod +w dir +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Extract -mkdir out -tar -C out -xvf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort )" -echo extrac07.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 - -chmod +w dir - -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -10228,52 +11414,29 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 - -chmod +w dir - -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Prepare the directory -Create the archive -Extract -dir/ -dir/foo -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac07.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -else - ustar -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac07.at:30: +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude11.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10282,32 +11445,14 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 -chmod +w dir +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Extract -mkdir out -tar -C out -xvf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort )" -echo extrac07.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10316,82 +11461,97 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir -echo Create the archive -tar cf archive dir || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -chmod +w dir +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude11.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir -echo Create the archive -tar cf archive dir || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -chmod +w dir +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_44 +#AT_START_45 +at_fn_group_banner 45 'exclude12.at:37' \ + "--exclude-tag-under and --listed-incremental" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "45. $at_setup_line: testing $at_desc ..." + $at_traceon -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Prepare the directory -Create the archive -Extract -dir/ -dir/foo -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac07.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -else - ustar -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/extrac07.at:30: + { set +x +$as_echo "$at_srcdir/exclude12.at:40: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10400,62 +11560,92 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir - -echo Create the archive -tar cf archive dir || exit 1 -chmod +w dir +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Extract -mkdir out -tar -C out -xvf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort )" -echo extrac07.at:30 >"$at_check_line_file" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude12.at:40" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new +tar: etest/subdir: Directory is new +tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/subdir/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude12.at:40" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_45 +#AT_START_46 +at_fn_group_banner 46 'exclude13.at:39' \ + "--exclude-tag-under option in incremental pass" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "46. $at_setup_line: testing $at_desc ..." + $at_traceon + -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; + + + { set +x +$as_echo "$at_srcdir/exclude13.at:42: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir -echo Create the archive -tar cf archive dir || exit 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -chmod +w dir +mkexcltest etest +rm etest/subdir/excludeme +decho \"# Level 0\" +tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +decho \"# Level 1\" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude13.at:42" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10464,240 +11654,334 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod -w dir -echo Create the archive -tar cf archive dir || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -chmod +w dir +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Level 0 +tar: etest: Directory is new +tar: etest/subdir: Directory is new +# Level 1 +tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Level 0 +etest/ +etest/subdir/ +etest/subdir/subdir-file +etest/top-level-file +# Level 1 +etest/ +etest/subdir/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude13.at:42" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_46 +#AT_START_47 +at_fn_group_banner 47 'exclude14.at:36' \ + "--exclude-tag-all option" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "47. $at_setup_line: testing $at_desc ..." + $at_traceon -echo Extract -mkdir out -tar -C out -xvf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Prepare the directory -Create the archive -Extract -dir/ -dir/foo -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/extrac07.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -else - ustar -fi -$at_traceon + { set +x +$as_echo "$at_srcdir/exclude14.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * - # Testing one format is enough - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - 25 ) # 25. gzip.at:23: gzip - at_setup_line='gzip.at:23' - at_desc="gzip" - $at_quiet $ECHO_N " 25: gzip $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "25. gzip.at:23: testing ..." - $at_traceon +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 -unset TAR_OPTIONS +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude14.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -$at_traceoff -echo "$at_srcdir/gzip.at:28: -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar xfvz /dev/null -test \$? = 2 || exit 1 -" -echo gzip.at:28 >"$at_check_line_file" +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude14.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -tar xfvz /dev/null -test $? = 2 || exit 1 - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar xfvz /dev/null -test $? = 2 || exit 1 - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -at_failed=false -echo >>"$at_stderr"; echo " -gzip: stdin: unexpected end of file -tar: Child returned status 1 -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/gzip.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude14.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -$at_traceon +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * - 26 ) # 26. incremental.at:23: incremental - at_setup_line='incremental.at:23' - at_desc="incremental" - $at_quiet $ECHO_N " 26: incremental $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "26. incremental.at:23: testing ..." - $at_traceon +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/exclude14.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - $at_traceoff -echo "$at_srcdir/incremental.at:26: +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null +test -z "`sort < /dev/null 2>&1`" || exit 77 -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created \`on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_47 +#AT_START_48 +at_fn_group_banner 48 'exclude15.at:36' \ + "--exclude-tag-all and --listed-incremental" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "48. $at_setup_line: testing $at_desc ..." + $at_traceon -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -)" -echo incremental.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; + + + { set +x +$as_echo "$at_srcdir/exclude15.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created `on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude15.at:39" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10706,143 +11990,199 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null +test -z "`sort < /dev/null 2>&1`" || exit 77 -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created `on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new +tar: etest/subdir: Directory is new +tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "etest/ +etest/top-level-file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude15.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_48 +#AT_START_49 +at_fn_group_banner 49 'exclude16.at:38' \ + "--exclude-tag-all option in incremental pass" " " 7 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "49. $at_setup_line: testing $at_desc ..." + $at_traceon -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "structure/ -separator -structure/ -structure/file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incremental.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/incremental.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + { set +x +$as_echo "$at_srcdir/exclude16.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created \`on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 +mkexcltest etest +rm etest/subdir/excludeme +decho \"# Level 0\" +tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure +decho \"# Level 1\" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort )" -echo incremental.at:26 >"$at_check_line_file" +at_fn_check_prepare_notrace 'a `...` command substitution' "exclude16.at:41" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Level 0 +tar: etest: Directory is new +tar: etest/subdir: Directory is new +# Level 1 +tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Level 0 +etest/ +etest/subdir/ +etest/subdir/subdir-file +etest/top-level-file +# Level 1 +etest/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/exclude16.at:41" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_49 +#AT_START_50 +at_fn_group_banner 50 'delete01.at:23' \ + "deleting a member after a big one" " " 8 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "50. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/delete01.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete01.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created `on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 - -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10851,59 +12191,65 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created `on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 - -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "structure/ -separator -structure/ -structure/file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incremental.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete01.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -$at_traceon -$at_traceoff -echo "$at_srcdir/incremental.at:26: +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete01.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10912,42 +12258,13 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created \`on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 - -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -)" -echo incremental.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10956,227 +12273,138 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created `on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete01.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created `on or after' the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 - -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "structure/ -separator -structure/ -structure/file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incremental.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 27 ) # 27. incr01.at:27: restore broken symlinks from incremental - at_setup_line='incr01.at:27' - at_desc="restore broken symlinks from incremental" - $at_quiet $ECHO_N " 27: restore broken symlinks from incremental $ECHO_C" - at_xfail=no +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar f archive --delete file2 +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_50 +#AT_START_51 +at_fn_group_banner 51 'delete02.at:23' \ + "deleting a member from stdin archive" " " 8 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "27. incr01.at:27: testing ..." - $at_traceon - - - - - - $at_traceoff -echo "$at_srcdir/incr01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * - -mkdir directory -\$as_ln_s foo directory/bar +( + $as_echo "51. $at_setup_line: testing $at_desc ..." + $at_traceon -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory -mv directory orig -tar xvfg archive.0 /dev/null -echo separator -tar xvfg archive.1 /dev/null -)" -echo incr01.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + { set +x +$as_echo "$at_srcdir/delete02.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir directory -$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +tar tf archive2)" +at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/bar +tar tf archive2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "1 +2 +3 separator -directory/ -tar: Deleting \`directory/bar' -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr01.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/incr01.at:30: +1 +3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete02.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -11185,28 +12413,16 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -\$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -)" -echo incr01.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +tar tf archive2)" +at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -11215,72 +12431,84 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir directory -$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +tar tf archive2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "1 +2 +3 +separator +1 +3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete02.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar tf archive2)" +at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/bar +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "1 +2 +3 separator -directory/ -tar: Deleting \`directory/bar' -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr01.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/incr01.at:30: +1 +3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete02.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11289,28 +12517,16 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir directory -\$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -)" -echo incr01.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +tar tf archive2)" +at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11319,198 +12535,127 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +tar tf archive2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "1 +2 +3 +separator +1 +3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete02.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -$as_ln_s foo directory/bar - -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory - -mv directory orig - -tar xvfg archive.0 /dev/null +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 echo separator -tar xvfg archive.1 /dev/null -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/bar -separator -directory/ -tar: Deleting \`directory/bar' -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr01.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 28 ) # 28. incr02.at:32: restoring timestamps from incremental - at_setup_line='incr02.at:32' - at_desc="restoring timestamps from incremental" - $at_quiet $ECHO_N " 28: restoring timestamps from incremental $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "28. incr02.at:32: testing ..." - $at_traceon - - - - - - $at_traceoff -echo "$at_srcdir/incr02.at:35: +tar tf archive2)" +at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "1 +2 +3 +separator +1 +3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, \`dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# \`subdir1' prior to restoring \`dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. -tar -cf archive -g db dir -# Move away the directory -mv dir orig + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_51 +#AT_START_52 +at_fn_group_banner 52 'delete03.at:21' \ + "deleting members with long names" " " 8 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "52. $at_setup_line: testing $at_desc ..." + $at_traceon + -# Wait enough time for timestamps to differ in case of failure. -sleep 5 -# Restore the directory -tar -xf archive dir -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -)" -echo incr02.at:35 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; + + { set +x +$as_echo "$at_srcdir/delete03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, `dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f \$prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch \$prefix\$i +done +tar -cf archive ./\$prefix* && + tar --delete -f archive ./\${prefix}5 && + tar -tf archive +)" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11519,64 +12664,36 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, `dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr02.at:35: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/incr02.at:35: +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f $prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch $prefix$i +done +tar -cf archive ./$prefix* && + tar --delete -f archive ./${prefix}5 && + tar -tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete03.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -11585,51 +12702,18 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, \`dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# \`subdir1' prior to restoring \`dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f \$prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch \$prefix\$i +done +tar -cf archive ./\$prefix* && + tar --delete -f archive ./\${prefix}5 && + tar -tf archive )" -echo incr02.at:35 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -11638,113 +12722,36 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, `dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, `dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr02.at:35: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/incr02.at:35: +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f $prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch $prefix$i +done +tar -cf archive ./$prefix* && + tar --delete -f archive ./${prefix}5 && + tar -tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete03.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11753,100 +12760,18 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, \`dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# \`subdir1' prior to restoring \`dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f \$prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch \$prefix\$i +done +tar -cf archive ./\$prefix* && + tar --delete -f archive ./\${prefix}5 && + tar -tf archive )" -echo incr02.at:35 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, `dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11855,226 +12780,125 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, `dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# `subdir1' prior to restoring `dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr02.at:35: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - echo 1 > "$at_status_file" - exit 1 -fi +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f $prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch $prefix$i +done +tar -cf archive ./$prefix* && + tar --delete -f archive ./${prefix}5 && + tar -tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX1 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX2 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX3 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX4 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX6 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX7 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX8 +./This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 29 ) # 29. listed01.at:26: --listed for individual files - at_setup_line='listed01.at:26' - at_desc="--listed for individual files" - $at_quiet $ECHO_N " 29: --listed for individual files $ECHO_C" - at_xfail=no + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_52 +#AT_START_53 +at_fn_group_banner 53 'delete04.at:23' \ + "deleting a large last member" " " 8 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "29. listed01.at:26: testing ..." - $at_traceon +( + $as_echo "53. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/listed01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + { set +x +$as_echo "$at_srcdir/delete04.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 - -tar --create \\ - --file=archive.1 \\ - --listed-incremental=listing \\ - directory/file* - -tar tf archive.1 || exit 1 - -sleep 2 - -genfile --length 10240 --pattern zeros --file directory/file2 - -echo \"separator\" - -tar --create \\ - --file=archive.2 \\ - --listed-incremental=listing \\ - directory/file* || exit 1 - -tar tf archive.2 || exit 1 +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive )" -echo listed01.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 - -tar --create \ - --file=archive.1 \ - --listed-incremental=listing \ - directory/file* - -tar tf archive.1 || exit 1 - -sleep 2 - -genfile --length 10240 --pattern zeros --file directory/file2 - -echo "separator" - -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 - -tar tf archive.2 || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 - -tar --create \ - --file=archive.1 \ - --listed-incremental=listing \ - directory/file* - -tar tf archive.1 || exit 1 - -sleep 2 - -genfile --length 10240 --pattern zeros --file directory/file2 - -echo "separator" - -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 - -tar tf archive.2 || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/file1 -separator -directory/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/listed01.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/listed01.at:29: +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +file3 +file4 +file5 +file6 +file7 +file8 +file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete04.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12083,40 +12907,22 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 - -tar --create \\ - --file=archive.1 \\ - --listed-incremental=listing \\ - directory/file* - -tar tf archive.1 || exit 1 - -sleep 2 - -genfile --length 10240 --pattern zeros --file directory/file2 - -echo \"separator\" - -tar --create \\ - --file=archive.2 \\ - --listed-incremental=listing \\ - directory/file* || exit 1 - -tar tf archive.2 || exit 1 +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive )" -echo listed01.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12125,118 +12931,175 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 - -tar --create \ - --file=archive.1 \ - --listed-incremental=listing \ - directory/file* - -tar tf archive.1 || exit 1 - -sleep 2 - -genfile --length 10240 --pattern zeros --file directory/file2 - -echo "separator" - -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 - -tar tf archive.2 || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +file3 +file4 +file5 +file6 +file7 +file8 +file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete04.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 - -tar --create \ - --file=archive.1 \ - --listed-incremental=listing \ - directory/file* - -tar tf archive.1 || exit 1 - -sleep 2 - -genfile --length 10240 --pattern zeros --file directory/file2 - -echo "separator" - -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 - -tar tf archive.2 || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/file1 -separator -directory/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/listed01.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 30 ) # 30. listed02.at:28: working --listed - at_setup_line='listed02.at:28' - at_desc="working --listed" - $at_quiet $ECHO_N " 30: working --listed $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "30. listed02.at:28: testing ..." - $at_traceon - - +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +file3 +file4 +file5 +file6 +file7 +file8 +file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete04.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * - $at_traceoff -echo "$at_srcdir/listed02.at:31: +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +file3 +file4 +file5 +file6 +file7 +file8 +file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete04.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12245,71 +13108,22 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -echo Create directories - -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 - -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File \$file > \$file - sleep 1 -done - -sleep 1 -echo Creating main archive -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 - -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err - -sleep 1 -echo Modifying filesystem -rm tart/a1 - -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 - -echo Directory contents -find tart -print | sort 2>/dev/null - -sleep 1 -echo Creating incremental archive -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 - -sleep 1 - -rm -rf tart/* -echo Extracting main archive -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null - -echo Final files: -find tart -print | sort 2>/dev/null +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive )" -echo listed02.at:31 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12318,212 +13132,115 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file2 +file3 +file4 +file5 +file6 +file7 +file8 +file9 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } -test -z "`sort < /dev/null 2>&1`" || exit 77 - -echo Create directories - -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 - -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File $file > $file - sleep 1 -done - -sleep 1 -echo Creating main archive -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err -sleep 1 -echo Modifying filesystem -rm tart/a1 -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_53 +#AT_START_54 +at_fn_group_banner 54 'delete05.at:27' \ + "deleting non-existing member" " " 8 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "54. $at_setup_line: testing $at_desc ..." + $at_traceon -echo Directory contents -find tart -print | sort 2>/dev/null -sleep 1 -echo Creating incremental archive -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 -sleep 1 -rm -rf tart/* -echo Extracting main archive -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null -echo Final files: -find tart -print | sort 2>/dev/null -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + { set +x +$as_echo "$at_srcdir/delete05.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -test -z "`sort < /dev/null 2>&1`" || exit 77 - -echo Create directories - -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 - -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File $file > $file - sleep 1 -done - -sleep 1 -echo Creating main archive -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 - -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err - -sleep 1 -echo Modifying filesystem -rm tart/a1 - -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 - -echo Directory contents -find tart -print | sort 2>/dev/null - -sleep 1 -echo Creating incremental archive -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 - -sleep 1 - -rm -rf tart/* -echo Extracting main archive -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null - -echo Final files: -find tart -print | sort 2>/dev/null -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "tar: tart/c0: Directory is new -tar: tart/c1: Directory is new -tar: tart/c2: Directory has been renamed from \`tart/c1' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Create directories -Creating main archive -tart/ -tart/c0/ -tart/c1/ -tart/a1 -tart/b1 -tart/c0/cq1 -tart/c0/cq2 -tart/c1/ca1 -tart/c1/ca2 -Modifying filesystem -Directory contents -tart -tart/b2 -tart/c0 -tart/c0/cq1 -tart/c0/cq2 -tart/c2 -tart/c2/ca1 -tart/c2/ca2 -tart/c2/ca3 -Creating incremental archive -tart/ -tart/c0/ -tart/c2/ -tart/b2 -tart/c2/ca3 -Extracting main archive -tart/ -tart/c0/ -tart/c1/ -tart/a1 -tart/b1 -tart/c0/cq1 -tart/c0/cq2 -tart/c1/ca1 -tart/c1/ca2 -Extracting incremental archive -tar: Deleting \`tart/a1' -tar: Deleting \`tart/b1' -tart/ -tart/b2 -tart/c0/ -tart/c2/ -tart/c2/ca3 -Final files: -tart -tart/b2 -tart/c0 -tart/c0/cq1 -tart/c0/cq2 -tart/c2 -tart/c2/ca1 -tart/c2/ca2 -tart/c2/ca3 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/listed02.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +genfile -l 1024 -f en +genfile -l 1024 -f to -$at_traceon -$at_traceoff -echo "$at_srcdir/listed02.at:31: +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "en +to +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete05.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12532,71 +13249,17 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -test -z "`sort < /dev/null 2>&1`" || exit 77 - -echo Create directories - -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 - -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File \$file > \$file - sleep 1 -done - -sleep 1 -echo Creating main archive -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 - -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err - -sleep 1 -echo Modifying filesystem -rm tart/a1 - -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 - -echo Directory contents -find tart -print | sort 2>/dev/null - -sleep 1 -echo Creating incremental archive -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 - -sleep 1 - -rm -rf tart/* -echo Extracting main archive -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null - -echo Final files: -find tart -print | sort 2>/dev/null +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive )" -echo listed02.at:31 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12605,236 +13268,138 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -test -z "`sort < /dev/null 2>&1`" || exit 77 - -echo Create directories - -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "en +to +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete05.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File $file > $file - sleep 1 -done +genfile -l 1024 -f en +genfile -l 1024 -f to -sleep 1 -echo Creating main archive -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err +genfile -l 1024 -f en +genfile -l 1024 -f to -sleep 1 -echo Modifying filesystem -rm tart/a1 - -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 - -echo Directory contents -find tart -print | sort 2>/dev/null - -sleep 1 -echo Creating incremental archive -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 - -sleep 1 - -rm -rf tart/* -echo Extracting main archive -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null - -echo Final files: -find tart -print | sort 2>/dev/null -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "en +to +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete05.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -test -z "`sort < /dev/null 2>&1`" || exit 77 - -echo Create directories - -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 - -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File $file > $file - sleep 1 -done - -sleep 1 -echo Creating main archive -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 - -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err - -sleep 1 -echo Modifying filesystem -rm tart/a1 - -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 - -echo Directory contents -find tart -print | sort 2>/dev/null - -sleep 1 -echo Creating incremental archive -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 - -sleep 1 - -rm -rf tart/* -echo Extracting main archive -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null - -echo Final files: -find tart -print | sort 2>/dev/null -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "tar: tart/c0: Directory is new -tar: tart/c1: Directory is new -tar: tart/c2: Directory has been renamed from \`tart/c1' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Create directories -Creating main archive -tart/ -tart/c0/ -tart/c1/ -tart/a1 -tart/b1 -tart/c0/cq1 -tart/c0/cq2 -tart/c1/ca1 -tart/c1/ca2 -Modifying filesystem -Directory contents -tart -tart/b2 -tart/c0 -tart/c0/cq1 -tart/c0/cq2 -tart/c2 -tart/c2/ca1 -tart/c2/ca2 -tart/c2/ca3 -Creating incremental archive -tart/ -tart/c0/ -tart/c2/ -tart/b2 -tart/c2/ca3 -Extracting main archive -tart/ -tart/c0/ -tart/c1/ -tart/a1 -tart/b1 -tart/c0/cq1 -tart/c0/cq2 -tart/c1/ca1 -tart/c1/ca2 -Extracting incremental archive -tar: Deleting \`tart/a1' -tar: Deleting \`tart/b1' -tart/ -tart/b2 -tart/c0/ -tart/c2/ -tart/c2/ca3 -Final files: -tart -tart/b2 -tart/c0 -tart/c0/cq1 -tart/c0/cq2 -tart/c2 -tart/c2/ca1 -tart/c2/ca2 -tart/c2/ca3 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/listed02.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 31 ) # 31. incr03.at:28: renamed files in incrementals - at_setup_line='incr03.at:28' - at_desc="renamed files in incrementals" - $at_quiet $ECHO_N " 31: renamed files in incrementals $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "31. incr03.at:28: testing ..." - $at_traceon - - - +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to - $at_traceoff -echo "$at_srcdir/incr03.at:31: +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "en +to +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/delete05.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12843,44 +13408,17 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive )" -echo incr03.at:31 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12889,114 +13427,92 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -test -z "`sort < /dev/null 2>&1`" || exit 77 +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "en +to +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir directory -genfile --file=directory/x -genfile --file=directory/y -sleep 1 -tar -cf archive.1 -g db directory -mv directory/x directory/z -tar -cf archive.2 -g db directory + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_54 +#AT_START_55 +at_fn_group_banner 55 'extrac01.at:23' \ + "extract over an existing directory" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "55. $at_setup_line: testing $at_desc ..." + $at_traceon -mv directory orig -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + + { set +x +$as_echo "$at_srcdir/extrac01.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Listing of archive.1 -directory/ -directory/x -directory/y -Listing of archive.2 -directory/ -directory/z -Directory after first restore -directory -directory/x -directory/y -Directory after second restore -directory -directory/y -directory/z -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr03.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -$at_traceon -$at_traceoff -echo "$at_srcdir/incr03.at:31: +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac01.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13005,44 +13521,13 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 )" -echo incr03.at:31 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13051,114 +13536,61 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac01.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Listing of archive.1 -directory/ -directory/x -directory/y -Listing of archive.2 -directory/ -directory/z -Directory after first restore -directory -directory/x -directory/y -Directory after second restore -directory -directory/y -directory/z -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr03.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -$at_traceon -$at_traceoff -echo "$at_srcdir/incr03.at:31: +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac01.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13167,44 +13599,13 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 )" -echo incr03.at:31 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13213,140 +13614,256 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir directory -genfile --file=directory/x -genfile --file=directory/y +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac01.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -sleep 1 +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -tar -cf archive.1 -g db directory +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_55 +#AT_START_56 +at_fn_group_banner 56 'extrac02.at:23' \ + "extracting symlinks over an existing file" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "56. $at_setup_line: testing $at_desc ..." + $at_traceon -mv directory/x directory/z -tar -cf archive.2 -g db directory -mv directory orig -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort +# FIXME: Skip if symlinks are not supported on the system -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + + { set +x +$as_echo "$at_srcdir/extrac02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db -find directory | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Listing of archive.1 -directory/ -directory/x -directory/y -Listing of archive.2 -directory/ -directory/z -Directory after first restore -directory -directory/x -directory/y -Directory after second restore -directory -directory/y -directory/z -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr03.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 32 ) # 32. incr04.at:29: proper icontents initialization - at_setup_line='incr04.at:29' - at_desc="proper icontents initialization" - $at_quiet $ECHO_N " 32: proper icontents initialization $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "32. incr04.at:29: testing ..." - $at_traceon - +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac02.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * - $at_traceoff -echo "$at_srcdir/incr04.at:34: +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac02.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13355,30 +13872,15 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * - -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i); - }' < /dev/null | genfile --files-from - - -sleep 1 - -echo \"Initial dump\" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo \"Incremental dump\" -tar cvf a1.tar -g a.sna a +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive )" -echo incr04.at:34 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13387,221 +13889,12423 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_56 +#AT_START_57 +at_fn_group_banner 57 'extrac03.at:23' \ + "extraction loops" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "57. $at_setup_line: testing $at_desc ..." + $at_traceon -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - -sleep 1 -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + + + { set +x +$as_echo "$at_srcdir/extrac03.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/../directory/ +separator +directory/../directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac03.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/../directory/ +separator +directory/../directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac03.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/../directory/ +separator +directory/../directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/../directory/ +separator +directory/../directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac03.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/../directory/ +separator +directory/../directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_57 +#AT_START_58 +at_fn_group_banner 58 'extrac04.at:23' \ + "extract + fnmatch" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "58. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac04.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \\ + --exclude='./*1' \\ + --exclude='d*/*1' \\ + --exclude='d*/s*/*2' | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/file2 +directory/subdirectory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac04.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \\ + --exclude='./*1' \\ + --exclude='d*/*1' \\ + --exclude='d*/s*/*2' | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/file2 +directory/subdirectory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac04.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \\ + --exclude='./*1' \\ + --exclude='d*/*1' \\ + --exclude='d*/s*/*2' | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/file2 +directory/subdirectory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac04.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \\ + --exclude='./*1' \\ + --exclude='d*/*1' \\ + --exclude='d*/s*/*2' | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/file2 +directory/subdirectory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac04.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \\ + --exclude='./*1' \\ + --exclude='d*/*1' \\ + --exclude='d*/s*/*2' | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/file2 +directory/subdirectory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_58 +#AT_START_59 +at_fn_group_banner 59 'extrac05.at:30' \ + "extracting selected members from pax" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "59. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >list <<'_ATEOF' +jeden +cztery +_ATEOF + + + + + { set +x +$as_echo "$at_srcdir/extrac05.at:38: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL || exit 77 +genfile --length 118 --file jeden +genfile --length 223 --file dwa +genfile --length 517 --file trzy +genfile --length 110 --file cztery + +tar cf archive jeden dwa trzy cztery || exit 1 + +mkdir dir +cd dir + +tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 + +cd .. +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac05.at:38" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL || exit 77 +genfile --length 118 --file jeden +genfile --length 223 --file dwa +genfile --length 517 --file trzy +genfile --length 110 --file cztery + +tar cf archive jeden dwa trzy cztery || exit 1 + +mkdir dir +cd dir + +tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 + +cd .. +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "jeden +cztery +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac05.at:38" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_59 +#AT_START_60 +at_fn_group_banner 60 'extrac06.at:34' \ + "mode of extracted directories" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "60. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac06.at:37: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "777 +755 +755 +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac06.at:37: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "777 +755 +755 +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac06.at:37: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "777 +755 +755 +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac06.at:37: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "777 +755 +755 +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac06.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "777 +755 +755 +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_60 +#AT_START_61 +at_fn_group_banner 61 'extrac07.at:27' \ + "extracting symlinks to a read-only dir" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "61. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac07.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +echo Prepare the directory +mkdir dir +genfile -f foo +cd dir +ln -s ../foo . +cd .. +chmod a-w dir + +echo Create the archive +tar cf archive dir || exit 1 + +chmod +w dir + +echo Extract +mkdir out +tar -C out -xvf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac07.at:30" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +echo Prepare the directory +mkdir dir +genfile -f foo +cd dir +ln -s ../foo . +cd .. +chmod a-w dir + +echo Create the archive +tar cf archive dir || exit 1 + +chmod +w dir + +echo Extract +mkdir out +tar -C out -xvf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Prepare the directory +Create the archive +Extract +dir/ +dir/foo +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac07.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Testing one format is enough + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_61 +#AT_START_62 +at_fn_group_banner 62 'extrac08.at:33' \ + "restoring mode on existing directory" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "62. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac08.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac08.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac08.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac08.at:36: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac08.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/file +755 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_62 +#AT_START_63 +at_fn_group_banner 63 'extrac09.at:24' \ + "no need to save dir with unreadable . and .." " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "63. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac09.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +mkdir dir +mkdir dir/sub +mkdir dir/sub/extract +genfile --file dir/sub/f +cd dir/sub + +tar -cf archive.tar f + +chmod a-r . .. +tar -xvf archive.tar -C extract f +status=\$? +chmod a+r . .. +cmp f extract/f || status=\$? +exit \$status +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac09.at:27" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +mkdir dir +mkdir dir/sub +mkdir dir/sub/extract +genfile --file dir/sub/f +cd dir/sub + +tar -cf archive.tar f + +chmod a-r . .. +tar -xvf archive.tar -C extract f +status=$? +chmod a+r . .. +cmp f extract/f || status=$? +exit $status +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "f +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac09.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_63 +#AT_START_64 +at_fn_group_banner 64 'extrac10.at:29' \ + "-C and delayed setting of metadata" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "64. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac10.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir d x x/y +echo foo >d/d1 +echo bar >e + +tar -cf archive.tar d e && +tar -xf archive.tar -C x d -C y e && +diff -r d x/d && +diff e x/y/e +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac10.at:32" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir d x x/y +echo foo >d/d1 +echo bar >e + +tar -cf archive.tar d e && +tar -xf archive.tar -C x d -C y e && +diff -r d x/d && +diff e x/y/e +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac10.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_64 +#AT_START_65 +at_fn_group_banner 65 'extrac11.at:25' \ + "scarce file descriptors" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "65. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac11.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +exec \$dir/\$file || exit + files=\"\$files \$file\" + done +done + +# Check that \"ulimit\" itself works. Close file descriptors before +# invoking ulimit, to work around a bug (or a \"feature\") in some shells, +# where they squirrel away dups of file descriptors into FD 10 and up +# before closing the originals. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 100 && + tar -cf archive1.tar a && + tar -xf archive1.tar -C dest1 a + ) && + diff -r a dest1/a +) >/dev/null 2>&1 || + exit 77 + +# Another test that \"ulimit\" itself works: +# tar should fail when completely starved of file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 4 && + tar -cf archive2.tar a && + tar -xf archive2.tar -C dest2 a + ) && + diff -r a dest2/a +) >/dev/null 2>&1 && + exit 77 + +# Tar should work when there are few, but enough, file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 10 && + tar -cf archive3.tar a && + tar -xf archive3.tar -C dest3 a + ) && + diff -r a dest3/a >/dev/null 2>&1 +) || { diff -r a dest3/a; exit 1; } +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac11.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +exec $dir/$file || exit + files="$files $file" + done +done + +# Check that "ulimit" itself works. Close file descriptors before +# invoking ulimit, to work around a bug (or a "feature") in some shells, +# where they squirrel away dups of file descriptors into FD 10 and up +# before closing the originals. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 100 && + tar -cf archive1.tar a && + tar -xf archive1.tar -C dest1 a + ) && + diff -r a dest1/a +) >/dev/null 2>&1 || + exit 77 + +# Another test that "ulimit" itself works: +# tar should fail when completely starved of file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 4 && + tar -cf archive2.tar a && + tar -xf archive2.tar -C dest2 a + ) && + diff -r a dest2/a +) >/dev/null 2>&1 && + exit 77 + +# Tar should work when there are few, but enough, file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 10 && + tar -cf archive3.tar a && + tar -xf archive3.tar -C dest3 a + ) && + diff -r a dest3/a >/dev/null 2>&1 +) || { diff -r a dest3/a; exit 1; } +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac11.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_65 +#AT_START_66 +at_fn_group_banner 66 'extrac12.at:25' \ + "extract dot permissions" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "66. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac12.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir src dst +echo file1 >src/file1 +echo file2 >src/file2 +chmod a-w src + +tar --no-recursion -cf archive.tar -C src . ./file1 file2 && +tar -xf archive.tar -C dst && +cmp src/file1 dst/file1 && +cmp src/file2 dst/file2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac12.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir src dst +echo file1 >src/file1 +echo file2 >src/file2 +chmod a-w src + +tar --no-recursion -cf archive.tar -C src . ./file1 file2 && +tar -xf archive.tar -C dst && +cmp src/file1 dst/file1 && +cmp src/file2 dst/file2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac12.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_66 +#AT_START_67 +at_fn_group_banner 67 'extrac13.at:26' \ + "extract over symlinks" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "67. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac13.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir src dst1 dst2 dst3 +echo file1 >src/file1 +ln -s target1 dst1/file1 +echo target1 >dst1/target1 +echo target1 >target1 + +tar -cf archive.tar -C src . && +tar -xf archive.tar -C dst1 --warning=no-timestamp && +diff src/file1 dst1/file1 && +diff target1 dst1/target1 + +ln -s target1 dst2/file1 +echo target1 >dst2/target1 +tar --overwrite -xf archive.tar -C dst2 --warning=no-timestamp && +diff src/file1 dst2/file1 && +diff target1 dst2/target1 + +ln -s target1 dst3/file1 +echo target1 >dst3/target1 +tar --overwrite -xhf archive.tar -C dst3 --warning=no-timestamp && +diff src/file1 dst3/file1 && +diff src/file1 dst3/target1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac13.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir src dst1 dst2 dst3 +echo file1 >src/file1 +ln -s target1 dst1/file1 +echo target1 >dst1/target1 +echo target1 >target1 + +tar -cf archive.tar -C src . && +tar -xf archive.tar -C dst1 --warning=no-timestamp && +diff src/file1 dst1/file1 && +diff target1 dst1/target1 + +ln -s target1 dst2/file1 +echo target1 >dst2/target1 +tar --overwrite -xf archive.tar -C dst2 --warning=no-timestamp && +diff src/file1 dst2/file1 && +diff target1 dst2/target1 + +ln -s target1 dst3/file1 +echo target1 >dst3/target1 +tar --overwrite -xhf archive.tar -C dst3 --warning=no-timestamp && +diff src/file1 dst3/file1 && +diff src/file1 dst3/target1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac13.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_67 +#AT_START_68 +at_fn_group_banner 68 'extrac14.at:25' \ + "extract -C symlink" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "68. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac14.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dest +ln -s dest symlink +echo foo >foo +tar -cf archive.tar foo && +tar -xf archive.tar -C symlink --warning=no-timestamp && +cmp foo dest/foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac14.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dest +ln -s dest symlink +echo foo >foo +tar -cf archive.tar foo && +tar -xf archive.tar -C symlink --warning=no-timestamp && +cmp foo dest/foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac14.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_68 +#AT_START_69 +at_fn_group_banner 69 'extrac15.at:25' \ + "extract parent mkdir failure" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "69. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac15.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +mkdir src src/a src/a/b dest dest/a +touch src/a/b/c +chmod a-w dest/a + +tar -cf archive.tar -C src a/b/c && +if tar -xf archive.tar -C dest a/b/c +then (exit 1) +else (exit 0) +fi +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac15.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +mkdir src src/a src/a/b dest dest/a +touch src/a/b/c +chmod a-w dest/a + +tar -cf archive.tar -C src a/b/c && +if tar -xf archive.tar -C dest a/b/c +then (exit 1) +else (exit 0) +fi +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: a/b: Cannot mkdir: Permission denied +tar: a/b/c: Cannot open: No such file or directory +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac15.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_69 +#AT_START_70 +at_fn_group_banner 70 'extrac16.at:26' \ + "extract empty directory with -C" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "70. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac16.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir src src/a src/a/b dest +touch src/a/c + +tar -cf archive.tar -C src a && +tar -xf archive.tar -C dest +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac16.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir src src/a src/a/b dest +touch src/a/c + +tar -cf archive.tar -C src a && +tar -xf archive.tar -C dest +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac16.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_70 +#AT_START_71 +at_fn_group_banner 71 'extrac17.at:21' \ + "name matching/transformation ordering" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "71. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +# Description: Tar 1.24 changed the ordering of name matching and +# name transformation so that the former saw already transformed +# file names (see commit 9c194c99 and exclude06.at). This reverted +# ordering made it impossible to match file names in certain cases. +# In particular, the testcase below would not extract anything. +# +# Reported-by: "Gabor Z. Papp" +# References: , <20101026175126.29028@Pirx.gnu.org.ua> +# http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00047.html + + + + { set +x +$as_echo "$at_srcdir/extrac17.at:34: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\ + dir/subdir1/ +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/subdir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac17.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\ + dir/subdir1/ +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/subdir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac17.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\ + dir/subdir1/ +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/subdir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac17.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\ + dir/subdir1/ +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/subdir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac17.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\ + dir/subdir1/ +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/subdir1/file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_71 +#AT_START_72 +at_fn_group_banner 72 'extrac18.at:34' \ + "keep-old-files" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "72. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac18.at:37: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=2 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac18.at:37: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=2 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac18.at:37: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=2 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac18.at:37: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=2 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac18.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=2 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_72 +#AT_START_73 +at_fn_group_banner 73 'extrac19.at:21' \ + "skip-old-files" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "73. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/extrac19.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=0 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac19.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=0 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac19.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=0 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac19.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=0 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/extrac19.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=\$? + +cat a +)" +at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "status=0 +File a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_73 +#AT_START_74 +at_fn_group_banner 74 'backup01.at:33' \ + "extracting existing dir with --backup" " " 9 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "74. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/backup01.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir1/ +dir1/file1 +Renaming 'dir1/file1' to 'dir1/file1~' +dir2/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/backup01.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir1/ +dir1/file1 +Renaming 'dir1/file1' to 'dir1/file1~' +dir2/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/backup01.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir1/ +dir1/file1 +Renaming 'dir1/file1' to 'dir1/file1~' +dir2/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/backup01.at:36: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir1/ +dir1/file1 +Renaming 'dir1/file1' to 'dir1/file1~' +dir2/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/backup01.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir1/ +dir1/file1 +Renaming 'dir1/file1' to 'dir1/file1~' +dir2/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_74 +#AT_START_75 +at_fn_group_banner 75 'label01.at:21' \ + "single-volume label" " " 10 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "75. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/label01.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Test +foo +bar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label01.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Test +foo +bar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label01.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Test +foo +bar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_75 +#AT_START_76 +at_fn_group_banner 76 'label02.at:21' \ + "multi-volume label" " " 10 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "76. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/label02.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Test Volume 1 +foo +bar +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label02.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Test Volume 1 +foo +bar +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label02.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Test Volume 1 +foo +bar +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_76 +#AT_START_77 +at_fn_group_banner 77 'label03.at:27' \ + "test-label option" " " 10 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "77. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/label03.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho \"# Display label\" +tar --test-label --file=iamanarchive; echo \$? +decho \"# Display label: unlabeled\" +tar --test-label --file=unlabeled.tar; echo \$? +decho \"# Test label: success\" +tar --test-label --file=iamanarchive 'iamalabel'; echo \$? +decho \"# Test label: failure\" +tar --test-label --file=iamanarchive 'amalabel'; echo \$? +decho \"# Test label: unlabeled\" +tar --test-label --file=unlabeled.tar 'amalabel'; echo \$? +decho \"# Test label, verbose: success\" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo \$? +decho \"# Test label, verbose: failure\" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo \$? +decho \"# Test label: multiple arguments\" +tar --test-label --file=iamanarchive a iamalabel b; echo \$? +decho \"# Test label: wildcards\" +tar --test-label --file=iamanarchive --wildcards '*label'; echo \$? +)" +at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho "# Display label" +tar --test-label --file=iamanarchive; echo $? +decho "# Display label: unlabeled" +tar --test-label --file=unlabeled.tar; echo $? +decho "# Test label: success" +tar --test-label --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label: failure" +tar --test-label --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: unlabeled" +tar --test-label --file=unlabeled.tar 'amalabel'; echo $? +decho "# Test label, verbose: success" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label, verbose: failure" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: multiple arguments" +tar --test-label --file=iamanarchive a iamalabel b; echo $? +decho "# Test label: wildcards" +tar --test-label --file=iamanarchive --wildcards '*label'; echo $? +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Display label +# Display label: unlabeled +# Test label: success +# Test label: failure +# Test label: unlabeled +# Test label, verbose: success +# Test label, verbose: failure +tar: Archive label mismatch +# Test label: multiple arguments +# Test label: wildcards +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Display label +iamalabel +0 +# Display label: unlabeled +0 +# Test label: success +0 +# Test label: failure +1 +# Test label: unlabeled +1 +# Test label, verbose: success +iamalabel +0 +# Test label, verbose: failure +iamalabel +1 +# Test label: multiple arguments +0 +# Test label: wildcards +0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label03.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho \"# Display label\" +tar --test-label --file=iamanarchive; echo \$? +decho \"# Display label: unlabeled\" +tar --test-label --file=unlabeled.tar; echo \$? +decho \"# Test label: success\" +tar --test-label --file=iamanarchive 'iamalabel'; echo \$? +decho \"# Test label: failure\" +tar --test-label --file=iamanarchive 'amalabel'; echo \$? +decho \"# Test label: unlabeled\" +tar --test-label --file=unlabeled.tar 'amalabel'; echo \$? +decho \"# Test label, verbose: success\" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo \$? +decho \"# Test label, verbose: failure\" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo \$? +decho \"# Test label: multiple arguments\" +tar --test-label --file=iamanarchive a iamalabel b; echo \$? +decho \"# Test label: wildcards\" +tar --test-label --file=iamanarchive --wildcards '*label'; echo \$? +)" +at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho "# Display label" +tar --test-label --file=iamanarchive; echo $? +decho "# Display label: unlabeled" +tar --test-label --file=unlabeled.tar; echo $? +decho "# Test label: success" +tar --test-label --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label: failure" +tar --test-label --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: unlabeled" +tar --test-label --file=unlabeled.tar 'amalabel'; echo $? +decho "# Test label, verbose: success" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label, verbose: failure" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: multiple arguments" +tar --test-label --file=iamanarchive a iamalabel b; echo $? +decho "# Test label: wildcards" +tar --test-label --file=iamanarchive --wildcards '*label'; echo $? +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Display label +# Display label: unlabeled +# Test label: success +# Test label: failure +# Test label: unlabeled +# Test label, verbose: success +# Test label, verbose: failure +tar: Archive label mismatch +# Test label: multiple arguments +# Test label: wildcards +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Display label +iamalabel +0 +# Display label: unlabeled +0 +# Test label: success +0 +# Test label: failure +1 +# Test label: unlabeled +1 +# Test label, verbose: success +iamalabel +0 +# Test label, verbose: failure +iamalabel +1 +# Test label: multiple arguments +0 +# Test label: wildcards +0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label03.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho \"# Display label\" +tar --test-label --file=iamanarchive; echo \$? +decho \"# Display label: unlabeled\" +tar --test-label --file=unlabeled.tar; echo \$? +decho \"# Test label: success\" +tar --test-label --file=iamanarchive 'iamalabel'; echo \$? +decho \"# Test label: failure\" +tar --test-label --file=iamanarchive 'amalabel'; echo \$? +decho \"# Test label: unlabeled\" +tar --test-label --file=unlabeled.tar 'amalabel'; echo \$? +decho \"# Test label, verbose: success\" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo \$? +decho \"# Test label, verbose: failure\" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo \$? +decho \"# Test label: multiple arguments\" +tar --test-label --file=iamanarchive a iamalabel b; echo \$? +decho \"# Test label: wildcards\" +tar --test-label --file=iamanarchive --wildcards '*label'; echo \$? +)" +at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho "# Display label" +tar --test-label --file=iamanarchive; echo $? +decho "# Display label: unlabeled" +tar --test-label --file=unlabeled.tar; echo $? +decho "# Test label: success" +tar --test-label --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label: failure" +tar --test-label --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: unlabeled" +tar --test-label --file=unlabeled.tar 'amalabel'; echo $? +decho "# Test label, verbose: success" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label, verbose: failure" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: multiple arguments" +tar --test-label --file=iamanarchive a iamalabel b; echo $? +decho "# Test label: wildcards" +tar --test-label --file=iamanarchive --wildcards '*label'; echo $? +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Display label +# Display label: unlabeled +# Test label: success +# Test label: failure +# Test label: unlabeled +# Test label, verbose: success +# Test label, verbose: failure +tar: Archive label mismatch +# Test label: multiple arguments +# Test label: wildcards +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Display label +iamalabel +0 +# Display label: unlabeled +0 +# Test label: success +0 +# Test label: failure +1 +# Test label: unlabeled +1 +# Test label, verbose: success +iamalabel +0 +# Test label, verbose: failure +iamalabel +1 +# Test label: multiple arguments +0 +# Test label: wildcards +0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_77 +#AT_START_78 +at_fn_group_banner 78 'label04.at:27' \ + "label with non-create option" " " 10 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "78. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/label04.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho \"# Create volume\" +tar -c -f archive --label='New volume' file +decho \"# Update: wrong label\" +tar -rf archive --label='My volume' file; echo \$? +decho \"# Update: right label\" +tar -rf archive --label='New volume' file +)" +at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive --label='New volume' file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive --label='New volume' file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Create volume +# Update: wrong label +tar: Volume 'New volume' does not match 'My volume' +tar: Error is not recoverable: exiting now +# Update: right label +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Create volume +# Update: wrong label +2 +# Update: right label +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label04.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho \"# Create volume\" +tar -c -f archive --label='New volume' file +decho \"# Update: wrong label\" +tar -rf archive --label='My volume' file; echo \$? +decho \"# Update: right label\" +tar -rf archive --label='New volume' file +)" +at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive --label='New volume' file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive --label='New volume' file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Create volume +# Update: wrong label +tar: Volume 'New volume' does not match 'My volume' +tar: Error is not recoverable: exiting now +# Update: right label +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Create volume +# Update: wrong label +2 +# Update: right label +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label04.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho \"# Create volume\" +tar -c -f archive --label='New volume' file +decho \"# Update: wrong label\" +tar -rf archive --label='My volume' file; echo \$? +decho \"# Update: right label\" +tar -rf archive --label='New volume' file +)" +at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive --label='New volume' file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive --label='New volume' file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Create volume +# Update: wrong label +tar: Volume 'New volume' does not match 'My volume' +tar: Error is not recoverable: exiting now +# Update: right label +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Create volume +# Update: wrong label +2 +# Update: right label +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_78 +#AT_START_79 +at_fn_group_banner 79 'label05.at:24' \ + "label with non-create option" " " 10 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "79. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/label05.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho \"# Create volume\" +tar -c -f archive file +decho \"# Update: wrong label\" +tar -rf archive --label='My volume' file; echo \$? +decho \"# Update: right label\" +tar -rf archive file +)" +at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Create volume +# Update: wrong label +tar: Archive not labeled to match 'My volume' +tar: Error is not recoverable: exiting now +# Update: right label +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Create volume +# Update: wrong label +2 +# Update: right label +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label05.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho \"# Create volume\" +tar -c -f archive file +decho \"# Update: wrong label\" +tar -rf archive --label='My volume' file; echo \$? +decho \"# Update: right label\" +tar -rf archive file +)" +at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Create volume +# Update: wrong label +tar: Archive not labeled to match 'My volume' +tar: Error is not recoverable: exiting now +# Update: right label +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Create volume +# Update: wrong label +2 +# Update: right label +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/label05.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho \"# Create volume\" +tar -c -f archive file +decho \"# Update: wrong label\" +tar -rf archive --label='My volume' file; echo \$? +decho \"# Update: right label\" +tar -rf archive file +)" +at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "# Create volume +# Update: wrong label +tar: Archive not labeled to match 'My volume' +tar: Error is not recoverable: exiting now +# Update: right label +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Create volume +# Update: wrong label +2 +# Update: right label +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_79 +#AT_START_80 +at_fn_group_banner 80 'incremental.at:23' \ + "incremental" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "80. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incremental.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created \"on or after\" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +)" +at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created "on or after" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "structure/ +separator +structure/ +structure/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incremental.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created \"on or after\" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +)" +at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created "on or after" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "structure/ +separator +structure/ +structure/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incremental.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created \"on or after\" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +)" +at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created "on or after" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "structure/ +separator +structure/ +structure/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_80 +#AT_START_81 +at_fn_group_banner 81 'incr01.at:27' \ + "restore broken symlinks from incremental" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "81. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incr01.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +\$as_ln_s foo directory/bar + +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory + +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +$as_ln_s foo directory/bar + +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory + +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/bar +separator +directory/ +tar: Deleting 'directory/bar' +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +\$as_ln_s foo directory/bar + +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory + +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +$as_ln_s foo directory/bar + +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory + +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/bar +separator +directory/ +tar: Deleting 'directory/bar' +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr01.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +\$as_ln_s foo directory/bar + +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory + +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +$as_ln_s foo directory/bar + +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory + +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/bar +separator +directory/ +tar: Deleting 'directory/bar' +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_81 +#AT_START_82 +at_fn_group_banner 82 'incr02.at:32' \ + "restoring timestamps from incremental" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "82. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incr02.at:35: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr02.at:35: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr02.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_82 +#AT_START_83 +at_fn_group_banner 83 'listed01.at:26' \ + "--listed for individual files" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "83. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/listed01.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +# Let the things settle +sleep 1 + +tar --create \\ + --file=archive.1 \\ + --listed-incremental=listing \\ + directory/file* + +tar tf archive.1 || exit 1 + +sleep 2 + +genfile --length 10240 --pattern zeros --file directory/file2 + +echo \"separator\" +cp listing listing.old +tar --create \\ + --file=archive.2 \\ + --listed-incremental=listing \\ + directory/file* || exit 1 + +tar tf archive.2 || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "listed01.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +# Let the things settle +sleep 1 + +tar --create \ + --file=archive.1 \ + --listed-incremental=listing \ + directory/file* + +tar tf archive.1 || exit 1 + +sleep 2 + +genfile --length 10240 --pattern zeros --file directory/file2 + +echo "separator" +cp listing listing.old +tar --create \ + --file=archive.2 \ + --listed-incremental=listing \ + directory/file* || exit 1 + +tar tf archive.2 || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/file1 +separator +directory/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/listed01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/listed01.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +# Let the things settle +sleep 1 + +tar --create \\ + --file=archive.1 \\ + --listed-incremental=listing \\ + directory/file* + +tar tf archive.1 || exit 1 + +sleep 2 + +genfile --length 10240 --pattern zeros --file directory/file2 + +echo \"separator\" +cp listing listing.old +tar --create \\ + --file=archive.2 \\ + --listed-incremental=listing \\ + directory/file* || exit 1 + +tar tf archive.2 || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "listed01.at:29" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +# Let the things settle +sleep 1 + +tar --create \ + --file=archive.1 \ + --listed-incremental=listing \ + directory/file* + +tar tf archive.1 || exit 1 + +sleep 2 + +genfile --length 10240 --pattern zeros --file directory/file2 + +echo "separator" +cp listing listing.old +tar --create \ + --file=archive.2 \ + --listed-incremental=listing \ + directory/file* || exit 1 + +tar tf archive.2 || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/file1 +separator +directory/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/listed01.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_83 +#AT_START_84 +at_fn_group_banner 84 'listed02.at:28' \ + "working --listed" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "84. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/listed02.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +echo Create directories + +mkdir tart +sleep 1 +mkdir tart/c0 +sleep 1 +mkdir tart/c1 +sleep 1 + +for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 +do + echo File \$file > \$file + sleep 1 +done + +sleep 1 +echo Creating main archive +echo >&2 \"Creating main archive\" +tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 + +# The above prints two lines to stderr announcing the new directories c0 and c1. +# Ensure that they appear in this script's stderr in sorted order. +sort err 1>&2; rm -f err + +sleep 1 +echo Modifying filesystem +rm tart/a1 + +mv tart/b1 tart/b2 +mv tart/c1 tart/c2 +touch tart/c2/ca3 + +echo Directory contents +find tart -print | sort 2>/dev/null + +sleep 1 +echo Creating incremental archive +echo >&2 \"Creating incremental archive\" +cp -p tart.incr1 tart.incr2 +tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 + +sleep 1 + +rm -rf tart/* +echo Extracting main archive +echo >&2 \"Extracting main archive\" +tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 +echo Extracting incremental archive +# This command should produce three messages about deletion +# of the existing files, that may appear in any order. Piping +# to sort makes sure we don't depend on any particular ordering. +tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null + +echo Final files: +find tart -print | sort 2>/dev/null +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "listed02.at:31" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +echo Create directories + +mkdir tart +sleep 1 +mkdir tart/c0 +sleep 1 +mkdir tart/c1 +sleep 1 + +for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 +do + echo File $file > $file + sleep 1 +done + +sleep 1 +echo Creating main archive +echo >&2 "Creating main archive" +tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 + +# The above prints two lines to stderr announcing the new directories c0 and c1. +# Ensure that they appear in this script's stderr in sorted order. +sort err 1>&2; rm -f err + +sleep 1 +echo Modifying filesystem +rm tart/a1 + +mv tart/b1 tart/b2 +mv tart/c1 tart/c2 +touch tart/c2/ca3 + +echo Directory contents +find tart -print | sort 2>/dev/null + +sleep 1 +echo Creating incremental archive +echo >&2 "Creating incremental archive" +cp -p tart.incr1 tart.incr2 +tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 + +sleep 1 + +rm -rf tart/* +echo Extracting main archive +echo >&2 "Extracting main archive" +tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 +echo Extracting incremental archive +# This command should produce three messages about deletion +# of the existing files, that may appear in any order. Piping +# to sort makes sure we don't depend on any particular ordering. +tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null + +echo Final files: +find tart -print | sort 2>/dev/null +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating main archive +tar: tart/c0: Directory is new +tar: tart/c1: Directory is new +tar: tart: Directory is new +Creating incremental archive +tar: tart/c2: Directory has been renamed from 'tart/c1' +Extracting main archive +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Create directories +Creating main archive +tart/ +tart/c0/ +tart/c1/ +tart/a1 +tart/b1 +tart/c0/cq1 +tart/c0/cq2 +tart/c1/ca1 +tart/c1/ca2 +Modifying filesystem +Directory contents +tart +tart/b2 +tart/c0 +tart/c0/cq1 +tart/c0/cq2 +tart/c2 +tart/c2/ca1 +tart/c2/ca2 +tart/c2/ca3 +Creating incremental archive +tart/ +tart/c0/ +tart/c2/ +tart/b2 +tart/c2/ca3 +Extracting main archive +tart/ +tart/c0/ +tart/c1/ +tart/a1 +tart/b1 +tart/c0/cq1 +tart/c0/cq2 +tart/c1/ca1 +tart/c1/ca2 +Extracting incremental archive +tar: Deleting 'tart/a1' +tar: Deleting 'tart/b1' +tart/ +tart/b2 +tart/c0/ +tart/c2/ +tart/c2/ca3 +Final files: +tart +tart/b2 +tart/c0 +tart/c0/cq1 +tart/c0/cq2 +tart/c2 +tart/c2/ca1 +tart/c2/ca2 +tart/c2/ca3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/listed02.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/listed02.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +echo Create directories + +mkdir tart +sleep 1 +mkdir tart/c0 +sleep 1 +mkdir tart/c1 +sleep 1 + +for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 +do + echo File \$file > \$file + sleep 1 +done + +sleep 1 +echo Creating main archive +echo >&2 \"Creating main archive\" +tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 + +# The above prints two lines to stderr announcing the new directories c0 and c1. +# Ensure that they appear in this script's stderr in sorted order. +sort err 1>&2; rm -f err + +sleep 1 +echo Modifying filesystem +rm tart/a1 + +mv tart/b1 tart/b2 +mv tart/c1 tart/c2 +touch tart/c2/ca3 + +echo Directory contents +find tart -print | sort 2>/dev/null + +sleep 1 +echo Creating incremental archive +echo >&2 \"Creating incremental archive\" +cp -p tart.incr1 tart.incr2 +tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 + +sleep 1 + +rm -rf tart/* +echo Extracting main archive +echo >&2 \"Extracting main archive\" +tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 +echo Extracting incremental archive +# This command should produce three messages about deletion +# of the existing files, that may appear in any order. Piping +# to sort makes sure we don't depend on any particular ordering. +tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null + +echo Final files: +find tart -print | sort 2>/dev/null +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "listed02.at:31" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +echo Create directories + +mkdir tart +sleep 1 +mkdir tart/c0 +sleep 1 +mkdir tart/c1 +sleep 1 + +for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 +do + echo File $file > $file + sleep 1 +done + +sleep 1 +echo Creating main archive +echo >&2 "Creating main archive" +tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 + +# The above prints two lines to stderr announcing the new directories c0 and c1. +# Ensure that they appear in this script's stderr in sorted order. +sort err 1>&2; rm -f err + +sleep 1 +echo Modifying filesystem +rm tart/a1 + +mv tart/b1 tart/b2 +mv tart/c1 tart/c2 +touch tart/c2/ca3 + +echo Directory contents +find tart -print | sort 2>/dev/null + +sleep 1 +echo Creating incremental archive +echo >&2 "Creating incremental archive" +cp -p tart.incr1 tart.incr2 +tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 + +sleep 1 + +rm -rf tart/* +echo Extracting main archive +echo >&2 "Extracting main archive" +tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 +echo Extracting incremental archive +# This command should produce three messages about deletion +# of the existing files, that may appear in any order. Piping +# to sort makes sure we don't depend on any particular ordering. +tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null + +echo Final files: +find tart -print | sort 2>/dev/null +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating main archive +tar: tart/c0: Directory is new +tar: tart/c1: Directory is new +tar: tart: Directory is new +Creating incremental archive +tar: tart/c2: Directory has been renamed from 'tart/c1' +Extracting main archive +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Create directories +Creating main archive +tart/ +tart/c0/ +tart/c1/ +tart/a1 +tart/b1 +tart/c0/cq1 +tart/c0/cq2 +tart/c1/ca1 +tart/c1/ca2 +Modifying filesystem +Directory contents +tart +tart/b2 +tart/c0 +tart/c0/cq1 +tart/c0/cq2 +tart/c2 +tart/c2/ca1 +tart/c2/ca2 +tart/c2/ca3 +Creating incremental archive +tart/ +tart/c0/ +tart/c2/ +tart/b2 +tart/c2/ca3 +Extracting main archive +tart/ +tart/c0/ +tart/c1/ +tart/a1 +tart/b1 +tart/c0/cq1 +tart/c0/cq2 +tart/c1/ca1 +tart/c1/ca2 +Extracting incremental archive +tar: Deleting 'tart/a1' +tar: Deleting 'tart/b1' +tart/ +tart/b2 +tart/c0/ +tart/c2/ +tart/c2/ca3 +Final files: +tart +tart/b2 +tart/c0 +tart/c0/cq1 +tart/c0/cq2 +tart/c2 +tart/c2/ca1 +tart/c2/ca2 +tart/c2/ca3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/listed02.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_84 +#AT_START_85 +at_fn_group_banner 85 'listed03.at:24' \ + "incremental dump when the parent directory is unreadable" "" 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "85. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/listed03.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +genfile --file dir/sub/a/file +cd dir/sub + +chmod a-r .. +tar -c -f archive.tar --listed-incremental=db.1 -v a +status=\$? +chmod a+r .. +exit \$status +)" +at_fn_check_prepare_notrace 'an embedded newline' "listed03.at:27" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +genfile --file dir/sub/a/file +cd dir/sub + +chmod a-r .. +tar -c -f archive.tar --listed-incremental=db.1 -v a +status=$? +chmod a+r .. +exit $status +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: a: Directory is new +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "a/ +a/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/listed03.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_85 +#AT_START_86 +at_fn_group_banner 86 'listed04.at:26' \ + "--listed-incremental and --one-file-system" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "86. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/listed04.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +mkdir dir +echo a >dir/a +echo b >dir/b + +tar --one-file-system -cvf archive.tar -g archive.incr dir || exit +tar -tf archive.tar || exit +)" +at_fn_check_prepare_notrace 'an embedded newline' "listed04.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +mkdir dir +echo a >dir/a +echo b >dir/b + +tar --one-file-system -cvf archive.tar -g archive.incr dir || exit +tar -tf archive.tar || exit +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/a +dir/b +dir/ +dir/a +dir/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/listed04.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_86 +#AT_START_87 +at_fn_group_banner 87 'listed05.at:33' \ + "--listed-incremental and remounted directories" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "87. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/listed05.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 + +options=\"-C tartest --create --one-file-system --verbose\" +rm -rf archive-01.snar archive-01.tar tartest subdir + +# Create initial structure +mkdir tartest +echo \"hi\" > tartest/top-level-file +mkdir tartest/subdir +echo \"hi\" > tartest/subdir/subdir-file + +echo \"# Level 0\" +tar \$options --file archive-0.tar --listed-incremental=archive-0.snar . + +echo \"# Remount\" +mv tartest/subdir . +mkdir tartest/subdir +mount -t ramfs none tartest/subdir || exit 77 +tar -C subdir -c -f - . | tar -C tartest/subdir -x -f - + +echo \"# Level 1\" +cp archive-0.snar archive-1.snar +tar \$options --file archive-1.tar --listed-incremental=archive-1.snar . + +umount tartest/subdir +)" +at_fn_check_prepare_notrace 'an embedded newline' "listed05.at:36" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 + +options="-C tartest --create --one-file-system --verbose" +rm -rf archive-01.snar archive-01.tar tartest subdir + +# Create initial structure +mkdir tartest +echo "hi" > tartest/top-level-file +mkdir tartest/subdir +echo "hi" > tartest/subdir/subdir-file + +echo "# Level 0" +tar $options --file archive-0.tar --listed-incremental=archive-0.snar . + +echo "# Remount" +mv tartest/subdir . +mkdir tartest/subdir +mount -t ramfs none tartest/subdir || exit 77 +tar -C subdir -c -f - . | tar -C tartest/subdir -x -f - + +echo "# Level 1" +cp archive-0.snar archive-1.snar +tar $options --file archive-1.tar --listed-incremental=archive-1.snar . + +umount tartest/subdir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: .: Directory is new +tar: ./subdir: Directory is new +tar: ./subdir: directory is on a different filesystem; not dumped +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "# Level 0 +./ +./subdir/ +./top-level-file +./subdir/subdir-file +# Remount +# Level 1 +./ +./subdir/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/listed05.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_87 +#AT_START_88 +at_fn_group_banner 88 'incr03.at:28' \ + "renamed files in incrementals" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "88. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incr03.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:31" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Listing of archive.1 +directory/ +directory/x +directory/y +Listing of archive.2 +directory/ +directory/z +Directory after first restore +directory +directory/x +directory/y +Directory after second restore +directory +directory/y +directory/z +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr03.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:31" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Listing of archive.1 +directory/ +directory/x +directory/y +Listing of archive.2 +directory/ +directory/z +Directory after first restore +directory +directory/x +directory/y +Directory after second restore +directory +directory/y +directory/z +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr03.at:31: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:31" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Listing of archive.1 +directory/ +directory/x +directory/y +Listing of archive.2 +directory/ +directory/z +Directory after first restore +directory +directory/x +directory/y +Directory after second restore +directory +directory/y +directory/z +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_88 +#AT_START_89 +at_fn_group_banner 89 'incr04.at:29' \ + "proper icontents initialization" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "89. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + { set +x +$as_echo "$at_srcdir/incr04.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo \"Initial dump\" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo \"Incremental dump\" +tar cvf a1.tar -g a.sna a +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:34" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo "Initial dump" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo "Incremental dump" +tar cvf a1.tar -g a.sna a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: a: Directory is new +tar: a/b: Directory is new +tar: a/c: Directory has been renamed from 'a/b' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Initial dump +a/ +a/b/ +a/b/one_31_chars_long_file_name_001 +a/b/one_31_chars_long_file_name_002 +a/b/one_31_chars_long_file_name_003 +a/b/one_31_chars_long_file_name_004 +a/b/one_31_chars_long_file_name_005 +a/b/one_31_chars_long_file_name_006 +a/b/one_31_chars_long_file_name_007 +a/b/one_31_chars_long_file_name_008 +a/b/one_31_chars_long_file_name_009 +a/b/one_31_chars_long_file_name_010 +a/b/one_31_chars_long_file_name_011 +a/b/one_31_chars_long_file_name_012 +a/b/one_31_chars_long_file_name_013 +a/b/one_31_chars_long_file_name_014 +a/b/one_31_chars_long_file_name_015 +a/b/one_31_chars_long_file_name_016 +a/b/one_31_chars_long_file_name_017 +a/b/one_31_chars_long_file_name_018 +a/b/one_31_chars_long_file_name_019 +a/b/one_31_chars_long_file_name_020 +a/b/one_31_chars_long_file_name_021 +a/b/one_31_chars_long_file_name_022 +a/b/one_31_chars_long_file_name_023 +a/b/one_31_chars_long_file_name_024 +a/b/one_31_chars_long_file_name_025 +a/b/one_31_chars_long_file_name_026 +a/b/one_31_chars_long_file_name_027 +a/b/one_31_chars_long_file_name_028 +a/b/one_31_chars_long_file_name_029 +a/b/one_31_chars_long_file_name_030 +a/b/one_31_chars_long_file_name_031 +a/b/one_31_chars_long_file_name_032 +a/b/one_31_chars_long_file_name_033 +a/b/one_31_chars_long_file_name_034 +a/b/one_31_chars_long_file_name_035 +a/b/one_31_chars_long_file_name_036 +a/b/one_31_chars_long_file_name_037 +a/b/one_31_chars_long_file_name_038 +a/b/one_31_chars_long_file_name_039 +a/b/one_31_chars_long_file_name_040 +a/b/one_31_chars_long_file_name_041 +a/b/one_31_chars_long_file_name_042 +a/b/one_31_chars_long_file_name_043 +a/b/one_31_chars_long_file_name_044 +a/b/one_31_chars_long_file_name_045 +a/b/one_31_chars_long_file_name_046 +a/b/one_31_chars_long_file_name_047 +a/b/one_31_chars_long_file_name_048 +a/b/one_31_chars_long_file_name_049 +a/b/one_31_chars_long_file_name_050 +a/b/one_31_chars_long_file_name_051 +a/b/one_31_chars_long_file_name_052 +a/b/one_31_chars_long_file_name_053 +a/b/one_31_chars_long_file_name_054 +a/b/one_31_chars_long_file_name_055 +a/b/one_31_chars_long_file_name_056 +a/b/one_31_chars_long_file_name_057 +a/b/one_31_chars_long_file_name_058 +a/b/one_31_chars_long_file_name_059 +a/b/one_31_chars_long_file_name_060 +a/b/one_31_chars_long_file_name_061 +a/b/one_31_chars_long_file_name_062 +a/b/one_31_chars_long_file_name_063 +a/b/one_31_chars_long_file_name_064 +a/b/one_31_chars_long_file_name_065 +a/b/one_31_chars_long_file_name_066 +a/b/one_31_chars_long_file_name_067 +a/b/one_31_chars_long_file_name_068 +a/b/one_31_chars_long_file_name_069 +a/b/one_31_chars_long_file_name_070 +a/b/one_31_chars_long_file_name_071 +a/b/one_31_chars_long_file_name_072 +a/b/one_31_chars_long_file_name_073 +a/b/one_31_chars_long_file_name_074 +a/b/one_31_chars_long_file_name_075 +a/b/one_31_chars_long_file_name_076 +a/b/one_31_chars_long_file_name_077 +a/b/one_31_chars_long_file_name_078 +a/b/one_31_chars_long_file_name_079 +a/b/one_31_chars_long_file_name_080 +a/b/one_31_chars_long_file_name_081 +a/b/one_31_chars_long_file_name_082 +a/b/one_31_chars_long_file_name_083 +a/b/one_31_chars_long_file_name_084 +a/b/one_31_chars_long_file_name_085 +a/b/one_31_chars_long_file_name_086 +a/b/one_31_chars_long_file_name_087 +a/b/one_31_chars_long_file_name_088 +a/b/one_31_chars_long_file_name_089 +a/b/one_31_chars_long_file_name_090 +a/b/one_31_chars_long_file_name_091 +a/b/one_31_chars_long_file_name_092 +a/b/one_31_chars_long_file_name_093 +a/b/one_31_chars_long_file_name_094 +a/b/one_31_chars_long_file_name_095 +a/b/one_31_chars_long_file_name_096 +a/b/one_31_chars_long_file_name_097 +a/b/one_31_chars_long_file_name_098 +a/b/one_31_chars_long_file_name_099 +a/b/one_31_chars_long_file_name_100 +a/b/one_31_chars_long_file_name_101 +a/b/one_31_chars_long_file_name_102 +a/b/one_31_chars_long_file_name_103 +a/b/one_31_chars_long_file_name_104 +a/b/one_31_chars_long_file_name_105 +a/b/one_31_chars_long_file_name_106 +a/b/one_31_chars_long_file_name_107 +a/b/one_31_chars_long_file_name_108 +a/b/one_31_chars_long_file_name_109 +a/b/one_31_chars_long_file_name_110 +a/b/one_31_chars_long_file_name_111 +a/b/one_31_chars_long_file_name_112 +a/b/one_31_chars_long_file_name_113 +a/b/one_31_chars_long_file_name_114 +a/b/one_31_chars_long_file_name_115 +a/b/one_31_chars_long_file_name_116 +a/b/one_31_chars_long_file_name_117 +a/b/one_31_chars_long_file_name_118 +a/b/one_31_chars_long_file_name_119 +a/b/one_31_chars_long_file_name_120 +a/b/one_31_chars_long_file_name_121 +a/b/one_31_chars_long_file_name_122 +a/b/one_31_chars_long_file_name_123 +a/b/one_31_chars_long_file_name_124 +a/b/one_31_chars_long_file_name_125 +a/b/one_31_chars_long_file_name_126 +a/b/one_31_chars_long_file_name_127 +a/b/one_31_chars_long_file_name_128 +a/b/one_31_chars_long_file_name_129 +a/b/one_31_chars_long_file_name_130 +a/b/one_31_chars_long_file_name_131 +a/b/one_31_chars_long_file_name_132 +a/b/one_31_chars_long_file_name_133 +a/b/one_31_chars_long_file_name_134 +a/b/one_31_chars_long_file_name_135 +a/b/one_31_chars_long_file_name_136 +a/b/one_31_chars_long_file_name_137 +a/b/one_31_chars_long_file_name_138 +a/b/one_31_chars_long_file_name_139 +a/b/one_31_chars_long_file_name_140 +a/b/one_31_chars_long_file_name_141 +a/b/one_31_chars_long_file_name_142 +Incremental dump +a/ +a/c/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr04.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo \"Initial dump\" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo \"Incremental dump\" +tar cvf a1.tar -g a.sna a +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:34" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo "Initial dump" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo "Incremental dump" +tar cvf a1.tar -g a.sna a +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: a: Directory is new +tar: a/b: Directory is new +tar: a/c: Directory has been renamed from 'a/b' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Initial dump +a/ +a/b/ +a/b/one_31_chars_long_file_name_001 +a/b/one_31_chars_long_file_name_002 +a/b/one_31_chars_long_file_name_003 +a/b/one_31_chars_long_file_name_004 +a/b/one_31_chars_long_file_name_005 +a/b/one_31_chars_long_file_name_006 +a/b/one_31_chars_long_file_name_007 +a/b/one_31_chars_long_file_name_008 +a/b/one_31_chars_long_file_name_009 +a/b/one_31_chars_long_file_name_010 +a/b/one_31_chars_long_file_name_011 +a/b/one_31_chars_long_file_name_012 +a/b/one_31_chars_long_file_name_013 +a/b/one_31_chars_long_file_name_014 +a/b/one_31_chars_long_file_name_015 +a/b/one_31_chars_long_file_name_016 +a/b/one_31_chars_long_file_name_017 +a/b/one_31_chars_long_file_name_018 +a/b/one_31_chars_long_file_name_019 +a/b/one_31_chars_long_file_name_020 +a/b/one_31_chars_long_file_name_021 +a/b/one_31_chars_long_file_name_022 +a/b/one_31_chars_long_file_name_023 +a/b/one_31_chars_long_file_name_024 +a/b/one_31_chars_long_file_name_025 +a/b/one_31_chars_long_file_name_026 +a/b/one_31_chars_long_file_name_027 +a/b/one_31_chars_long_file_name_028 +a/b/one_31_chars_long_file_name_029 +a/b/one_31_chars_long_file_name_030 +a/b/one_31_chars_long_file_name_031 +a/b/one_31_chars_long_file_name_032 +a/b/one_31_chars_long_file_name_033 +a/b/one_31_chars_long_file_name_034 +a/b/one_31_chars_long_file_name_035 +a/b/one_31_chars_long_file_name_036 +a/b/one_31_chars_long_file_name_037 +a/b/one_31_chars_long_file_name_038 +a/b/one_31_chars_long_file_name_039 +a/b/one_31_chars_long_file_name_040 +a/b/one_31_chars_long_file_name_041 +a/b/one_31_chars_long_file_name_042 +a/b/one_31_chars_long_file_name_043 +a/b/one_31_chars_long_file_name_044 +a/b/one_31_chars_long_file_name_045 +a/b/one_31_chars_long_file_name_046 +a/b/one_31_chars_long_file_name_047 +a/b/one_31_chars_long_file_name_048 +a/b/one_31_chars_long_file_name_049 +a/b/one_31_chars_long_file_name_050 +a/b/one_31_chars_long_file_name_051 +a/b/one_31_chars_long_file_name_052 +a/b/one_31_chars_long_file_name_053 +a/b/one_31_chars_long_file_name_054 +a/b/one_31_chars_long_file_name_055 +a/b/one_31_chars_long_file_name_056 +a/b/one_31_chars_long_file_name_057 +a/b/one_31_chars_long_file_name_058 +a/b/one_31_chars_long_file_name_059 +a/b/one_31_chars_long_file_name_060 +a/b/one_31_chars_long_file_name_061 +a/b/one_31_chars_long_file_name_062 +a/b/one_31_chars_long_file_name_063 +a/b/one_31_chars_long_file_name_064 +a/b/one_31_chars_long_file_name_065 +a/b/one_31_chars_long_file_name_066 +a/b/one_31_chars_long_file_name_067 +a/b/one_31_chars_long_file_name_068 +a/b/one_31_chars_long_file_name_069 +a/b/one_31_chars_long_file_name_070 +a/b/one_31_chars_long_file_name_071 +a/b/one_31_chars_long_file_name_072 +a/b/one_31_chars_long_file_name_073 +a/b/one_31_chars_long_file_name_074 +a/b/one_31_chars_long_file_name_075 +a/b/one_31_chars_long_file_name_076 +a/b/one_31_chars_long_file_name_077 +a/b/one_31_chars_long_file_name_078 +a/b/one_31_chars_long_file_name_079 +a/b/one_31_chars_long_file_name_080 +a/b/one_31_chars_long_file_name_081 +a/b/one_31_chars_long_file_name_082 +a/b/one_31_chars_long_file_name_083 +a/b/one_31_chars_long_file_name_084 +a/b/one_31_chars_long_file_name_085 +a/b/one_31_chars_long_file_name_086 +a/b/one_31_chars_long_file_name_087 +a/b/one_31_chars_long_file_name_088 +a/b/one_31_chars_long_file_name_089 +a/b/one_31_chars_long_file_name_090 +a/b/one_31_chars_long_file_name_091 +a/b/one_31_chars_long_file_name_092 +a/b/one_31_chars_long_file_name_093 +a/b/one_31_chars_long_file_name_094 +a/b/one_31_chars_long_file_name_095 +a/b/one_31_chars_long_file_name_096 +a/b/one_31_chars_long_file_name_097 +a/b/one_31_chars_long_file_name_098 +a/b/one_31_chars_long_file_name_099 +a/b/one_31_chars_long_file_name_100 +a/b/one_31_chars_long_file_name_101 +a/b/one_31_chars_long_file_name_102 +a/b/one_31_chars_long_file_name_103 +a/b/one_31_chars_long_file_name_104 +a/b/one_31_chars_long_file_name_105 +a/b/one_31_chars_long_file_name_106 +a/b/one_31_chars_long_file_name_107 +a/b/one_31_chars_long_file_name_108 +a/b/one_31_chars_long_file_name_109 +a/b/one_31_chars_long_file_name_110 +a/b/one_31_chars_long_file_name_111 +a/b/one_31_chars_long_file_name_112 +a/b/one_31_chars_long_file_name_113 +a/b/one_31_chars_long_file_name_114 +a/b/one_31_chars_long_file_name_115 +a/b/one_31_chars_long_file_name_116 +a/b/one_31_chars_long_file_name_117 +a/b/one_31_chars_long_file_name_118 +a/b/one_31_chars_long_file_name_119 +a/b/one_31_chars_long_file_name_120 +a/b/one_31_chars_long_file_name_121 +a/b/one_31_chars_long_file_name_122 +a/b/one_31_chars_long_file_name_123 +a/b/one_31_chars_long_file_name_124 +a/b/one_31_chars_long_file_name_125 +a/b/one_31_chars_long_file_name_126 +a/b/one_31_chars_long_file_name_127 +a/b/one_31_chars_long_file_name_128 +a/b/one_31_chars_long_file_name_129 +a/b/one_31_chars_long_file_name_130 +a/b/one_31_chars_long_file_name_131 +a/b/one_31_chars_long_file_name_132 +a/b/one_31_chars_long_file_name_133 +a/b/one_31_chars_long_file_name_134 +a/b/one_31_chars_long_file_name_135 +a/b/one_31_chars_long_file_name_136 +a/b/one_31_chars_long_file_name_137 +a/b/one_31_chars_long_file_name_138 +a/b/one_31_chars_long_file_name_139 +a/b/one_31_chars_long_file_name_140 +a/b/one_31_chars_long_file_name_141 +a/b/one_31_chars_long_file_name_142 +Incremental dump +a/ +a/c/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr04.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo \"Initial dump\" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo \"Incremental dump\" +tar cvf a1.tar -g a.sna a +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:34" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - + +sleep 1 -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - - -sleep 1 - echo "Initial dump" tar cvf a0.tar -g a.sna a mv a/b a/c echo "Incremental dump" tar cvf a1.tar -g a.sna a -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: a: Directory is new +tar: a/b: Directory is new +tar: a/c: Directory has been renamed from 'a/b' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Initial dump +a/ +a/b/ +a/b/one_31_chars_long_file_name_001 +a/b/one_31_chars_long_file_name_002 +a/b/one_31_chars_long_file_name_003 +a/b/one_31_chars_long_file_name_004 +a/b/one_31_chars_long_file_name_005 +a/b/one_31_chars_long_file_name_006 +a/b/one_31_chars_long_file_name_007 +a/b/one_31_chars_long_file_name_008 +a/b/one_31_chars_long_file_name_009 +a/b/one_31_chars_long_file_name_010 +a/b/one_31_chars_long_file_name_011 +a/b/one_31_chars_long_file_name_012 +a/b/one_31_chars_long_file_name_013 +a/b/one_31_chars_long_file_name_014 +a/b/one_31_chars_long_file_name_015 +a/b/one_31_chars_long_file_name_016 +a/b/one_31_chars_long_file_name_017 +a/b/one_31_chars_long_file_name_018 +a/b/one_31_chars_long_file_name_019 +a/b/one_31_chars_long_file_name_020 +a/b/one_31_chars_long_file_name_021 +a/b/one_31_chars_long_file_name_022 +a/b/one_31_chars_long_file_name_023 +a/b/one_31_chars_long_file_name_024 +a/b/one_31_chars_long_file_name_025 +a/b/one_31_chars_long_file_name_026 +a/b/one_31_chars_long_file_name_027 +a/b/one_31_chars_long_file_name_028 +a/b/one_31_chars_long_file_name_029 +a/b/one_31_chars_long_file_name_030 +a/b/one_31_chars_long_file_name_031 +a/b/one_31_chars_long_file_name_032 +a/b/one_31_chars_long_file_name_033 +a/b/one_31_chars_long_file_name_034 +a/b/one_31_chars_long_file_name_035 +a/b/one_31_chars_long_file_name_036 +a/b/one_31_chars_long_file_name_037 +a/b/one_31_chars_long_file_name_038 +a/b/one_31_chars_long_file_name_039 +a/b/one_31_chars_long_file_name_040 +a/b/one_31_chars_long_file_name_041 +a/b/one_31_chars_long_file_name_042 +a/b/one_31_chars_long_file_name_043 +a/b/one_31_chars_long_file_name_044 +a/b/one_31_chars_long_file_name_045 +a/b/one_31_chars_long_file_name_046 +a/b/one_31_chars_long_file_name_047 +a/b/one_31_chars_long_file_name_048 +a/b/one_31_chars_long_file_name_049 +a/b/one_31_chars_long_file_name_050 +a/b/one_31_chars_long_file_name_051 +a/b/one_31_chars_long_file_name_052 +a/b/one_31_chars_long_file_name_053 +a/b/one_31_chars_long_file_name_054 +a/b/one_31_chars_long_file_name_055 +a/b/one_31_chars_long_file_name_056 +a/b/one_31_chars_long_file_name_057 +a/b/one_31_chars_long_file_name_058 +a/b/one_31_chars_long_file_name_059 +a/b/one_31_chars_long_file_name_060 +a/b/one_31_chars_long_file_name_061 +a/b/one_31_chars_long_file_name_062 +a/b/one_31_chars_long_file_name_063 +a/b/one_31_chars_long_file_name_064 +a/b/one_31_chars_long_file_name_065 +a/b/one_31_chars_long_file_name_066 +a/b/one_31_chars_long_file_name_067 +a/b/one_31_chars_long_file_name_068 +a/b/one_31_chars_long_file_name_069 +a/b/one_31_chars_long_file_name_070 +a/b/one_31_chars_long_file_name_071 +a/b/one_31_chars_long_file_name_072 +a/b/one_31_chars_long_file_name_073 +a/b/one_31_chars_long_file_name_074 +a/b/one_31_chars_long_file_name_075 +a/b/one_31_chars_long_file_name_076 +a/b/one_31_chars_long_file_name_077 +a/b/one_31_chars_long_file_name_078 +a/b/one_31_chars_long_file_name_079 +a/b/one_31_chars_long_file_name_080 +a/b/one_31_chars_long_file_name_081 +a/b/one_31_chars_long_file_name_082 +a/b/one_31_chars_long_file_name_083 +a/b/one_31_chars_long_file_name_084 +a/b/one_31_chars_long_file_name_085 +a/b/one_31_chars_long_file_name_086 +a/b/one_31_chars_long_file_name_087 +a/b/one_31_chars_long_file_name_088 +a/b/one_31_chars_long_file_name_089 +a/b/one_31_chars_long_file_name_090 +a/b/one_31_chars_long_file_name_091 +a/b/one_31_chars_long_file_name_092 +a/b/one_31_chars_long_file_name_093 +a/b/one_31_chars_long_file_name_094 +a/b/one_31_chars_long_file_name_095 +a/b/one_31_chars_long_file_name_096 +a/b/one_31_chars_long_file_name_097 +a/b/one_31_chars_long_file_name_098 +a/b/one_31_chars_long_file_name_099 +a/b/one_31_chars_long_file_name_100 +a/b/one_31_chars_long_file_name_101 +a/b/one_31_chars_long_file_name_102 +a/b/one_31_chars_long_file_name_103 +a/b/one_31_chars_long_file_name_104 +a/b/one_31_chars_long_file_name_105 +a/b/one_31_chars_long_file_name_106 +a/b/one_31_chars_long_file_name_107 +a/b/one_31_chars_long_file_name_108 +a/b/one_31_chars_long_file_name_109 +a/b/one_31_chars_long_file_name_110 +a/b/one_31_chars_long_file_name_111 +a/b/one_31_chars_long_file_name_112 +a/b/one_31_chars_long_file_name_113 +a/b/one_31_chars_long_file_name_114 +a/b/one_31_chars_long_file_name_115 +a/b/one_31_chars_long_file_name_116 +a/b/one_31_chars_long_file_name_117 +a/b/one_31_chars_long_file_name_118 +a/b/one_31_chars_long_file_name_119 +a/b/one_31_chars_long_file_name_120 +a/b/one_31_chars_long_file_name_121 +a/b/one_31_chars_long_file_name_122 +a/b/one_31_chars_long_file_name_123 +a/b/one_31_chars_long_file_name_124 +a/b/one_31_chars_long_file_name_125 +a/b/one_31_chars_long_file_name_126 +a/b/one_31_chars_long_file_name_127 +a/b/one_31_chars_long_file_name_128 +a/b/one_31_chars_long_file_name_129 +a/b/one_31_chars_long_file_name_130 +a/b/one_31_chars_long_file_name_131 +a/b/one_31_chars_long_file_name_132 +a/b/one_31_chars_long_file_name_133 +a/b/one_31_chars_long_file_name_134 +a/b/one_31_chars_long_file_name_135 +a/b/one_31_chars_long_file_name_136 +a/b/one_31_chars_long_file_name_137 +a/b/one_31_chars_long_file_name_138 +a/b/one_31_chars_long_file_name_139 +a/b/one_31_chars_long_file_name_140 +a/b/one_31_chars_long_file_name_141 +a/b/one_31_chars_long_file_name_142 +Incremental dump +a/ +a/c/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_89 +#AT_START_90 +at_fn_group_banner 90 'incr05.at:21' \ + "incremental dumps with -C" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "90. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incr05.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Level 0 +./ +./sub/ +./file1 +./sub/file2 +Level 1 +./ +./sub/ +./file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr05.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Level 0 +./ +./sub/ +./file1 +./sub/file2 +Level 1 +./ +./sub/ +./file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr05.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Level 0 +./ +./sub/ +./file1 +./sub/file2 +Level 1 +./ +./sub/ +./file3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_90 +#AT_START_91 +at_fn_group_banner 91 'incr06.at:21' \ + "incremental dumps of nested directories" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "91. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incr06.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 + +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 + +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Level 0 . sub +./ +sub/ +sub/a/ +sub/b/ +./file1 +sub/file2 +sub/a/file3 +Level 0 sub . +./ +sub/ +sub/a/ +sub/b/ +./file1 +sub/file2 +sub/a/file3 +Level 1 . sub +./ +./c/ +sub/ +sub/a/ +sub/b/ +sub/b/file4 +Level 1 sub . +./ +./c/ +sub/ +sub/a/ +sub/b/ +sub/b/file4 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr06.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 + +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 + +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Level 0 . sub +./ +sub/ +sub/a/ +sub/b/ +./file1 +sub/file2 +sub/a/file3 +Level 0 sub . +./ +sub/ +sub/a/ +sub/b/ +./file1 +sub/file2 +sub/a/file3 +Level 1 . sub +./ +./c/ +sub/ +sub/a/ +sub/b/ +sub/b/file4 +Level 1 sub . +./ +./c/ +sub/ +sub/a/ +sub/b/ +sub/b/file4 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr06.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 + +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 + +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Level 0 . sub +./ +sub/ +sub/a/ +sub/b/ +./file1 +sub/file2 +sub/a/file3 +Level 0 sub . +./ +sub/ +sub/a/ +sub/b/ +./file1 +sub/file2 +sub/a/file3 +Level 1 . sub +./ +./c/ +sub/ +sub/a/ +sub/b/ +sub/b/file4 +Level 1 sub . +./ +./c/ +sub/ +sub/a/ +sub/b/ +sub/b/file4 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_91 +#AT_START_92 +at_fn_group_banner 92 'incr07.at:18' \ + "incremental restores with -C" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "92. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +# Tar 1.26 had problems extracting from incremental restores when given +# the -C option. The code in incremen.c:try_purge_directory and +# misc.c:remove_any_file was using savedir(), which ignored eventual changes +# in the current working directory and caused the malfunctioning. +# +# The problem was reported by Piotr Rotter on 2013-03-22. +# +# This testcase is based on scripts provided by Piotr Rotter and Nathan +# Stratton Treadway. +# +# References: <514C8F56.90900@active24.pl>, +# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00036.html, +# <20130326181922.GZ3732@shire.ontko.com>, +# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00042.html, +# <20130327051828.GA3732@shire.ontko.com>, +# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00043.html, +# <20130327054957.GB3732@shire.ontko.com>, +# http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00044.html + + + + { set +x +$as_echo "$at_srcdir/incr07.at:40: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir A +echo 'a' > A/a +echo 'a' > A/b + +decho C0 +tar -g test.snar -vcf test.0.tar A + +echo 'a' > A/c +decho C1 +tar -g test.snar -vcf test.1.tar A + +rm -f A/a +decho C2 +tar -g test.snar -vcf test.2.tar A + +mkdir ext +rm -rf A + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/A/B +touch ext/A/B/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d A && echo >&2 \"toplevel A exists\" +exit 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir A +echo 'a' > A/a +echo 'a' > A/b + +decho C0 +tar -g test.snar -vcf test.0.tar A + +echo 'a' > A/c +decho C1 +tar -g test.snar -vcf test.1.tar A + +rm -f A/a +decho C2 +tar -g test.snar -vcf test.2.tar A + +mkdir ext +rm -rf A + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/A/B +touch ext/A/B/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d A && echo >&2 "toplevel A exists" +exit 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "C0 +tar: A: Directory is new +C1 +C2 +E0 +E1 +E2 +E3 +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "C0 +A/ +A/a +A/b +C1 +A/ +A/c +C2 +A/ +E0 +A/ +A/a +A/b +E1 +A/ +A/c +E2 +A/ +tar: Deleting 'A/a' +E3 +A/ +tar: Deleting 'A/B' +FIN +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr07.at:40: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir A +echo 'a' > A/a +echo 'a' > A/b + +decho C0 +tar -g test.snar -vcf test.0.tar A + +echo 'a' > A/c +decho C1 +tar -g test.snar -vcf test.1.tar A + +rm -f A/a +decho C2 +tar -g test.snar -vcf test.2.tar A + +mkdir ext +rm -rf A + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/A/B +touch ext/A/B/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d A && echo >&2 \"toplevel A exists\" +exit 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir A +echo 'a' > A/a +echo 'a' > A/b + +decho C0 +tar -g test.snar -vcf test.0.tar A + +echo 'a' > A/c +decho C1 +tar -g test.snar -vcf test.1.tar A + +rm -f A/a +decho C2 +tar -g test.snar -vcf test.2.tar A + +mkdir ext +rm -rf A + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/A/B +touch ext/A/B/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d A && echo >&2 "toplevel A exists" +exit 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "C0 +tar: A: Directory is new +C1 +C2 +E0 +E1 +E2 +E3 +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "C0 +A/ +A/a +A/b +C1 +A/ +A/c +C2 +A/ +E0 +A/ +A/a +A/b +E1 +A/ +A/c +E2 +A/ +tar: Deleting 'A/a' +E3 +A/ +tar: Deleting 'A/B' +FIN +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/incr07.at:40: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir A +echo 'a' > A/a +echo 'a' > A/b + +decho C0 +tar -g test.snar -vcf test.0.tar A + +echo 'a' > A/c +decho C1 +tar -g test.snar -vcf test.1.tar A + +rm -f A/a +decho C2 +tar -g test.snar -vcf test.2.tar A + +mkdir ext +rm -rf A + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/A/B +touch ext/A/B/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d A && echo >&2 \"toplevel A exists\" +exit 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir A +echo 'a' > A/a +echo 'a' > A/b + +decho C0 +tar -g test.snar -vcf test.0.tar A + +echo 'a' > A/c +decho C1 +tar -g test.snar -vcf test.1.tar A + +rm -f A/a +decho C2 +tar -g test.snar -vcf test.2.tar A + +mkdir ext +rm -rf A + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/A/B +touch ext/A/B/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d A && echo >&2 "toplevel A exists" +exit 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "C0 +tar: A: Directory is new +C1 +C2 +E0 +E1 +E2 +E3 +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "C0 +A/ +A/a +A/b +C1 +A/ +A/c +C2 +A/ +E0 +A/ +A/a +A/b +E1 +A/ +A/c +E2 +A/ +tar: Deleting 'A/a' +E3 +A/ +tar: Deleting 'A/B' +FIN +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_92 +#AT_START_93 +at_fn_group_banner 93 'incr08.at:38' \ + "filename normalization" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "93. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incr08.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir tartest +cd tartest +mkdir foo +mkdir foo/subdir +mkdir foo/subdir/dir1 +mkdir subdir +mkdir subdir/dir2 +decho A +find .|sort + +decho B +DIR=\`pwd\` +tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . \$DIR 2>../err |\\ + sed \"s|\$DIR|ABSPATH|\" +sed \"s|\$DIR|ABSPATH|\" ../err >&2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "incr08.at:41" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir tartest +cd tartest +mkdir foo +mkdir foo/subdir +mkdir foo/subdir/dir1 +mkdir subdir +mkdir subdir/dir2 +decho A +find .|sort + +decho B +DIR=`pwd` +tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR 2>../err |\ + sed "s|$DIR|ABSPATH|" +sed "s|$DIR|ABSPATH|" ../err >&2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +tar: .: Directory is new +tar: ./subdir: Directory is new +tar: ./subdir/dir1: Directory is new +tar: ABSPATH: Directory is new +tar: ABSPATH/subdir: Directory is new +tar: ABSPATH/subdir/dir2: Directory is new +tar: Removing leading \`/' from member names +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./foo +./foo/subdir +./foo/subdir/dir1 +./subdir +./subdir/dir2 +B +./ +./subdir/ +./subdir/dir1/ +ABSPATH/ +ABSPATH/subdir/ +ABSPATH/subdir/dir2/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr08.at:41" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_93 +#AT_START_94 +at_fn_group_banner 94 'incr09.at:26' \ + "incremental with alternating -C" " " 11 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "94. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/incr09.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir foo bar middle +echo foo/foo_file > foo/foo_file +echo bar/bar_file > bar/bar_file +echo middle/file > middle/middle_file +decho A +tar -cvf foo.tar --incremental -C foo . -C \`pwd\` middle -C bar . + +rm foo.tar +>toplevel_file +decho B +tar -cvf foo.tar --incremental -C foo . -C \`pwd\` toplevel_file -C bar . +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "incr09.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo bar middle +echo foo/foo_file > foo/foo_file +echo bar/bar_file > bar/bar_file +echo middle/file > middle/middle_file +decho A +tar -cvf foo.tar --incremental -C foo . -C `pwd` middle -C bar . + +rm foo.tar +>toplevel_file +decho B +tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file -C bar . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +tar: .: Directory is new +tar: middle: Directory is new +tar: .: Directory is new +B +tar: .: Directory is new +tar: .: Directory is new +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +./ +./ +middle/ +./bar_file +./foo_file +middle/middle_file +B +./ +./ +toplevel_file +./bar_file +./foo_file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/incr09.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_94 +#AT_START_95 +at_fn_group_banner 95 'filerem01.at:36' \ + "file removed as we read it (ca. 22 seconds)" " " 12 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "95. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/filerem01.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +genfile --run --checkpoint=3 --unlink dir/file1 -- \\ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\ + --checkpoint-action='echo' -c -f archive.tar \\ + --listed-incremental db -v dir >/dev/null +)" +at_fn_check_prepare_notrace 'an embedded newline' "filerem01.at:39" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +genfile --run --checkpoint=3 --unlink dir/file1 -- \ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \ + --checkpoint-action='echo' -c -f archive.tar \ + --listed-incremental db -v dir >/dev/null +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new +tar: dir/sub: Directory is new +tar: dir/file1: File removed before we read it +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/filerem01.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/filerem01.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +genfile --run --checkpoint=3 --unlink dir/file1 -- \\ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\ + --checkpoint-action='echo' -c -f archive.tar \\ + --listed-incremental db -v dir >/dev/null +)" +at_fn_check_prepare_notrace 'an embedded newline' "filerem01.at:39" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 + +genfile --run --checkpoint=3 --unlink dir/file1 -- \ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \ + --checkpoint-action='echo' -c -f archive.tar \ + --listed-incremental db -v dir >/dev/null +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new +tar: dir/sub: Directory is new +tar: dir/file1: File removed before we read it +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/filerem01.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Timing information: +# +# For -Hgnu the above command line takes about 8 seconds to execute and +# produces: +# +# tar: dir: Directory is new +# tar: dir/sub: Directory is new +# dir/ +# tar: Write checkpoint 1 +# tar: Write checkpoint 2 +# dir/sub/ +# tar: Write checkpoint 3 +# tar: Write checkpoint 4 +# dir/file1 +# tar: Write checkpoint 5 +# dir/sub/file2 +# tar: Write checkpoint 6 +# tar: Write checkpoint 7 +# tar: Write checkpoint 8 +# +# For -Hposix the above command line takes about 14 seconds to execute and +# produces: +# +# ./tar: dir: Directory is new +# ./tar: dir/sub: Directory is new +# dir/ +# ./tar: Write checkpoint 1 +# ./tar: Write checkpoint 2 +# ./tar: Write checkpoint 3 +# dir/sub/ +# ./tar: Write checkpoint 4 +# ./tar: Write checkpoint 5 +# ./tar: Write checkpoint 6 +# dir/file1 +# ./tar: Write checkpoint 7 +# ./tar: Write checkpoint 8 +# ./tar: Write checkpoint 9 +# dir/sub/file2 +# ./tar: Write checkpoint 10 +# ./tar: Write checkpoint 11 +# ./tar: Write checkpoint 12 +# ./tar: Write checkpoint 13 +# ./tar: Write checkpoint 14 + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_95 +#AT_START_96 +at_fn_group_banner 96 'filerem02.at:26' \ + "toplevel file removed (ca. 24 seconds)" " " 12 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "96. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/filerem02.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 + +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \\ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\ + --checkpoint-action='echo' -c -f archive.tar \\ + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null +)" +at_fn_check_prepare_notrace 'an embedded newline' "filerem02.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 + +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \ + --checkpoint-action='echo' -c -f archive.tar \ + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 2 $at_status "$at_srcdir/filerem02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/filerem02.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 + +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \\ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\ + --checkpoint-action='echo' -c -f archive.tar \\ + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null +)" +at_fn_check_prepare_notrace 'an embedded newline' "filerem02.at:29" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 + +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ + tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \ + --checkpoint-action='echo' -c -f archive.tar \ + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 2 $at_status "$at_srcdir/filerem02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Ignore stdout and stderr because their contents depend on +# the file system implementation. + +# Timing information: see filerem01.at + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_96 +#AT_START_97 +at_fn_group_banner 97 'rename01.at:24' \ + "renamed dirs in incrementals" " " 13 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "97. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/rename01.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo \"Creating base archive\" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo \"Creating incremental archive\" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:27" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new +tar: foo/bar: Directory is new +tar: foo/baz: Directory has been renamed from 'foo/bar' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating base archive +foo/ +foo/bar/ +foo/file1 +foo/file2 +foo/bar/file +Creating incremental archive +foo/ +foo/baz/ +Begin directory listing 1 +foo +foo/bar +foo/bar/file +foo/file1 +foo/file2 +End directory listing 1 +Begin directory listing 2 +foo +foo/baz +foo/baz/file +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename01.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo \"Creating base archive\" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo \"Creating incremental archive\" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:27" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new +tar: foo/bar: Directory is new +tar: foo/baz: Directory has been renamed from 'foo/bar' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating base archive +foo/ +foo/bar/ +foo/file1 +foo/file2 +foo/bar/file +Creating incremental archive +foo/ +foo/baz/ +Begin directory listing 1 +foo +foo/bar +foo/bar/file +foo/file1 +foo/file2 +End directory listing 1 +Begin directory listing 2 +foo +foo/baz +foo/baz/file +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename01.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo \"Creating base archive\" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo \"Creating incremental archive\" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:27" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new +tar: foo/bar: Directory is new +tar: foo/baz: Directory has been renamed from 'foo/bar' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating base archive +foo/ +foo/bar/ +foo/file1 +foo/file2 +foo/bar/file +Creating incremental archive +foo/ +foo/baz/ +Begin directory listing 1 +foo +foo/bar +foo/bar/file +foo/file1 +foo/file2 +End directory listing 1 +Begin directory listing 2 +foo +foo/baz +foo/baz/file +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_97 +#AT_START_98 +at_fn_group_banner 98 'rename02.at:24' \ + "move between hierarchies" " " 13 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "98. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/rename02.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo \"Creating base archive\" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo \"Creating incremental archive\" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:27" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new +tar: foo/bar: Directory is new +tar: foo/bar/baz: Directory is new +tar: foo/baz: Directory has been renamed from 'foo/bar/baz' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating base archive +foo/ +foo/bar/ +foo/bar/baz/ +foo/file1 +foo/file2 +foo/bar/file.r +foo/bar/baz/file.z +Creating incremental archive +foo/ +foo/bar/ +foo/baz/ +Begin directory listing 1 +foo +foo/bar +foo/bar/baz +foo/bar/baz/file.z +foo/bar/file.r +foo/file1 +foo/file2 +End directory listing 1 +foo/ +foo/bar/ +foo/baz/ +Begin directory listing 2 +foo +foo/bar +foo/bar/file.r +foo/baz +foo/baz/file.z +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename02.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo \"Creating base archive\" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo \"Creating incremental archive\" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:27" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new +tar: foo/bar: Directory is new +tar: foo/bar/baz: Directory is new +tar: foo/baz: Directory has been renamed from 'foo/bar/baz' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating base archive +foo/ +foo/bar/ +foo/bar/baz/ +foo/file1 +foo/file2 +foo/bar/file.r +foo/bar/baz/file.z +Creating incremental archive +foo/ +foo/bar/ +foo/baz/ +Begin directory listing 1 +foo +foo/bar +foo/bar/baz +foo/bar/baz/file.z +foo/bar/file.r +foo/file1 +foo/file2 +End directory listing 1 +foo/ +foo/bar/ +foo/baz/ +Begin directory listing 2 +foo +foo/bar +foo/bar/file.r +foo/baz +foo/baz/file.z +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename02.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo \"Creating base archive\" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo \"Creating incremental archive\" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:27" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new +tar: foo/bar: Directory is new +tar: foo/bar/baz: Directory is new +tar: foo/baz: Directory has been renamed from 'foo/bar/baz' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating base archive +foo/ +foo/bar/ +foo/bar/baz/ +foo/file1 +foo/file2 +foo/bar/file.r +foo/bar/baz/file.z +Creating incremental archive +foo/ +foo/bar/ +foo/baz/ +Begin directory listing 1 +foo +foo/bar +foo/bar/baz +foo/bar/baz/file.z +foo/bar/file.r +foo/file1 +foo/file2 +End directory listing 1 +foo/ +foo/bar/ +foo/baz/ +Begin directory listing 2 +foo +foo/bar +foo/bar/file.r +foo/baz +foo/baz/file.z +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_98 +#AT_START_99 +at_fn_group_banner 99 'rename03.at:23' \ + "cyclic renames" " " 13 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "99. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/rename03.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo \"First dump\" +echo \"First dump\">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a \$\$ +mv c a +mv b c +mv \$\$ b) + +echo \"Second dump\" +echo \"Second dump\" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a $$ +mv c a +mv b c +mv $$ b) + +echo "Second dump" +echo "Second dump" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "First dump +tar: foo/a: Directory is new +tar: foo/b: Directory is new +tar: foo/c: Directory is new +tar: foo: Directory is new +Second dump +tar: foo/a: Directory has been renamed from 'foo/c' +tar: foo/b: Directory has been renamed from 'foo/a' +tar: foo/c: Directory has been renamed from 'foo/b' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "First dump +foo/ +foo/a/ +foo/b/ +foo/c/ +foo/file1 +foo/file2 +foo/a/filea +foo/b/fileb +foo/c/filec +Second dump +foo/ +foo/a/ +foo/b/ +foo/c/ +Begin directory listing 1 +foo +foo/a +foo/a/filea +foo/b +foo/b/fileb +foo/c +foo/c/filec +foo/file1 +foo/file2 +End directory listing 1 +foo/ +foo/a/ +foo/b/ +foo/c/ +Begin directory listing 2 +foo +foo/a +foo/a/filec +foo/b +foo/b/filea +foo/c +foo/c/fileb +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename03.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo \"First dump\" +echo \"First dump\">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a \$\$ +mv c a +mv b c +mv \$\$ b) + +echo \"Second dump\" +echo \"Second dump\" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:26" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a $$ +mv c a +mv b c +mv $$ b) + +echo "Second dump" +echo "Second dump" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "First dump +tar: foo/a: Directory is new +tar: foo/b: Directory is new +tar: foo/c: Directory is new +tar: foo: Directory is new +Second dump +tar: foo/a: Directory has been renamed from 'foo/c' +tar: foo/b: Directory has been renamed from 'foo/a' +tar: foo/c: Directory has been renamed from 'foo/b' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "First dump +foo/ +foo/a/ +foo/b/ +foo/c/ +foo/file1 +foo/file2 +foo/a/filea +foo/b/fileb +foo/c/filec +Second dump +foo/ +foo/a/ +foo/b/ +foo/c/ +Begin directory listing 1 +foo +foo/a +foo/a/filea +foo/b +foo/b/fileb +foo/c +foo/c/filec +foo/file1 +foo/file2 +End directory listing 1 +foo/ +foo/a/ +foo/b/ +foo/c/ +Begin directory listing 2 +foo +foo/a +foo/a/filec +foo/b +foo/b/filea +foo/c +foo/c/fileb +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo \"First dump\" +echo \"First dump\">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a \$\$ +mv c a +mv b c +mv \$\$ b) + +echo \"Second dump\" +echo \"Second dump\" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo \"Begin directory listing 1\" +find foo | sort +echo \"End directory listing 1\" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:26" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a $$ +mv c a +mv b c +mv $$ b) + +echo "Second dump" +echo "Second dump" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "First dump +tar: foo/a: Directory is new +tar: foo/b: Directory is new +tar: foo/c: Directory is new +tar: foo: Directory is new +Second dump +tar: foo/a: Directory has been renamed from 'foo/c' +tar: foo/b: Directory has been renamed from 'foo/a' +tar: foo/c: Directory has been renamed from 'foo/b' +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "First dump +foo/ +foo/a/ +foo/b/ +foo/c/ +foo/file1 +foo/file2 +foo/a/filea +foo/b/fileb +foo/c/filec +Second dump +foo/ +foo/a/ +foo/b/ +foo/c/ +Begin directory listing 1 +foo +foo/a +foo/a/filea +foo/b +foo/b/fileb +foo/c +foo/c/filec +foo/file1 +foo/file2 +End directory listing 1 +foo/ +foo/a/ +foo/b/ +foo/c/ +Begin directory listing 2 +foo +foo/a +foo/a/filec +foo/b +foo/b/filea +foo/c +foo/c/fileb +foo/file1 +foo/file2 +End directory listing 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_99 +#AT_START_100 +at_fn_group_banner 100 'rename04.at:27' \ + "renamed directory containing subdirectories" " " 13 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "100. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/rename04.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +Second restore +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +directory +directory/file +directory/subdir +Second restore +dir +dir/subdir +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename04.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +Second restore +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +directory +directory/file +directory/subdir +Second restore +dir +dir/subdir +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename04.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +Second restore +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +directory +directory/file +directory/subdir +Second restore +dir +dir/subdir +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_100 +#AT_START_101 +at_fn_group_banner 101 'rename05.at:24' \ + "renamed subdirectories" " " 13 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "101. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/rename05.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +Second restore +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +directory +directory/file +directory/subdir +Second restore +dir +dir/subdir.0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename05.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +Second restore +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +directory +directory/file +directory/subdir +Second restore +dir +dir/subdir.0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/rename05.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +Second restore +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating directory structure +Creating initial archive +Renaming +Creating incremental archive +First restore +directory +directory/file +directory/subdir +Second restore +dir +dir/subdir.0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_101 +#AT_START_102 +at_fn_group_banner 102 'chtype.at:27' \ + "changed file types in incrementals" " " 13 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "102. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/chtype.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "First backup +Second backup +Restore archive.1 +Restore archive.2 +directory +directory/a +directory/a/a +directory/a/b +directory/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/chtype.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "First backup +Second backup +Restore archive.1 +Restore archive.2 +directory +directory/a +directory/a/a +directory/a/b +directory/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/chtype.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "First backup +Second backup +Restore archive.1 +Restore archive.2 +directory +directory/a +directory/a/a +directory/a/b +directory/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_102 +#AT_START_103 +at_fn_group_banner 103 'ignfail.at:23' \ + "ignfail" " " 14 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "103. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/ignfail.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=\$? +chmod 600 file +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=\$? +chmod 600 file +test \$status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=\$? +chmod 700 directory +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=\$? +chmod 700 directory +test \$status = 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "----- +tar: file: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: file: Warning: Cannot open: Permission denied +----- +tar: directory: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: directory: Warning: Cannot open: Permission denied +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/ignfail.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=\$? +chmod 600 file +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=\$? +chmod 600 file +test \$status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=\$? +chmod 700 directory +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=\$? +chmod 700 directory +test \$status = 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "----- +tar: file: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: file: Warning: Cannot open: Permission denied +----- +tar: directory: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: directory: Warning: Cannot open: Permission denied +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/ignfail.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=\$? +chmod 600 file +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=\$? +chmod 600 file +test \$status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=\$? +chmod 700 directory +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=\$? +chmod 700 directory +test \$status = 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "----- +tar: file: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: file: Warning: Cannot open: Permission denied +----- +tar: directory: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: directory: Warning: Cannot open: Permission denied +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/ignfail.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=\$? +chmod 600 file +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=\$? +chmod 600 file +test \$status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=\$? +chmod 700 directory +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=\$? +chmod 700 directory +test \$status = 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "----- +tar: file: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: file: Warning: Cannot open: Permission denied +----- +tar: directory: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: directory: Warning: Cannot open: Permission denied +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/ignfail.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=\$? +chmod 600 file +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=\$? +chmod 600 file +test \$status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=\$? +chmod 700 directory +test \$status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=\$? +chmod 700 directory +test \$status = 0 +)" +at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "----- +tar: file: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: file: Warning: Cannot open: Permission denied +----- +tar: directory: Cannot open: Permission denied +tar: Exiting with failure status due to previous errors +----- +tar: directory: Warning: Cannot open: Permission denied +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_103 +#AT_START_104 +at_fn_group_banner 104 'link01.at:33' \ + "link count gt 2" " " 15 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "104. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/link01.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "test.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link01.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "test.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link01.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "test.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link01.at:36: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "test.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link01.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "test.txt +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_104 +#AT_START_105 +at_fn_group_banner 105 'link02.at:32' \ + "preserve hard links with --remove-files" " " 15 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "105. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/link02.at:35: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -at_failed=false -echo >>"$at_stderr"; echo "tar: a/b: Directory is new -tar: a/c: Directory has been renamed from \`a/b' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Initial dump -a/ -a/b/ -a/b/one_31_chars_long_file_name_001 -a/b/one_31_chars_long_file_name_002 -a/b/one_31_chars_long_file_name_003 -a/b/one_31_chars_long_file_name_004 -a/b/one_31_chars_long_file_name_005 -a/b/one_31_chars_long_file_name_006 -a/b/one_31_chars_long_file_name_007 -a/b/one_31_chars_long_file_name_008 -a/b/one_31_chars_long_file_name_009 -a/b/one_31_chars_long_file_name_010 -a/b/one_31_chars_long_file_name_011 -a/b/one_31_chars_long_file_name_012 -a/b/one_31_chars_long_file_name_013 -a/b/one_31_chars_long_file_name_014 -a/b/one_31_chars_long_file_name_015 -a/b/one_31_chars_long_file_name_016 -a/b/one_31_chars_long_file_name_017 -a/b/one_31_chars_long_file_name_018 -a/b/one_31_chars_long_file_name_019 -a/b/one_31_chars_long_file_name_020 -a/b/one_31_chars_long_file_name_021 -a/b/one_31_chars_long_file_name_022 -a/b/one_31_chars_long_file_name_023 -a/b/one_31_chars_long_file_name_024 -a/b/one_31_chars_long_file_name_025 -a/b/one_31_chars_long_file_name_026 -a/b/one_31_chars_long_file_name_027 -a/b/one_31_chars_long_file_name_028 -a/b/one_31_chars_long_file_name_029 -a/b/one_31_chars_long_file_name_030 -a/b/one_31_chars_long_file_name_031 -a/b/one_31_chars_long_file_name_032 -a/b/one_31_chars_long_file_name_033 -a/b/one_31_chars_long_file_name_034 -a/b/one_31_chars_long_file_name_035 -a/b/one_31_chars_long_file_name_036 -a/b/one_31_chars_long_file_name_037 -a/b/one_31_chars_long_file_name_038 -a/b/one_31_chars_long_file_name_039 -a/b/one_31_chars_long_file_name_040 -a/b/one_31_chars_long_file_name_041 -a/b/one_31_chars_long_file_name_042 -a/b/one_31_chars_long_file_name_043 -a/b/one_31_chars_long_file_name_044 -a/b/one_31_chars_long_file_name_045 -a/b/one_31_chars_long_file_name_046 -a/b/one_31_chars_long_file_name_047 -a/b/one_31_chars_long_file_name_048 -a/b/one_31_chars_long_file_name_049 -a/b/one_31_chars_long_file_name_050 -a/b/one_31_chars_long_file_name_051 -a/b/one_31_chars_long_file_name_052 -a/b/one_31_chars_long_file_name_053 -a/b/one_31_chars_long_file_name_054 -a/b/one_31_chars_long_file_name_055 -a/b/one_31_chars_long_file_name_056 -a/b/one_31_chars_long_file_name_057 -a/b/one_31_chars_long_file_name_058 -a/b/one_31_chars_long_file_name_059 -a/b/one_31_chars_long_file_name_060 -a/b/one_31_chars_long_file_name_061 -a/b/one_31_chars_long_file_name_062 -a/b/one_31_chars_long_file_name_063 -a/b/one_31_chars_long_file_name_064 -a/b/one_31_chars_long_file_name_065 -a/b/one_31_chars_long_file_name_066 -a/b/one_31_chars_long_file_name_067 -a/b/one_31_chars_long_file_name_068 -a/b/one_31_chars_long_file_name_069 -a/b/one_31_chars_long_file_name_070 -a/b/one_31_chars_long_file_name_071 -a/b/one_31_chars_long_file_name_072 -a/b/one_31_chars_long_file_name_073 -a/b/one_31_chars_long_file_name_074 -a/b/one_31_chars_long_file_name_075 -a/b/one_31_chars_long_file_name_076 -a/b/one_31_chars_long_file_name_077 -a/b/one_31_chars_long_file_name_078 -a/b/one_31_chars_long_file_name_079 -a/b/one_31_chars_long_file_name_080 -a/b/one_31_chars_long_file_name_081 -a/b/one_31_chars_long_file_name_082 -a/b/one_31_chars_long_file_name_083 -a/b/one_31_chars_long_file_name_084 -a/b/one_31_chars_long_file_name_085 -a/b/one_31_chars_long_file_name_086 -a/b/one_31_chars_long_file_name_087 -a/b/one_31_chars_long_file_name_088 -a/b/one_31_chars_long_file_name_089 -a/b/one_31_chars_long_file_name_090 -a/b/one_31_chars_long_file_name_091 -a/b/one_31_chars_long_file_name_092 -a/b/one_31_chars_long_file_name_093 -a/b/one_31_chars_long_file_name_094 -a/b/one_31_chars_long_file_name_095 -a/b/one_31_chars_long_file_name_096 -a/b/one_31_chars_long_file_name_097 -a/b/one_31_chars_long_file_name_098 -a/b/one_31_chars_long_file_name_099 -a/b/one_31_chars_long_file_name_100 -a/b/one_31_chars_long_file_name_101 -a/b/one_31_chars_long_file_name_102 -a/b/one_31_chars_long_file_name_103 -a/b/one_31_chars_long_file_name_104 -a/b/one_31_chars_long_file_name_105 -a/b/one_31_chars_long_file_name_106 -a/b/one_31_chars_long_file_name_107 -a/b/one_31_chars_long_file_name_108 -a/b/one_31_chars_long_file_name_109 -a/b/one_31_chars_long_file_name_110 -a/b/one_31_chars_long_file_name_111 -a/b/one_31_chars_long_file_name_112 -a/b/one_31_chars_long_file_name_113 -a/b/one_31_chars_long_file_name_114 -a/b/one_31_chars_long_file_name_115 -a/b/one_31_chars_long_file_name_116 -a/b/one_31_chars_long_file_name_117 -a/b/one_31_chars_long_file_name_118 -a/b/one_31_chars_long_file_name_119 -a/b/one_31_chars_long_file_name_120 -a/b/one_31_chars_long_file_name_121 -a/b/one_31_chars_long_file_name_122 -a/b/one_31_chars_long_file_name_123 -a/b/one_31_chars_long_file_name_124 -a/b/one_31_chars_long_file_name_125 -a/b/one_31_chars_long_file_name_126 -a/b/one_31_chars_long_file_name_127 -a/b/one_31_chars_long_file_name_128 -a/b/one_31_chars_long_file_name_129 -a/b/one_31_chars_long_file_name_130 -a/b/one_31_chars_long_file_name_131 -a/b/one_31_chars_long_file_name_132 -a/b/one_31_chars_long_file_name_133 -a/b/one_31_chars_long_file_name_134 -a/b/one_31_chars_long_file_name_135 -a/b/one_31_chars_long_file_name_136 -a/b/one_31_chars_long_file_name_137 -a/b/one_31_chars_long_file_name_138 -a/b/one_31_chars_long_file_name_139 -a/b/one_31_chars_long_file_name_140 -a/b/one_31_chars_long_file_name_141 -a/b/one_31_chars_long_file_name_142 -Incremental dump -a/ -a/c/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr04.at:34: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link02.at:35: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link02.at:35: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link02.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link02.at:35: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "file1 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_105 +#AT_START_106 +at_fn_group_banner 106 'link03.at:24' \ + "working -l with --remove-files" " " 15 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "106. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + { set +x +$as_echo "$at_srcdir/link03.at:34: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -$at_traceon -$at_traceoff -echo "$at_srcdir/incr04.at:34: +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'. +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "archive.1 +archive.2 +testing archive.2 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link03.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13611,29 +26315,26 @@ export TAR_OPTIONS rm -rf * -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i); - }' < /dev/null | genfile --files-from - - -sleep 1 +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -echo \"Initial dump\" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo \"Incremental dump\" -tar cvf a1.tar -g a.sna a -)" -echo incr04.at:34 >"$at_check_line_file" +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -if test -n "$at_trace_this"; then - ( $at_traceon; +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13643,220 +26344,118 @@ export TAR_OPTIONS rm -rf * -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -sleep 1 +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'. +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "archive.1 +archive.2 +testing archive.2 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link03.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -sleep 1 +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -at_failed=false -echo >>"$at_stderr"; echo "tar: a/b: Directory is new -tar: a/c: Directory has been renamed from \`a/b' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Initial dump -a/ -a/b/ -a/b/one_31_chars_long_file_name_001 -a/b/one_31_chars_long_file_name_002 -a/b/one_31_chars_long_file_name_003 -a/b/one_31_chars_long_file_name_004 -a/b/one_31_chars_long_file_name_005 -a/b/one_31_chars_long_file_name_006 -a/b/one_31_chars_long_file_name_007 -a/b/one_31_chars_long_file_name_008 -a/b/one_31_chars_long_file_name_009 -a/b/one_31_chars_long_file_name_010 -a/b/one_31_chars_long_file_name_011 -a/b/one_31_chars_long_file_name_012 -a/b/one_31_chars_long_file_name_013 -a/b/one_31_chars_long_file_name_014 -a/b/one_31_chars_long_file_name_015 -a/b/one_31_chars_long_file_name_016 -a/b/one_31_chars_long_file_name_017 -a/b/one_31_chars_long_file_name_018 -a/b/one_31_chars_long_file_name_019 -a/b/one_31_chars_long_file_name_020 -a/b/one_31_chars_long_file_name_021 -a/b/one_31_chars_long_file_name_022 -a/b/one_31_chars_long_file_name_023 -a/b/one_31_chars_long_file_name_024 -a/b/one_31_chars_long_file_name_025 -a/b/one_31_chars_long_file_name_026 -a/b/one_31_chars_long_file_name_027 -a/b/one_31_chars_long_file_name_028 -a/b/one_31_chars_long_file_name_029 -a/b/one_31_chars_long_file_name_030 -a/b/one_31_chars_long_file_name_031 -a/b/one_31_chars_long_file_name_032 -a/b/one_31_chars_long_file_name_033 -a/b/one_31_chars_long_file_name_034 -a/b/one_31_chars_long_file_name_035 -a/b/one_31_chars_long_file_name_036 -a/b/one_31_chars_long_file_name_037 -a/b/one_31_chars_long_file_name_038 -a/b/one_31_chars_long_file_name_039 -a/b/one_31_chars_long_file_name_040 -a/b/one_31_chars_long_file_name_041 -a/b/one_31_chars_long_file_name_042 -a/b/one_31_chars_long_file_name_043 -a/b/one_31_chars_long_file_name_044 -a/b/one_31_chars_long_file_name_045 -a/b/one_31_chars_long_file_name_046 -a/b/one_31_chars_long_file_name_047 -a/b/one_31_chars_long_file_name_048 -a/b/one_31_chars_long_file_name_049 -a/b/one_31_chars_long_file_name_050 -a/b/one_31_chars_long_file_name_051 -a/b/one_31_chars_long_file_name_052 -a/b/one_31_chars_long_file_name_053 -a/b/one_31_chars_long_file_name_054 -a/b/one_31_chars_long_file_name_055 -a/b/one_31_chars_long_file_name_056 -a/b/one_31_chars_long_file_name_057 -a/b/one_31_chars_long_file_name_058 -a/b/one_31_chars_long_file_name_059 -a/b/one_31_chars_long_file_name_060 -a/b/one_31_chars_long_file_name_061 -a/b/one_31_chars_long_file_name_062 -a/b/one_31_chars_long_file_name_063 -a/b/one_31_chars_long_file_name_064 -a/b/one_31_chars_long_file_name_065 -a/b/one_31_chars_long_file_name_066 -a/b/one_31_chars_long_file_name_067 -a/b/one_31_chars_long_file_name_068 -a/b/one_31_chars_long_file_name_069 -a/b/one_31_chars_long_file_name_070 -a/b/one_31_chars_long_file_name_071 -a/b/one_31_chars_long_file_name_072 -a/b/one_31_chars_long_file_name_073 -a/b/one_31_chars_long_file_name_074 -a/b/one_31_chars_long_file_name_075 -a/b/one_31_chars_long_file_name_076 -a/b/one_31_chars_long_file_name_077 -a/b/one_31_chars_long_file_name_078 -a/b/one_31_chars_long_file_name_079 -a/b/one_31_chars_long_file_name_080 -a/b/one_31_chars_long_file_name_081 -a/b/one_31_chars_long_file_name_082 -a/b/one_31_chars_long_file_name_083 -a/b/one_31_chars_long_file_name_084 -a/b/one_31_chars_long_file_name_085 -a/b/one_31_chars_long_file_name_086 -a/b/one_31_chars_long_file_name_087 -a/b/one_31_chars_long_file_name_088 -a/b/one_31_chars_long_file_name_089 -a/b/one_31_chars_long_file_name_090 -a/b/one_31_chars_long_file_name_091 -a/b/one_31_chars_long_file_name_092 -a/b/one_31_chars_long_file_name_093 -a/b/one_31_chars_long_file_name_094 -a/b/one_31_chars_long_file_name_095 -a/b/one_31_chars_long_file_name_096 -a/b/one_31_chars_long_file_name_097 -a/b/one_31_chars_long_file_name_098 -a/b/one_31_chars_long_file_name_099 -a/b/one_31_chars_long_file_name_100 -a/b/one_31_chars_long_file_name_101 -a/b/one_31_chars_long_file_name_102 -a/b/one_31_chars_long_file_name_103 -a/b/one_31_chars_long_file_name_104 -a/b/one_31_chars_long_file_name_105 -a/b/one_31_chars_long_file_name_106 -a/b/one_31_chars_long_file_name_107 -a/b/one_31_chars_long_file_name_108 -a/b/one_31_chars_long_file_name_109 -a/b/one_31_chars_long_file_name_110 -a/b/one_31_chars_long_file_name_111 -a/b/one_31_chars_long_file_name_112 -a/b/one_31_chars_long_file_name_113 -a/b/one_31_chars_long_file_name_114 -a/b/one_31_chars_long_file_name_115 -a/b/one_31_chars_long_file_name_116 -a/b/one_31_chars_long_file_name_117 -a/b/one_31_chars_long_file_name_118 -a/b/one_31_chars_long_file_name_119 -a/b/one_31_chars_long_file_name_120 -a/b/one_31_chars_long_file_name_121 -a/b/one_31_chars_long_file_name_122 -a/b/one_31_chars_long_file_name_123 -a/b/one_31_chars_long_file_name_124 -a/b/one_31_chars_long_file_name_125 -a/b/one_31_chars_long_file_name_126 -a/b/one_31_chars_long_file_name_127 -a/b/one_31_chars_long_file_name_128 -a/b/one_31_chars_long_file_name_129 -a/b/one_31_chars_long_file_name_130 -a/b/one_31_chars_long_file_name_131 -a/b/one_31_chars_long_file_name_132 -a/b/one_31_chars_long_file_name_133 -a/b/one_31_chars_long_file_name_134 -a/b/one_31_chars_long_file_name_135 -a/b/one_31_chars_long_file_name_136 -a/b/one_31_chars_long_file_name_137 -a/b/one_31_chars_long_file_name_138 -a/b/one_31_chars_long_file_name_139 -a/b/one_31_chars_long_file_name_140 -a/b/one_31_chars_long_file_name_141 -a/b/one_31_chars_long_file_name_142 -Incremental dump -a/ -a/c/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr04.at:34: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -$at_traceon -$at_traceoff -echo "$at_srcdir/incr04.at:34: +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'. +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "archive.1 +archive.2 +testing archive.2 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link03.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13866,276 +26465,473 @@ export TAR_OPTIONS rm -rf * -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf(\"a/b/one_31_chars_long_file_name_%03d\\n\", i); - }' < /dev/null | genfile --files-from - - -sleep 1 +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -echo \"Initial dump\" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo \"Incremental dump\" -tar cvf a1.tar -g a.sna a -)" -echo incr04.at:34 >"$at_check_line_file" +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -if test -n "$at_trace_this"; then - ( $at_traceon; +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'. +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "archive.1 +archive.2 +testing archive.2 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link03.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -sleep 1 +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +)" +at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -sleep 1 +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'. +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "archive.1 +archive.2 +testing archive.2 +file1 +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } -at_failed=false -echo >>"$at_stderr"; echo "tar: a/b: Directory is new -tar: a/c: Directory has been renamed from \`a/b' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Initial dump -a/ -a/b/ -a/b/one_31_chars_long_file_name_001 -a/b/one_31_chars_long_file_name_002 -a/b/one_31_chars_long_file_name_003 -a/b/one_31_chars_long_file_name_004 -a/b/one_31_chars_long_file_name_005 -a/b/one_31_chars_long_file_name_006 -a/b/one_31_chars_long_file_name_007 -a/b/one_31_chars_long_file_name_008 -a/b/one_31_chars_long_file_name_009 -a/b/one_31_chars_long_file_name_010 -a/b/one_31_chars_long_file_name_011 -a/b/one_31_chars_long_file_name_012 -a/b/one_31_chars_long_file_name_013 -a/b/one_31_chars_long_file_name_014 -a/b/one_31_chars_long_file_name_015 -a/b/one_31_chars_long_file_name_016 -a/b/one_31_chars_long_file_name_017 -a/b/one_31_chars_long_file_name_018 -a/b/one_31_chars_long_file_name_019 -a/b/one_31_chars_long_file_name_020 -a/b/one_31_chars_long_file_name_021 -a/b/one_31_chars_long_file_name_022 -a/b/one_31_chars_long_file_name_023 -a/b/one_31_chars_long_file_name_024 -a/b/one_31_chars_long_file_name_025 -a/b/one_31_chars_long_file_name_026 -a/b/one_31_chars_long_file_name_027 -a/b/one_31_chars_long_file_name_028 -a/b/one_31_chars_long_file_name_029 -a/b/one_31_chars_long_file_name_030 -a/b/one_31_chars_long_file_name_031 -a/b/one_31_chars_long_file_name_032 -a/b/one_31_chars_long_file_name_033 -a/b/one_31_chars_long_file_name_034 -a/b/one_31_chars_long_file_name_035 -a/b/one_31_chars_long_file_name_036 -a/b/one_31_chars_long_file_name_037 -a/b/one_31_chars_long_file_name_038 -a/b/one_31_chars_long_file_name_039 -a/b/one_31_chars_long_file_name_040 -a/b/one_31_chars_long_file_name_041 -a/b/one_31_chars_long_file_name_042 -a/b/one_31_chars_long_file_name_043 -a/b/one_31_chars_long_file_name_044 -a/b/one_31_chars_long_file_name_045 -a/b/one_31_chars_long_file_name_046 -a/b/one_31_chars_long_file_name_047 -a/b/one_31_chars_long_file_name_048 -a/b/one_31_chars_long_file_name_049 -a/b/one_31_chars_long_file_name_050 -a/b/one_31_chars_long_file_name_051 -a/b/one_31_chars_long_file_name_052 -a/b/one_31_chars_long_file_name_053 -a/b/one_31_chars_long_file_name_054 -a/b/one_31_chars_long_file_name_055 -a/b/one_31_chars_long_file_name_056 -a/b/one_31_chars_long_file_name_057 -a/b/one_31_chars_long_file_name_058 -a/b/one_31_chars_long_file_name_059 -a/b/one_31_chars_long_file_name_060 -a/b/one_31_chars_long_file_name_061 -a/b/one_31_chars_long_file_name_062 -a/b/one_31_chars_long_file_name_063 -a/b/one_31_chars_long_file_name_064 -a/b/one_31_chars_long_file_name_065 -a/b/one_31_chars_long_file_name_066 -a/b/one_31_chars_long_file_name_067 -a/b/one_31_chars_long_file_name_068 -a/b/one_31_chars_long_file_name_069 -a/b/one_31_chars_long_file_name_070 -a/b/one_31_chars_long_file_name_071 -a/b/one_31_chars_long_file_name_072 -a/b/one_31_chars_long_file_name_073 -a/b/one_31_chars_long_file_name_074 -a/b/one_31_chars_long_file_name_075 -a/b/one_31_chars_long_file_name_076 -a/b/one_31_chars_long_file_name_077 -a/b/one_31_chars_long_file_name_078 -a/b/one_31_chars_long_file_name_079 -a/b/one_31_chars_long_file_name_080 -a/b/one_31_chars_long_file_name_081 -a/b/one_31_chars_long_file_name_082 -a/b/one_31_chars_long_file_name_083 -a/b/one_31_chars_long_file_name_084 -a/b/one_31_chars_long_file_name_085 -a/b/one_31_chars_long_file_name_086 -a/b/one_31_chars_long_file_name_087 -a/b/one_31_chars_long_file_name_088 -a/b/one_31_chars_long_file_name_089 -a/b/one_31_chars_long_file_name_090 -a/b/one_31_chars_long_file_name_091 -a/b/one_31_chars_long_file_name_092 -a/b/one_31_chars_long_file_name_093 -a/b/one_31_chars_long_file_name_094 -a/b/one_31_chars_long_file_name_095 -a/b/one_31_chars_long_file_name_096 -a/b/one_31_chars_long_file_name_097 -a/b/one_31_chars_long_file_name_098 -a/b/one_31_chars_long_file_name_099 -a/b/one_31_chars_long_file_name_100 -a/b/one_31_chars_long_file_name_101 -a/b/one_31_chars_long_file_name_102 -a/b/one_31_chars_long_file_name_103 -a/b/one_31_chars_long_file_name_104 -a/b/one_31_chars_long_file_name_105 -a/b/one_31_chars_long_file_name_106 -a/b/one_31_chars_long_file_name_107 -a/b/one_31_chars_long_file_name_108 -a/b/one_31_chars_long_file_name_109 -a/b/one_31_chars_long_file_name_110 -a/b/one_31_chars_long_file_name_111 -a/b/one_31_chars_long_file_name_112 -a/b/one_31_chars_long_file_name_113 -a/b/one_31_chars_long_file_name_114 -a/b/one_31_chars_long_file_name_115 -a/b/one_31_chars_long_file_name_116 -a/b/one_31_chars_long_file_name_117 -a/b/one_31_chars_long_file_name_118 -a/b/one_31_chars_long_file_name_119 -a/b/one_31_chars_long_file_name_120 -a/b/one_31_chars_long_file_name_121 -a/b/one_31_chars_long_file_name_122 -a/b/one_31_chars_long_file_name_123 -a/b/one_31_chars_long_file_name_124 -a/b/one_31_chars_long_file_name_125 -a/b/one_31_chars_long_file_name_126 -a/b/one_31_chars_long_file_name_127 -a/b/one_31_chars_long_file_name_128 -a/b/one_31_chars_long_file_name_129 -a/b/one_31_chars_long_file_name_130 -a/b/one_31_chars_long_file_name_131 -a/b/one_31_chars_long_file_name_132 -a/b/one_31_chars_long_file_name_133 -a/b/one_31_chars_long_file_name_134 -a/b/one_31_chars_long_file_name_135 -a/b/one_31_chars_long_file_name_136 -a/b/one_31_chars_long_file_name_137 -a/b/one_31_chars_long_file_name_138 -a/b/one_31_chars_long_file_name_139 -a/b/one_31_chars_long_file_name_140 -a/b/one_31_chars_long_file_name_141 -a/b/one_31_chars_long_file_name_142 -Incremental dump -a/ -a/c/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/incr04.at:34: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_106 +#AT_START_107 +at_fn_group_banner 107 'link04.at:29' \ + "link count is 1 but multiple occurrences" " " 15 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "107. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 33 ) # 33. rename01.at:24: renamed dirs in incrementals - at_setup_line='rename01.at:24' - at_desc="renamed dirs in incrementals" - $at_quiet $ECHO_N " 33: renamed dirs in incrementals $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "33. rename01.at:24: testing ..." - $at_traceon + { set +x +$as_echo "$at_srcdir/link04.at:32: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +)" +at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/ +dir/file +dir/file link to dir/file +dir/symlink -> file +dir/symlink link to dir/symlink +== +dir/ +dir/FOO +dir/FOO link to dir/FOO +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link04.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +)" +at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/ +dir/file +dir/file link to dir/file +dir/symlink -> file +dir/symlink link to dir/symlink +== +dir/ +dir/FOO +dir/FOO link to dir/FOO +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link04.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +)" +at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/ +dir/file +dir/file link to dir/file +dir/symlink -> file +dir/symlink link to dir/symlink +== +dir/ +dir/FOO +dir/FOO link to dir/FOO +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link04.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +)" +at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * - $at_traceoff -echo "$at_srcdir/rename01.at:27: +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/ +dir/file +dir/file link to dir/file +dir/symlink -> file +dir/symlink link to dir/symlink +== +dir/ +dir/FOO +dir/FOO link to dir/FOO +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/link04.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -14144,46 +26940,26 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file - -echo \"Creating base archive\" -tar -g incr -cf arch.1 -v foo - -mv foo/bar foo/baz - -echo \"Creating incremental archive\" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null - -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" - -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort )" -echo rename01.at:27 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -14192,176 +26968,206 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/ +dir/ +dir/file +dir/file link to dir/file +dir/symlink -> file +dir/symlink link to dir/symlink +== +dir/ +dir/FOO +dir/FOO link to dir/FOO +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_107 +#AT_START_108 +at_fn_group_banner 108 'longv7.at:24' \ + "long names in V7 archives" " " 16 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "108. $at_setup_line: testing $at_desc ..." + $at_traceon -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo -mv foo old -tar xfg arch.1 /dev/null + { set +x +$as_echo "$at_srcdir/longv7.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems +touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +echo separator +tar tf archive +)" +at_fn_check_prepare_notrace 'an embedded newline' "longv7.at:30" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems +touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c -test -z "`sort < /dev/null 2>&1`" || exit 77 +tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +echo separator +tar tf archive +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c: file name is too long (max 99); not dumped +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +this_is_a_very_long_name_for_a_directory_which_causes_problems/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/longv7.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo -mv foo old + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_108 +#AT_START_109 +at_fn_group_banner 109 'long01.at:28' \ + "long file names divisible by block size" " " 16 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "109. $at_setup_line: testing $at_desc ..." + $at_traceon -tar xfg arch.1 /dev/null -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo/bar: Directory is new -tar: foo/baz: Directory has been renamed from \`foo/bar' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating base archive -foo/ -foo/bar/ -foo/file1 -foo/file2 -foo/bar/file -Creating incremental archive -foo/ -foo/baz/ -Begin directory listing 1 -foo -foo/bar -foo/bar/file -foo/file1 -foo/file2 -End directory listing 1 -Begin directory listing 2 -foo -foo/baz -foo/baz/file -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename01.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/rename01.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + + { set +x +$as_echo "$at_srcdir/long01.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file - -echo \"Creating base archive\" -tar -g incr -cf arch.1 -v foo - -mv foo/bar foo/baz +install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 +echo test > endfile -echo \"Creating incremental archive\" -tar -g incr -cf arch.2 -v foo +tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "long01.at:36" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -mv foo old -tar xfg arch.1 /dev/null +install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 +echo test > endfile -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" +tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde +endfile +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/long01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/long01.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -)" -echo rename01.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 +echo test > endfile -if test -n "$at_trace_this"; then - ( $at_traceon; +tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "long01.at:36" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -14371,329 +27177,433 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 +echo test > endfile +tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde +endfile +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/long01.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo -mv foo old -tar xfg arch.1 /dev/null + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_109 +#AT_START_110 +at_fn_group_banner 110 'lustar01.at:21' \ + "ustar: unsplittable file name" " " 16 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "110. $at_setup_line: testing $at_desc ..." + $at_traceon -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + + + + + { set +x +$as_echo "$at_srcdir/lustar01.at:27: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * + +genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix || exit 77 +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix +)" +at_fn_check_prepare_notrace 'an embedded newline' "lustar01.at:27" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix || exit 77 +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix: file name is too long (cannot be split); not dumped +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/lustar01.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_110 +#AT_START_111 +at_fn_group_banner 111 'lustar02.at:21' \ + "ustar: unsplittable path name" " " 16 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "111. $at_setup_line: testing $at_desc ..." + $at_traceon -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo -mv foo old -tar xfg arch.1 /dev/null -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo/bar: Directory is new -tar: foo/baz: Directory has been renamed from \`foo/bar' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating base archive -foo/ -foo/bar/ -foo/file1 -foo/file2 -foo/bar/file -Creating incremental archive -foo/ -foo/baz/ -Begin directory listing 1 -foo -foo/bar -foo/bar/file -foo/file1 -foo/file2 -End directory listing 1 -Begin directory listing 2 -foo -foo/baz -foo/baz/file -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename01.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/rename01.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + + + { set +x +$as_echo "$at_srcdir/lustar02.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - +install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77 +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be +)" +at_fn_check_prepare_notrace 'an embedded newline' "lustar02.at:32" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file -echo \"Creating base archive\" -tar -g incr -cf arch.1 -v foo +install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77 +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/: file name is too long (cannot be split); not dumped +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/lustar02.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } -mv foo/bar foo/baz -echo \"Creating incremental archive\" -tar -g incr -cf arch.2 -v foo -mv foo old -tar xfg arch.1 /dev/null -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -)" -echo rename01.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_111 +#AT_START_112 +at_fn_group_banner 112 'lustar03.at:21' \ + "ustar: splitting long names" " " 16 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "112. $at_setup_line: testing $at_desc ..." + $at_traceon -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo -mv foo old -tar xfg arch.1 /dev/null + { set +x +$as_echo "$at_srcdir/lustar03.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 +echo \"Create archive\" +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be +echo \"List archive\" +tar tf archive)" +at_fn_check_prepare_notrace 'an embedded newline' "lustar03.at:29" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 +echo "Create archive" +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be +echo "List archive" +tar tf archive) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Create archive +List archive +this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/ +this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/lustar03.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo -mv foo old + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_112 +#AT_START_113 +at_fn_group_banner 113 'old.at:23' \ + "old archives" " " 16 +at_xfail=no +( + $as_echo "113. $at_setup_line: testing $at_desc ..." + $at_traceon -tar xfg arch.1 /dev/null -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +unset TAR_OPTIONS +{ set +x +$as_echo "$at_srcdir/old.at:27: +mkdir directory +tar cfvo archive directory || exit 1 +tar tf archive +" +at_fn_check_prepare_notrace 'an embedded newline' "old.at:27" +( $at_check_trace; +mkdir directory +tar cfvo archive directory || exit 1 +tar tf archive -at_failed=false -echo >>"$at_stderr"; echo "tar: foo/bar: Directory is new -tar: foo/baz: Directory has been renamed from \`foo/bar' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating base archive -foo/ -foo/bar/ -foo/file1 -foo/file2 -foo/bar/file -Creating incremental archive -foo/ -foo/baz/ -Begin directory listing 1 -foo -foo/bar -foo/bar/file -foo/file1 -foo/file2 -End directory listing 1 -Begin directory listing 2 -foo -foo/baz -foo/baz/file -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename01.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +directory/ +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/old.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_113 +#AT_START_114 +at_fn_group_banner 114 'time01.at:20' \ + "time: tricky time stamps" " " 16 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "114. $at_setup_line: testing $at_desc ..." + $at_traceon - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + { set +x +$as_echo "$at_srcdir/time01.at:23: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * + +export TZ=UTC0 +mkdir dir + +# Test files with time stamps that are near common sources of error, +# typically near powers of 2 (for seconds) or near 0, 1970, or 9999 (years). +# Use GNU-style @ notation for very large time stamps, since they +# typically don't render into years correctly due to int overflow. +for s in \\ + @-9223372036854775809 @-9223372036854775808 @-9223372036854775807 \\ + 0000-01-01T00:00:00 0000-01-01T00:00:01 \\ + 0000-01-02T00:00:00 \\ + 1697-10-17T11:03:27 1697-10-17T11:03:28 1697-10-17T11:03:29 \\ + 1833-11-24T17:31:43 1833-11-24T17:31:44 1833-11-24T17:31:45 \\ + 1901-12-13T20:45:51 1901-12-13T20:45:52 1901-12-13T20:45:53 \\ + 1901-12-14T20:45:51 \\ + 1969-12-31T23:59:58 1969-12-31T23:59:59 \\ + 1970-01-01T00:00:00 1970-01-01T00:00:01 \\ + 2038-01-18T03:14:07 \\ + 2038-01-19T03:14:07 2038-01-19T03:14:08 \\ + 2106-02-07T06:28:15 2106-02-07T06:28:16 \\ + 2242-03-16T12:56:31 2242-03-16T12:56:32 \\ + 9999-12-31T23:59:58 9999-12-31T23:59:59 \\ + @9223372036854775807 @9223372036854775808 +do + # Skip a time stamp \$s if it's out of range for this platform, + # of if it uses a notation that this platform does not recognize. + touch -d \$s dir/f\$s >/dev/null 2>&1 || continue + + # Likewise for \$s.1. If \$s is the most negative time stamp and + # time stamps are signed, then \$s.1 is out of range. + touch -d \$s.1 dir/f\$s.\$ns >/dev/null 2>&1 || continue + + for frac in 01 001 00001 000001 0000001 00000001 000000001 0000000001 \\ + 9 99 999 99999 999999 9999999 99999999 999999999 9999999999 + do + touch -d \$s.\$frac dir/f\$s.\$frac + done +done + +tar -c -f archive.tar dir +tar -d -f archive.tar dir +)" +at_fn_check_prepare_notrace 'an embedded newline' "time01.at:23" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * + +export TZ=UTC0 +mkdir dir + +# Test files with time stamps that are near common sources of error, +# typically near powers of 2 (for seconds) or near 0, 1970, or 9999 (years). +# Use GNU-style @ notation for very large time stamps, since they +# typically don't render into years correctly due to int overflow. +for s in \ + @-9223372036854775809 @-9223372036854775808 @-9223372036854775807 \ + 0000-01-01T00:00:00 0000-01-01T00:00:01 \ + 0000-01-02T00:00:00 \ + 1697-10-17T11:03:27 1697-10-17T11:03:28 1697-10-17T11:03:29 \ + 1833-11-24T17:31:43 1833-11-24T17:31:44 1833-11-24T17:31:45 \ + 1901-12-13T20:45:51 1901-12-13T20:45:52 1901-12-13T20:45:53 \ + 1901-12-14T20:45:51 \ + 1969-12-31T23:59:58 1969-12-31T23:59:59 \ + 1970-01-01T00:00:00 1970-01-01T00:00:01 \ + 2038-01-18T03:14:07 \ + 2038-01-19T03:14:07 2038-01-19T03:14:08 \ + 2106-02-07T06:28:15 2106-02-07T06:28:16 \ + 2242-03-16T12:56:31 2242-03-16T12:56:32 \ + 9999-12-31T23:59:58 9999-12-31T23:59:59 \ + @9223372036854775807 @9223372036854775808 +do + # Skip a time stamp $s if it's out of range for this platform, + # of if it uses a notation that this platform does not recognize. + touch -d $s dir/f$s >/dev/null 2>&1 || continue + + # Likewise for $s.1. If $s is the most negative time stamp and + # time stamps are signed, then $s.1 is out of range. + touch -d $s.1 dir/f$s.$ns >/dev/null 2>&1 || continue - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + for frac in 01 001 00001 000001 0000001 00000001 000000001 0000000001 \ + 9 99 999 99999 999999 9999999 99999999 999999999 9999999999 + do + touch -d $s.$frac dir/f$s.$frac + done +done - 34 ) # 34. rename02.at:24: move between hierarchies - at_setup_line='rename02.at:24' - at_desc="move between hierarchies" - $at_quiet $ECHO_N " 34: move between hierarchies $ECHO_C" - at_xfail=no +tar -c -f archive.tar dir +tar -d -f archive.tar dir +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/time01.at:23" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_114 +#AT_START_115 +at_fn_group_banner 115 'multiv01.at:23' \ + "multivolume dumps from pipes" " " 17 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "34. rename02.at:24: testing ..." - $at_traceon +( + $as_echo "115. $at_setup_line: testing $at_desc ..." + $at_traceon + +# Fixme: should be configurable +# TRUSS=truss -o /tmp/tr +# TRUSS=strace - $at_traceoff -echo "$at_srcdir/rename02.at:27: + { set +x +$as_echo "$at_srcdir/multiv01.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -14702,50 +27612,37 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * +exec <&- +genfile --length 7168 --file file1 -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo \"Creating base archive\" -tar -g incr -cf arch.1 -v foo - -mv foo/bar/baz foo - -echo \"Creating incremental archive\" -tar -g incr -cf arch.2 -v foo +for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\ + \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\ + echo \"file2 block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" + for count in 2 3 4 5 6 7 8 ; do + echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" + done +done >file2 -mv foo old +if test \$TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -tar xfg arch.1 /dev/null 2>tmperr -sort tmperr >&2 +tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" +mkdir extract-dir-pipe +dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\ + --tape-length=\$TAPE_LENGTH --read-full-records || exit 1 -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 )" -echo rename02.at:27 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:30" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -14754,247 +27651,316 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +exec <&- +genfile --length 7168 --file file1 -test -z "`sort < /dev/null 2>&1`" || exit 77 +for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ + " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ + echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + for count in 2 3 4 5 6 7 8 ; do + echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + done +done >file2 -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -sleep 1 +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo +mkdir extract-dir-pipe +dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ + --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -mv foo/bar/baz foo +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/multiv01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +exec <&- +genfile --length 7168 --file file1 -mv foo old +for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\ + \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\ + echo \"file2 block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" + for count in 2 3 4 5 6 7 8 ; do + echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" + done +done >file2 -tar xfg arch.1 /dev/null 2>tmperr -sort tmperr >&2 +if test \$TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir extract-dir-pipe +dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\ + --tape-length=\$TAPE_LENGTH --read-full-records || exit 1 + +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 +)" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:30" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +exec <&- +genfile --length 7168 --file file1 -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo +for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ + " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ + echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + for count in 2 3 4 5 6 7 8 ; do + echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + done +done >file2 -mv foo/bar/baz foo +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mv foo old +mkdir extract-dir-pipe +dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ + --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -tar xfg arch.1 /dev/null 2>tmperr -sort tmperr >&2 +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/multiv01.at:30: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +exec <&- +genfile --length 7168 --file file1 -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\ + \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\ + echo \"file2 block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" + for count in 2 3 4 5 6 7 8 ; do + echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" + done +done >file2 -at_failed=false -echo >>"$at_stderr"; echo "tar: foo/bar: Directory is new -tar: foo/bar/baz: Directory is new -tar: foo/baz: Directory has been renamed from \`foo/bar/baz' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating base archive -foo/ -foo/bar/ -foo/bar/baz/ -foo/file1 -foo/file2 -foo/bar/file.r -foo/bar/baz/file.z -Creating incremental archive -foo/ -foo/bar/ -foo/baz/ -Begin directory listing 1 -foo -foo/bar -foo/bar/baz -foo/bar/baz/file.z -foo/bar/file.r -foo/file1 -foo/file2 -End directory listing 1 -foo/ -foo/bar/ -foo/baz/ -Begin directory listing 2 -foo -foo/bar -foo/bar/file.r -foo/baz -foo/baz/file.z -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename02.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +if test \$TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi +tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 - echo 1 > "$at_status_file" - exit 1 -fi +mkdir extract-dir-pipe +dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\ + --tape-length=\$TAPE_LENGTH --read-full-records || exit 1 -$at_traceon -$at_traceoff -echo "$at_srcdir/rename02.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 +)" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:30" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * +exec <&- +genfile --length 7168 --file file1 -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 +for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ + " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ + echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + for count in 2 3 4 5 6 7 8 ; do + echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + done +done >file2 -echo \"Creating base archive\" -tar -g incr -cf arch.1 -v foo +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -mv foo/bar/baz foo +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -echo \"Creating incremental archive\" -tar -g incr -cf arch.2 -v foo +mkdir extract-dir-pipe +dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ + --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -mv foo old +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_115 +#AT_START_116 +at_fn_group_banner 116 'multiv02.at:28' \ + "skipping a straddling member" " " 17 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "116. $at_setup_line: testing $at_desc ..." + $at_traceon -tar xfg arch.1 /dev/null 2>tmperr -sort tmperr >&2 -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -)" -echo rename02.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + { set +x +$as_echo "$at_srcdir/multiv02.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 +exec <&- -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:31" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -mv foo/bar/baz foo +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +exec <&- -mv foo old +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +en +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/multiv02.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -tar xfg arch.1 /dev/null 2>tmperr -sort tmperr >&2 +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +exec <&- -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:31" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -15003,448 +27969,336 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar/baz foo - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null 2>tmperr -sort tmperr >&2 - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +exec <&- -at_failed=false -echo >>"$at_stderr"; echo "tar: foo/bar: Directory is new -tar: foo/bar/baz: Directory is new -tar: foo/baz: Directory has been renamed from \`foo/bar/baz' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating base archive -foo/ -foo/bar/ -foo/bar/baz/ -foo/file1 -foo/file2 -foo/bar/file.r -foo/bar/baz/file.z -Creating incremental archive -foo/ -foo/bar/ -foo/baz/ -Begin directory listing 1 -foo -foo/bar -foo/bar/baz -foo/bar/baz/file.z -foo/bar/file.r -foo/file1 -foo/file2 -End directory listing 1 -foo/ -foo/bar/ -foo/baz/ -Begin directory listing 2 -foo -foo/bar -foo/bar/file.r -foo/baz -foo/baz/file.z -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename02.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +en +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/multiv02.at:31: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire - echo 1 > "$at_status_file" - exit 1 -fi +exec <&- -$at_traceon -$at_traceoff -echo "$at_srcdir/rename02.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:31" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z +exec <&- -sleep 1 +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +en +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } -echo \"Creating base archive\" -tar -g incr -cf arch.1 -v foo -mv foo/bar/baz foo -echo \"Creating incremental archive\" -tar -g incr -cf arch.2 -v foo -mv foo old + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_116 +#AT_START_117 +at_fn_group_banner 117 'multiv03.at:30' \ + "MV archive & long filenames" " " 17 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "117. $at_setup_line: testing $at_desc ..." + $at_traceon -tar xfg arch.1 /dev/null 2>tmperr -sort tmperr >&2 -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -)" -echo rename02.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + { set +x +$as_echo "$at_srcdir/multiv03.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * +AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\` +BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\` -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 +cat > ../experr < ../expout <tmperr -sort tmperr >&2 +echo separator-1 -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +genfile --length 15360 --file \$BFILE +tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1 -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +echo separator-2 +mv \$BFILE bfile +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 +cmp \$BFILE bfile +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "multiv03.at:33" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` +BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar/baz foo - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +cat > ../experr < ../expout <tmperr -sort tmperr >&2 +genfile --length 15360 --file $AFILE -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +exec <&- -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 +tar -tM -f arch.1 -f arch.2 || exit 1 -at_failed=false -echo >>"$at_stderr"; echo "tar: foo/bar: Directory is new -tar: foo/bar/baz: Directory is new -tar: foo/baz: Directory has been renamed from \`foo/bar/baz' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating base archive -foo/ -foo/bar/ -foo/bar/baz/ -foo/file1 -foo/file2 -foo/bar/file.r -foo/bar/baz/file.z -Creating incremental archive -foo/ -foo/bar/ -foo/baz/ -Begin directory listing 1 -foo -foo/bar -foo/bar/baz -foo/bar/baz/file.z -foo/bar/file.r -foo/file1 -foo/file2 -End directory listing 1 -foo/ -foo/bar/ -foo/baz/ -Begin directory listing 2 -foo -foo/bar -foo/bar/file.r -foo/baz -foo/baz/file.z -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename02.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo separator-1 +genfile --length 15360 --file $BFILE +tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 - echo 1 > "$at_status_file" - exit 1 -fi +echo separator-2 +mv $BFILE bfile +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 +cmp $BFILE bfile +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv03.at:33" +$at_failed && at_fn_log_failure +$at_traceon; } -$at_traceon + { set +x +$as_echo "$at_srcdir/multiv03.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * +AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\` +BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\` +cat > ../experr <"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +cat > ../expout <> "$at_group_log" - ( - echo "35. rename03.at:23: testing ..." - $at_traceon +genfile --length 15360 --file \$AFILE +exec <&- +tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1 +tar -tM -f arch.1 -f arch.2 || exit 1 +echo separator-1 +genfile --length 15360 --file \$BFILE +tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1 - $at_traceoff -echo "$at_srcdir/rename03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +echo separator-2 +mv \$BFILE bfile +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 +cmp \$BFILE bfile +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "multiv03.at:33" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` +BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat > ../experr < ../expout <>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv03.at:33" +$at_failed && at_fn_log_failure +$at_traceon; } -sleep 1 -echo \"First dump\" -echo \"First dump\">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 -# Shuffle directories: -(cd foo -mv a \$\$ -mv c a -mv b c -mv \$\$ b) -echo \"Second dump\" -echo \"Second dump\" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_117 +#AT_START_118 +at_fn_group_banner 118 'multiv04.at:36' \ + "split directory members in a MV archive" " " 17 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "118. $at_setup_line: testing $at_desc ..." + $at_traceon -tar xfg arch.1 /dev/null -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -)" -echo rename03.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; + { set +x +$as_echo "$at_srcdir/multiv04.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 - -mkdir foo/a -genfile --file foo/a/filea - -mkdir foo/b -genfile --file foo/b/fileb - -mkdir foo/c -genfile --file foo/c/filec +mkdir directory +awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' &2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 +sleep 2 -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) +tar --listed-incremental=list -c -f archive.a directory -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 +sleep 2 -tar xfg arch.1 /dev/null +tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +echo separator -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar -MRt -f arc.1 -f arc.2)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv04.at:39" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -15454,693 +28308,861 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir directory +awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' &2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 +tar -MRt -f arc.1 -f arc.2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +separator +block 0: directory/ +block 35: ** Block of NULs ** +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv04.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/multiv04.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 +mkdir directory +awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' "$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar --listed-incremental=list -c -f archive.a directory -at_failed=false -echo >>"$at_stderr"; echo "First dump -tar: foo/a: Directory is new -tar: foo/b: Directory is new -tar: foo/c: Directory is new -Second dump -tar: foo/a: Directory has been renamed from \`foo/c' -tar: foo/b: Directory has been renamed from \`foo/a' -tar: foo/c: Directory has been renamed from \`foo/b' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "First dump -foo/ -foo/a/ -foo/b/ -foo/c/ -foo/file1 -foo/file2 -foo/a/filea -foo/b/fileb -foo/c/filec -Second dump -foo/ -foo/a/ -foo/b/ -foo/c/ -Begin directory listing 1 -foo -foo/a -foo/a/filea -foo/b -foo/b/fileb -foo/c -foo/c/filec -foo/file1 -foo/file2 -End directory listing 1 -foo/ -foo/a/ -foo/b/ -foo/c/ -Begin directory listing 2 -foo -foo/a -foo/a/filec -foo/b -foo/b/filea -foo/c -foo/c/fileb -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +sleep 2 +tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory - echo 1 > "$at_status_file" - exit 1 -fi +echo separator -$at_traceon -$at_traceoff -echo "$at_srcdir/rename03.at:26: +tar -MRt -f arc.1 -f arc.2)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv04.at:39" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir directory +awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' &2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 +tar -MRt -f arc.1 -f arc.2) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "directory/ +separator +block 0: directory/ +block 35: ** Block of NULs ** +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv04.at:39" +$at_failed && at_fn_log_failure +$at_traceon; } -# Shuffle directories: -(cd foo -mv a \$\$ -mv c a -mv b c -mv \$\$ b) -echo \"Second dump\" -echo \"Second dump\" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 -tar xfg arch.1 /dev/null -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_118 +#AT_START_119 +at_fn_group_banner 119 'multiv05.at:26' \ + "Restoring after an out of sync volume" " " 17 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "119. $at_setup_line: testing $at_desc ..." + $at_traceon -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 + + + + + + { set +x +$as_echo "$at_srcdir/multiv05.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +exec <&- + +genfile --length 250k --file jeden +genfile --length 250k --file dwa +genfile --length 250k --file trzy +genfile --length 250k --file cztery +genfile --length 250k --file piec +genfile --length 250k --file szesc + + +echo Creating archive +tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc +echo separator +mkdir bak +mv jeden dwa trzy cztery piec szesc bak +tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar +echo Diffing jeden + cmp bak/jeden jeden || exit 1 +echo Diffing dwa + cmp bak/dwa dwa || exit 1 +echo Diffing trzy + cmp bak/trzy trzy || exit 1 +echo Diffing cztery + cmp bak/cztery cztery || exit 1 +echo Diffing piec + cmp bak/piec piec || exit 1 +echo Diffing szesc + cmp bak/szesc szesc || exit 1 )" -echo rename03.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +at_fn_check_prepare_notrace 'an embedded newline' "multiv05.at:30" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +exec <&- -test -z "`sort < /dev/null 2>&1`" || exit 77 +genfile --length 250k --file jeden +genfile --length 250k --file dwa +genfile --length 250k --file trzy +genfile --length 250k --file cztery +genfile --length 250k --file piec +genfile --length 250k --file szesc -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 +echo Creating archive +tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc +echo separator +mkdir bak +mv jeden dwa trzy cztery piec szesc bak +tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar +echo Diffing jeden + cmp bak/jeden jeden || exit 1 +echo Diffing dwa + cmp bak/dwa dwa || exit 1 +echo Diffing trzy + cmp bak/trzy trzy || exit 1 +echo Diffing cztery + cmp bak/cztery cztery || exit 1 +echo Diffing piec + cmp bak/piec piec || exit 1 +echo Diffing szesc + cmp bak/szesc szesc || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: 'trzy' is not continued on this volume +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating archive +separator +jeden +dwa +trzy +cztery +piec +szesc +Diffing jeden +Diffing dwa +Diffing trzy +Diffing cztery +Diffing piec +Diffing szesc +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv05.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir foo/a -genfile --file foo/a/filea -mkdir foo/b -genfile --file foo/b/fileb -mkdir foo/c -genfile --file foo/c/filec -sleep 1 -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_119 +#AT_START_120 +at_fn_group_banner 120 'multiv06.at:27' \ + "Multivolumes with L=record_size" " " 17 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "120. $at_setup_line: testing $at_desc ..." + $at_traceon -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 -tar xfg arch.1 /dev/null -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + { set +x +$as_echo "$at_srcdir/multiv06.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * +exec <&- +decho Creating file +genfile --length 20139 --file file +decho Creating archive +tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file +decho Testing archive +tar -t -M -farc.1 -farc.2 -farc.3)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv06.at:30" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +exec <&- +decho Creating file +genfile --length 20139 --file file +decho Creating archive +tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file +decho Testing archive +tar -t -M -farc.1 -farc.2 -farc.3) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating file +Creating archive +Testing archive +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating file +Creating archive +Testing archive +file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv06.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/multiv06.at:30: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * +exec <&- +decho Creating file +genfile --length 20139 --file file +decho Creating archive +tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file +decho Testing archive +tar -t -M -farc.1 -farc.2 -farc.3)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv06.at:30" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 +exec <&- +decho Creating file +genfile --length 20139 --file file +decho Creating archive +tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file +decho Testing archive +tar -t -M -farc.1 -farc.2 -farc.3) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating file +Creating archive +Testing archive +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating file +Creating archive +Testing archive +file +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv06.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir foo/a -genfile --file foo/a/filea -mkdir foo/b -genfile --file foo/b/fileb -mkdir foo/c -genfile --file foo/c/filec -sleep 1 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_120 +#AT_START_121 +at_fn_group_banner 121 'multiv07.at:28' \ + "volumes split at an extended header" " " 17 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "121. $at_setup_line: testing $at_desc ..." + $at_traceon -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 +{ set +x +$as_echo "$at_srcdir/multiv07.at:31: -tar xfg arch.1 /dev/null -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +test -z \"\$TEST_DATA_DIR\" && exit 77 +tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77 -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +test -z \"\$TEST_DATA_DIR\" && exit 77 +tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77 -at_failed=false -echo >>"$at_stderr"; echo "First dump -tar: foo/a: Directory is new -tar: foo/b: Directory is new -tar: foo/c: Directory is new -Second dump -tar: foo/a: Directory has been renamed from \`foo/c' -tar: foo/b: Directory has been renamed from \`foo/a' -tar: foo/c: Directory has been renamed from \`foo/b' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "First dump -foo/ -foo/a/ -foo/b/ -foo/c/ -foo/file1 -foo/file2 -foo/a/filea -foo/b/fileb -foo/c/filec -Second dump -foo/ -foo/a/ -foo/b/ -foo/c/ -Begin directory listing 1 -foo -foo/a -foo/a/filea -foo/b -foo/b/fileb -foo/c -foo/c/filec -foo/file1 -foo/file2 -End directory listing 1 -foo/ -foo/a/ -foo/b/ -foo/c/ -Begin directory listing 2 -foo -foo/a -foo/a/filec -foo/b -foo/b/filea -foo/c -foo/c/fileb -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +exec <&- +cd \$TEST_DATA_DIR +tar -t -M -fxsplit-1.tar -fxsplit-2.tar +" +at_fn_check_prepare_notrace 'an embedded newline' "multiv07.at:31" +( $at_check_trace; - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/rename03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + +exec <&- + +cd $TEST_DATA_DIR +tar -t -M -fxsplit-1.tar -fxsplit-2.tar + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Archive volumes split at an extended header Volume 1 +foo +bar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv07.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_121 +#AT_START_122 +at_fn_group_banner 122 'multiv08.at:25' \ + "multivolume header creation" " " 17 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "122. $at_setup_line: testing $at_desc ..." + $at_traceon -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/a -genfile --file foo/a/filea + { set +x +$as_echo "$at_srcdir/multiv08.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -mkdir foo/b -genfile --file foo/b/fileb +genfile --length 9472 --file a +genfile --length 9984 --file b +decho Creating +tar -c -M -L10 -f A.tar -f B.tar -f C.tar a b +decho Testing +tar -tMR -f A.tar -f B.tar -f C.tar +)" +at_fn_check_prepare_notrace 'an embedded newline' "multiv08.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -mkdir foo/c -genfile --file foo/c/filec +genfile --length 9472 --file a +genfile --length 9984 --file b +decho Creating +tar -c -M -L10 -f A.tar -f B.tar -f C.tar a b +decho Testing +tar -tMR -f A.tar -f B.tar -f C.tar +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Creating +Testing +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Creating +Testing +block 0: a +block 21: b +block 43: ** Block of NULs ** +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multiv08.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_122 +#AT_START_123 +at_fn_group_banner 123 'owner.at:21' \ + "--owner and --group" " " 18 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "123. $at_setup_line: testing $at_desc ..." + $at_traceon -sleep 1 -echo \"First dump\" -echo \"First dump\">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 -# Shuffle directories: -(cd foo -mv a \$\$ -mv c a -mv b c -mv \$\$ b) -echo \"Second dump\" -echo \"Second dump\" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 -tar xfg arch.1 /dev/null + { set +x +$as_echo "$at_srcdir/owner.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -echo \"Begin directory listing 1\" -find foo | sort -echo \"End directory listing 1\" +export TZ=UTC0 -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -)" -echo rename03.at:26 >"$at_check_line_file" +genfile --file a -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +tar --owner=\"Joe the Plumber:1234\" \\ + --group=\"Plumber's Union:5678\" \\ + --mtime='@0' \\ + --mode='u=rw,go=r' \\ + -cf arc a -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +tar -tvf arc +tar --numeric-owner -tvf arc +)" +at_fn_check_prepare_notrace 'an embedded newline' "owner.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +export TZ=UTC0 -test -z "`sort < /dev/null 2>&1`" || exit 77 - +genfile --file a -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 +tar --owner="Joe the Plumber:1234" \ + --group="Plumber's Union:5678" \ + --mtime='@0' \ + --mode='u=rw,go=r' \ + -cf arc a -mkdir foo/a -genfile --file foo/a/filea +tar -tvf arc +tar --numeric-owner -tvf arc +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "-rw-r--r-- Joe the Plumber/Plumber's Union 0 1970-01-01 00:00 a +-rw-r--r-- 1234/5678 0 1970-01-01 00:00 a +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/owner.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -mkdir foo/b -genfile --file foo/b/fileb -mkdir foo/c -genfile --file foo/c/filec -sleep 1 -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_123 +#AT_START_124 +at_fn_group_banner 124 'sparse01.at:21' \ + "sparse files" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "124. $at_setup_line: testing $at_desc ..." + $at_traceon -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 -tar xfg arch.1 /dev/null -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + { set +x +$as_echo "$at_srcdir/sparse01.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 - -mkdir foo/a -genfile --file foo/a/filea - -mkdir foo/b -genfile --file foo/b/fileb - -mkdir foo/c -genfile --file foo/c/filec - -sleep 1 - -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:24" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stdout:; tee stdout <"$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -tar xfg arch.1 /dev/null + { set +x +$as_echo "$at_srcdir/sparse01.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator -tar xfgv arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:24" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -at_failed=false -echo >>"$at_stderr"; echo "First dump -tar: foo/a: Directory is new -tar: foo/b: Directory is new -tar: foo/c: Directory is new -Second dump -tar: foo/a: Directory has been renamed from \`foo/c' -tar: foo/b: Directory has been renamed from \`foo/a' -tar: foo/c: Directory has been renamed from \`foo/b' -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "First dump -foo/ -foo/a/ -foo/b/ -foo/c/ -foo/file1 -foo/file2 -foo/a/filea -foo/b/fileb -foo/c/filec -Second dump -foo/ -foo/a/ -foo/b/ -foo/c/ -Begin directory listing 1 -foo -foo/a -foo/a/filea -foo/b -foo/b/fileb -foo/c -foo/c/filec -foo/file1 -foo/file2 -End directory listing 1 -foo/ -foo/a/ -foo/b/ -foo/c/ -Begin directory listing 2 -foo -foo/a -foo/a/filec -foo/b -foo/b/filea -foo/c -foo/c/fileb -foo/file1 -foo/file2 -End directory listing 2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename03.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stdout:; tee stdout <"$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } - echo 1 > "$at_status_file" - exit 1 -fi + { set +x +$as_echo "$at_srcdir/sparse01.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -$at_traceon +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:24" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stdout:; tee stdout <"$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } - 36 ) # 36. rename04.at:27: renamed directory containing subdirectories - at_setup_line='rename04.at:27' - at_desc="renamed directory containing subdirectories" - $at_quiet $ECHO_N " 36: renamed directory containing subdirectories $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "36. rename04.at:27: testing ..." - $at_traceon +cat >stdout.re <<'_ATEOF' +separator +-rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin +-rw-r--r-- ^ ^ * *10344448 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile +-rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end +separator +sparsefile 10344448 +_ATEOF - $at_traceoff -echo "$at_srcdir/rename04.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * +awk '{print NR " " $0}' stdout > $$.1 +awk '{print NR " " $0}' stdout.re | join - $$.1 | +while read NUM RE LINE +do + echo "$LINE" | grep -- "$RE" >/dev/null || exit 1 +done -test -z "`sort < /dev/null 2>&1`" || exit 77 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_124 +#AT_START_125 +at_fn_group_banner 125 'sparse02.at:21' \ + "extracting sparse file over a pipe" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "125. $at_setup_line: testing $at_desc ..." + $at_traceon -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +# Tar 1.14 - 1.15.1 was unable to extract sparse files to a pipe. +# References: <16896.21739.460782.124775@jik.kamens.brookline.ma.us> +# http://lists.gnu.org/archive/html/bug-tar/2005-02/msg00003.html -decho Renaming -mv directory dir -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig + { set +x +$as_echo "$at_srcdir/sparse02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse sparsefile || exit 1 +echo separator -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy )" -echo rename04.at:30 >"$at_check_line_file" +at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse sparsefile || exit 1 +echo separator + +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/sparse02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse sparsefile || exit 1 +echo separator -if test -n "$at_trace_this"; then - ( $at_traceon; +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -16149,204 +29171,374 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse sparsefile || exit 1 +echo separator -test -z "`sort < /dev/null 2>&1`" || exit 77 +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/sparse02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse sparsefile || exit 1 +echo separator -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:28" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse sparsefile || exit 1 +echo separator -decho Renaming -mv directory dir +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_125 +#AT_START_126 +at_fn_group_banner 126 'sparse03.at:21' \ + "storing sparse files > 8G" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "126. $at_setup_line: testing $at_desc ..." + $at_traceon -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +# Tar 1.15.1 incorrectly computed sparse member size if the extended +# PAX header contained size keyword. +# References: <87vf46nb36.fsf@penguin.cs.ucla.edu> +# http://lists.gnu.org/archive/html/bug-tar/2005-06/msg00040.html -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + + + { set +x +$as_echo "$at_srcdir/sparse03.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * +genfile --length 1000 --file begin +genfile --length 1000 --file end +genfile --sparse --file sparsefile --block-size 512 8G A || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator -test -z "`sort < /dev/null 2>&1`" || exit 77 +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparse03.at:29" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +genfile --length 1000 --file begin +genfile --length 1000 --file end +genfile --sparse --file sparsefile --block-size 512 8G A || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator -decho Creating directory structure +tar tfv archive +echo separator mkdir directory -mkdir directory/subdir -genfile --file=directory/file +tar Cxf directory archive +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stdout:; tee stdout <"$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/sparse03.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } -decho Creating initial archive -tar -cf archive.1 -g db.1 directory -decho Renaming -mv directory dir -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +cat >stdout.re <<'_ATEOF' +separator +-rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin +-rw-r--r-- ^ ^ * *8589935104 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile +-rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end +separator +sparsefile 8589935104 +_ATEOF + +awk '{print NR " " $0}' stdout > $$.1 +awk '{print NR " " $0}' stdout.re | join - $$.1 | +while read NUM RE LINE +do + echo "$LINE" | grep -- "$RE" >/dev/null || exit 1 +done + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_126 +#AT_START_127 +at_fn_group_banner 127 'sparse04.at:21' \ + "storing long sparse file names" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "127. $at_setup_line: testing $at_desc ..." + $at_traceon + + -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +# Description: Tar versions from 1.15.92 to 1.25 would incorrectly +# store sparse file names longer than 100 characters in pax mode. +# Namely, the 'path' keyword of the produced PAX header would contain the +# crafted name of the header itself, instead of that of the file. +# Reported by: Kamil Dudka +# References: <201011250026.44908.kdudka@redhat.com>, +# http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00099.html -at_failed=false -echo >>"$at_stderr"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -Second restore -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -directory -directory/file -directory/subdir -Second restore -dir -dir/subdir -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename04.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/rename04.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + { set +x +$as_echo "$at_srcdir/sparse04.at:35: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H pax\" export TAR_OPTIONS rm -rf * +genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77 +tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf - +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparse04.at:35" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77 +tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf - +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/sparse04.at:35" +$at_failed && at_fn_log_failure +$at_traceon; } -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file -decho Creating initial archive -tar -cf archive.1 -g db.1 directory -decho Renaming -mv directory dir -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_127 +#AT_START_128 +at_fn_group_banner 128 'sparsemv.at:21' \ + "sparse files in MV archives" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "128. $at_setup_line: testing $at_desc ..." + $at_traceon -mv dir orig -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -)" -echo rename04.at:30 >"$at_check_line_file" +# Check if sparse files are correctly split between GNU multi-volume +# archives. +# There are two cases: the file can be split within an empty (null) block, +# or within a data block. Since null blocks are not archived, the first +# case means the file is split between two consecutive data blocks. +# -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + { set +x +$as_echo "$at_srcdir/sparsemv.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo \"Pass 1: Split between data blocks\" +echo \"Create archive\" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo \"Test archive\" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo \"Compare archive\" +tar --record-size=512 -d -M -f arc.1 -f arc.2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory dir +echo \"Pass 2: Split within a data block\" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo \"Create archive\" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo \"Test archive\" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo \"Compare archive\" +tar --record-size=512 -d -M -f arc.1 -f arc.2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparsemv.at:31" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo "Pass 1: Split between data blocks" +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 -mv dir orig +echo "Pass 2: Split within a data block" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks +Create archive +Test archive +sparsefile +Compare archive +Pass 2: Split within a data block +Create archive +Test archive +sparsefile +Compare archive +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/sparsemv.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/sparsemv.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo \"Pass 1: Split between data blocks\" +echo \"Create archive\" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo \"Test archive\" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo \"Compare archive\" +tar --record-size=512 -d -M -f arc.1 -f arc.2 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +echo \"Pass 2: Split within a data block\" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo \"Create archive\" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo \"Test archive\" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo \"Compare archive\" +tar --record-size=512 -d -M -f arc.1 -f arc.2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "sparsemv.at:31" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16355,879 +29547,1001 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo "Pass 1: Split between data blocks" +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir - -mv dir orig - -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort - -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -Second restore -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -directory -directory/file -directory/subdir -Second restore -dir -dir/subdir -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename04.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - +echo "Pass 2: Split within a data block" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks +Create archive +Test archive +sparsefile +Compare archive +Pass 2: Split within a data block +Create archive +Test archive +sparsefile +Compare archive +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/sparsemv.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/rename04.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_128 +#AT_START_129 +at_fn_group_banner 129 'spmvp00.at:21' \ + "sparse files in PAX MV archives, v.0.0" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "129. $at_setup_line: testing $at_desc ..." + $at_traceon -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file -decho Creating initial archive -tar -cf archive.1 -g db.1 directory -decho Renaming -mv directory dir -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig + { set +x +$as_echo "$at_srcdir/spmvp00.at:24: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77 +echo \"Pass 1: Split between data blocks\" +echo \"Create archive\" +tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo \"Test archive\" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo \"Compare archive\" +tar -d -M -f arc.1 -f arc.2 -f arc.3 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +echo \"Pass 2: Split within a data block\" +genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 +echo \"Create archive\" +tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo \"Test archive\" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo \"Compare archive\" +tar -d -M -f arc.1 -f arc.2 -f arc.3 )" -echo rename04.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +at_fn_check_prepare_notrace 'an embedded newline' "spmvp00.at:24" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77 +echo "Pass 1: Split between data blocks" +echo "Create archive" +tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo "Test archive" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo "Compare archive" +tar -d -M -f arc.1 -f arc.2 -f arc.3 -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "Pass 2: Split within a data block" +genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 +echo "Create archive" +tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo "Test archive" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo "Compare archive" +tar -d -M -f arc.1 -f arc.2 -f arc.3 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks +Create archive +Test archive +sparsefile +Compare archive +Pass 2: Split within a data block +Create archive +Test archive +sparsefile +Compare archive +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/spmvp00.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file -decho Creating initial archive -tar -cf archive.1 -g db.1 directory -decho Renaming -mv directory dir + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_129 +#AT_START_130 +at_fn_group_banner 130 'spmvp01.at:21' \ + "sparse files in PAX MV archives, v.0.1" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "130. $at_setup_line: testing $at_desc ..." + $at_traceon -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + + + { set +x +$as_echo "$at_srcdir/spmvp01.at:24: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo \"Pass 1: Split between data blocks\" +echo \"Create archive\" +tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo \"Test archive\" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo \"Compare archive\" +tar -d -M -f arc.1 -f arc.2 -f arc.3 + +echo \"Pass 2: Split within a data block\" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo \"Create archive\" +tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo \"Test archive\" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo \"Compare archive\" +tar -d -M -f arc.1 -f arc.2 -f arc.3 +)" +at_fn_check_prepare_notrace 'an embedded newline' "spmvp01.at:24" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo "Pass 1: Split between data blocks" +echo "Create archive" +tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo "Test archive" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo "Compare archive" +tar -d -M -f arc.1 -f arc.2 -f arc.3 -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "Pass 2: Split within a data block" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo "Create archive" +tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo "Test archive" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo "Compare archive" +tar -d -M -f arc.1 -f arc.2 -f arc.3 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks +Create archive +Test archive +sparsefile +Compare archive +Pass 2: Split within a data block +Create archive +Test archive +sparsefile +Compare archive +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/spmvp01.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file -decho Creating initial archive -tar -cf archive.1 -g db.1 directory -decho Renaming -mv directory dir + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_130 +#AT_START_131 +at_fn_group_banner 131 'spmvp10.at:21' \ + "sparse files in PAX MV archives, v.1.0" " " 19 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "131. $at_setup_line: testing $at_desc ..." + $at_traceon -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -Second restore -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -directory -directory/file -directory/subdir -Second restore -dir -dir/subdir -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename04.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + { set +x +$as_echo "$at_srcdir/spmvp10.at:24: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H pax\" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 +echo \"Pass 1: Split between data blocks\" +echo \"Create archive\" +tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo \"Test archive\" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo \"Compare archive\" +tar -d -M -f arc.1 -f arc.2 -f arc.3 + +echo \"Pass 2: Split within a data block\" +genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77 +echo \"Create archive\" +tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo \"Test archive\" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo \"Compare archive\" +tar -d -M -f arc.1 -f arc.2 -f arc.3 +)" +at_fn_check_prepare_notrace 'an embedded newline' "spmvp10.at:24" +( $at_check_trace; +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 +echo "Pass 1: Split between data blocks" +echo "Create archive" +tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo "Test archive" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo "Compare archive" +tar -d -M -f arc.1 -f arc.2 -f arc.3 -$at_traceon +echo "Pass 2: Split within a data block" +genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77 +echo "Create archive" +tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +echo "Test archive" +tar -t -M -f arc.1 -f arc.2 -f arc.3 +echo "Compare archive" +tar -d -M -f arc.1 -f arc.2 -f arc.3 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks +Create archive +Test archive +sparsefile +Compare archive +Pass 2: Split within a data block +Create archive +Test archive +sparsefile +Compare archive +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/spmvp10.at:24" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 37 ) # 37. rename05.at:24: renamed subdirectories - at_setup_line='rename05.at:24' - at_desc="renamed subdirectories" - $at_quiet $ECHO_N " 37: renamed subdirectories $ECHO_C" - at_xfail=no + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_131 +#AT_START_132 +at_fn_group_banner 132 'update.at:28' \ + "update unchanged directories" " " 20 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "37. rename05.at:24: testing ..." - $at_traceon +( + $as_echo "132. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/rename05.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + { set +x +$as_echo "$at_srcdir/update.at:31: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -decho Creating directory structure mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir - -mv dir orig - -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 )" -echo rename05.at:27 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +directory/ +directory/file1 +directory/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir - -mv dir orig - -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +directory/ +directory/file1 +directory/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update.at:31: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -at_failed=false -echo >>"$at_stderr"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -Second restore -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -directory -directory/file -directory/subdir -Second restore -dir -dir/subdir.0 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename05.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -$at_traceon -$at_traceoff -echo "$at_srcdir/rename05.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -mv dir orig +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +directory/ +directory/file1 +directory/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update.at:31: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -)" -echo rename05.at:27 >"$at_check_line_file" +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +directory/ +directory/file1 +directory/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure mkdir directory -mkdir directory/subdir -genfile --file=directory/file +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +directory/ +directory/file1 +directory/file2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir -mv dir orig -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_132 +#AT_START_133 +at_fn_group_banner 133 'update01.at:29' \ + "update directories" " " 20 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "133. $at_setup_line: testing $at_desc ..." + $at_traceon -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -Second restore -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -directory -directory/file -directory/subdir -Second restore -dir -dir/subdir.0 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename05.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/rename05.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + { set +x +$as_echo "$at_srcdir/update01.at:32: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +mkdir a +genfile --file a/b -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +tar cf arc a -mv dir orig +echo \"separator\" -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +sleep 2 +genfile --file a/c -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 )" -echo rename05.at:27 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir a +genfile --file a/b -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +tar cf arc a -mv dir orig +echo "separator" -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +sleep 2 +genfile --file a/c -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/c +separator +a/ +a/b +a/c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update01.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +mkdir a +genfile --file a/b -mv dir orig +tar cf arc a -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +echo \"separator\" -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +sleep 2 +genfile --file a/c -at_failed=false -echo >>"$at_stderr"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -Second restore -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating directory structure -Creating initial archive -Renaming -Creating incremental archive -First restore -directory -directory/file -directory/subdir -Second restore -dir -dir/subdir.0 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/rename05.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 -$at_traceon +mkdir a +genfile --file a/b +tar cf arc a +echo "separator" - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +sleep 2 +genfile --file a/c - 38 ) # 38. chtype.at:27: changed file types in incrementals - at_setup_line='chtype.at:27' - at_desc="changed file types in incrementals" - $at_quiet $ECHO_N " 38: changed file types in incrementals $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "38. chtype.at:27: testing ..." - $at_traceon +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/c +separator +a/ +a/b +a/c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update01.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir a +genfile --file a/b +tar cf arc a - $at_traceoff -echo "$at_srcdir/chtype.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +echo \"separator\" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo "separator" sleep 2 +genfile --file a/c -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/c +separator +a/ +a/b +a/c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update01.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory -# Delete a -rm -r directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -)" -echo chtype.at:30 >"$at_check_line_file" +mkdir a +genfile --file a/b -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +tar cf arc a -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +echo \"separator\" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo "separator" sleep 2 +genfile --file a/c -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/c +separator +a/ +a/b +a/c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update01.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory -# Delete a -rm -r directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir a +genfile --file a/b + +tar cf arc a + +echo \"separator\" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17239,319 +30553,296 @@ rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo "separator" sleep 2 +genfile --file a/c -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory - -# Delete a -rm -r directory +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/c +separator +a/ +a/b +a/c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_133 +#AT_START_134 +at_fn_group_banner 134 'update02.at:26' \ + "update changed files" " " 20 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "134. $at_setup_line: testing $at_desc ..." + $at_traceon -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "First backup -Second backup -Restore archive.1 -Restore archive.2 -directory -directory/a -directory/a/a -directory/a/b -directory/b -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/chtype.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/chtype.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + { set +x +$as_echo "$at_srcdir/update02.at:29: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo \"separator\" sleep 2 +touch a/b -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory - -# Delete a -rm -r directory - -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 )" -echo chtype.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo "separator" sleep 2 +touch a/b -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory - -# Delete a -rm -r directory - -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/b +separator +a/ +a/b +a/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update02.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo \"separator\" sleep 2 +touch a/b -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -# Delete a -rm -r directory -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "First backup -Second backup -Restore archive.1 -Restore archive.2 -directory -directory/a -directory/a/a -directory/a/b -directory/b -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/chtype.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +mkdir a +genfile --file a/b +tar cf arc a - echo 1 > "$at_status_file" - exit 1 -fi +echo "separator" -$at_traceon -$at_traceoff -echo "$at_srcdir/chtype.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/b +separator +a/ +a/b +a/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update02.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo \"separator\" sleep 2 +touch a/b -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory -# Delete a -rm -r directory +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -)" -echo chtype.at:30 >"$at_check_line_file" +mkdir a +genfile --file a/b -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +tar cf arc a + +echo "separator" -if test -n "$at_trace_this"; then - ( $at_traceon; +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/b +separator +a/ +a/b +a/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update02.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo \"separator\" sleep 2 +touch a/b -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory - -# Delete a -rm -r directory - -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -17563,89 +30854,129 @@ rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir a +genfile --file a/b -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +tar cf arc a -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo "separator" sleep 2 +touch a/b -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/b +separator +a/ +a/b +a/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/update02.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory -# Delete a -rm -r directory +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null -find directory | sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir a +genfile --file a/b -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "First backup -Second backup -Restore archive.1 -Restore archive.2 -directory -directory/a -directory/a/a -directory/a/b -directory/b -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/chtype.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +tar cf arc a +echo \"separator\" - echo 1 > "$at_status_file" - exit 1 -fi +sleep 2 +touch a/b + +tar ufv arc a +echo \"separator\" +tar tf arc | sort || exit 1 +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -$at_traceon +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir a +genfile --file a/b - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b - 39 ) # 39. ignfail.at:23: ignfail - at_setup_line='ignfail.at:23' - at_desc="ignfail" - $at_quiet $ECHO_N " 39: ignfail $ECHO_C" - at_xfail=no +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +a/b +separator +a/ +a/b +a/b +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_134 +#AT_START_135 +at_fn_group_banner 135 'verify.at:25' \ + "verify" " " 21 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "39. ignfail.at:23: testing ..." - $at_traceon +( + $as_echo "135. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/ignfail.at:26: + { set +x +$as_echo "$at_srcdir/verify.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17654,586 +30985,579 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +touch foo +tar -cvf archive.tar --verify foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * +touch foo +tar -cvf archive.tar --verify foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +Verify foo +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verify.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -touch file -mkdir directory -touch directory/file +touch foo +tar -cvf archive.tar --verify foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=\$? -chmod 600 file -test \$status = 2 || exit 1 +touch foo +tar -cvf archive.tar --verify foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +Verify foo +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verify.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=\$? -chmod 600 file -test \$status = 0 || exit 1 +touch foo +tar -cvf archive.tar --verify foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=\$? -chmod 700 directory -test \$status = 2 || exit 1 +touch foo +tar -cvf archive.tar --verify foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +Verify foo +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verify.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=\$? -chmod 700 directory -test \$status = 0 +touch foo +tar -cvf archive.tar --verify foo )" -echo ignfail.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +touch foo +tar -cvf archive.tar --verify foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +Verify foo +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/verify.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +touch foo +tar -cvf archive.tar --verify foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +touch foo +tar -cvf archive.tar --verify foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +Verify foo +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_135 +#AT_START_136 +at_fn_group_banner 136 'volume.at:23' \ + "volume" " " 22 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "136. $at_setup_line: testing $at_desc ..." + $at_traceon -touch file -mkdir directory -touch directory/file -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + { set +x +$as_echo "$at_srcdir/volume.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file +tar -cf archive -V label -T /dev/null || exit 1 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +tar xfV archive label || exit 1 +tar xfV archive 'la?el' || exit 1 +tar xfV archive 'l*l' || exit 1 echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - +tar xfV archive lab +test \$? = 2 || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - +tar xfV archive bel +test \$? = 2 || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "----- -tar: file: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: file: Warning: Cannot open: Permission denied ------ -tar: directory: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: directory: Warning: Cannot open: Permission denied -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/ignfail.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/ignfail.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +tar xfV archive babel +test \$? = 2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "volume.at:26" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file +tar -cf archive -V label -T /dev/null || exit 1 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=\$? -chmod 600 file -test \$status = 2 || exit 1 +tar xfV archive label || exit 1 +tar xfV archive 'la?el' || exit 1 +tar xfV archive 'l*l' || exit 1 echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=\$? -chmod 600 file -test \$status = 0 || exit 1 - +tar xfV archive lab +test $? = 2 || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=\$? -chmod 700 directory -test \$status = 2 || exit 1 - +tar xfV archive bel +test $? = 2 || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=\$? -chmod 700 directory -test \$status = 0 -)" -echo ignfail.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +tar xfV archive babel +test $? = 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "----- +tar: Volume 'label' does not match 'lab' +tar: Error is not recoverable: exiting now +----- +tar: Volume 'label' does not match 'bel' +tar: Error is not recoverable: exiting now +----- +tar: Volume 'label' does not match 'babel' +tar: Error is not recoverable: exiting now +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/volume.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/volume.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file +tar -cf archive -V label -T /dev/null || exit 1 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +tar xfV archive label || exit 1 +tar xfV archive 'la?el' || exit 1 +tar xfV archive 'l*l' || exit 1 echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - +tar xfV archive lab +test \$? = 2 || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - +tar xfV archive bel +test \$? = 2 || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar xfV archive babel +test \$? = 2 +)" +at_fn_check_prepare_notrace 'an embedded newline' "volume.at:26" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS -rm -rf * - -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +tar -cf archive -V label -T /dev/null || exit 1 -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 +tar xfV archive label || exit 1 +tar xfV archive 'la?el' || exit 1 +tar xfV archive 'l*l' || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - +tar xfV archive lab +test $? = 2 || exit 1 echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "----- -tar: file: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: file: Warning: Cannot open: Permission denied +tar xfV archive bel +test $? = 2 || exit 1 +echo 1>&2 ----- +tar xfV archive babel +test $? = 2 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "----- +tar: Volume 'label' does not match 'lab' +tar: Error is not recoverable: exiting now ----- -tar: directory: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors +tar: Volume 'label' does not match 'bel' +tar: Error is not recoverable: exiting now ----- -tar: directory: Warning: Cannot open: Permission denied -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/ignfail.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +tar: Volume 'label' does not match 'babel' +tar: Error is not recoverable: exiting now +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/volume.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/ignfail.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_136 +#AT_START_137 +at_fn_group_banner 137 'volsize.at:29' \ + "volume header size" " " 22 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "137. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/volsize.at:32: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -touch file -mkdir directory -touch directory/file +test -z \"\$TEST_DATA_DIR\" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=\$? -chmod 600 file -test \$status = 2 || exit 1 +echo Short Listing +tar tf \$TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf \$TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf \$TEST_DATA_DIR/abc.tar +find abc|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=\$? -chmod 600 file -test \$status = 0 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=\$? -chmod 700 directory -test \$status = 2 || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=\$? -chmod 700 directory -test \$status = 0 -)" -echo ignfail.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +echo Short Listing +tar tf $TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf $TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf $TEST_DATA_DIR/abc.tar +find abc|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Short Listing +abc/not-a-file.gif +abc/CCC +Verbose Listing +V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- +-rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC +Extracted directory +abc +abc/CCC +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/volsize.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -touch file -mkdir directory -touch directory/file +test -z \"\$TEST_DATA_DIR\" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +echo Short Listing +tar tf \$TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf \$TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf \$TEST_DATA_DIR/abc.tar +find abc|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + +echo Short Listing +tar tf $TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf $TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf $TEST_DATA_DIR/abc.tar +find abc|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Short Listing +abc/not-a-file.gif +abc/CCC +Verbose Listing +V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- +-rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC +Extracted directory +abc +abc/CCC +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/volsize.at:32: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - -touch file -mkdir directory -touch directory/file +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 +test -z \"\$TEST_DATA_DIR\" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +echo Short Listing +tar tf \$TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf \$TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf \$TEST_DATA_DIR/abc.tar +find abc|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "----- -tar: file: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: file: Warning: Cannot open: Permission denied ------ -tar: directory: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: directory: Warning: Cannot open: Permission denied -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/ignfail.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +test -z "`sort < /dev/null 2>&1`" || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -$at_traceon -$at_traceoff -echo "$at_srcdir/ignfail.at:26: +echo Short Listing +tar tf $TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf $TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf $TEST_DATA_DIR/abc.tar +find abc|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Short Listing +abc/not-a-file.gif +abc/CCC +Verbose Listing +V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- +-rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC +Extracted directory +abc +abc/CCC +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/volsize.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -18242,57 +31566,23 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=\$? -chmod 600 file -test \$status = 2 || exit 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=\$? -chmod 600 file -test \$status = 0 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=\$? -chmod 700 directory -test \$status = 2 || exit 1 +test -z \"\$TEST_DATA_DIR\" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=\$? -chmod 700 directory -test \$status = 0 +echo Short Listing +tar tf \$TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf \$TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf \$TEST_DATA_DIR/abc.tar +find abc|sort )" -echo ignfail.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -18301,413 +31591,501 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file -mkdir directory -touch directory/file +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +echo Short Listing +tar tf $TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf $TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf $TEST_DATA_DIR/abc.tar +find abc|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Short Listing +abc/not-a-file.gif +abc/CCC +Verbose Listing +V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- +-rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC +Extracted directory +abc +abc/CCC +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/volsize.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +test -z \"\$TEST_DATA_DIR\" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77 + +echo Short Listing +tar tf \$TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf \$TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf \$TEST_DATA_DIR/abc.tar +find abc|sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file -mkdir directory -touch directory/file +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +echo Short Listing +tar tf $TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf $TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf $TEST_DATA_DIR/abc.tar +find abc|sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Short Listing +abc/not-a-file.gif +abc/CCC +Verbose Listing +V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- +-rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC +Extracted directory +abc +abc/CCC +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "----- -tar: file: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: file: Warning: Cannot open: Permission denied ------ -tar: directory: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: directory: Warning: Cannot open: Permission denied -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/ignfail.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_137 +#AT_START_138 +at_fn_group_banner 138 'comprec.at:21' \ + "compressed format recognition" " " 23 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "138. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + { set +x +$as_echo "$at_srcdir/comprec.at:25: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * + + +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +genfile --length 10240 --file file1 +echo \"separator\" +tar cfz archive file1 +echo \"separator\" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -$at_traceon -$at_traceoff -echo "$at_srcdir/ignfail.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/comprec.at:25: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -touch file -mkdir directory -touch directory/file +genfile --length 10240 --file file1 +echo \"separator\" +tar cfz archive file1 +echo \"separator\" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=\$? -chmod 600 file -test \$status = 2 || exit 1 -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=\$? -chmod 600 file -test \$status = 0 || exit 1 +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=\$? -chmod 700 directory -test \$status = 2 || exit 1 +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/comprec.at:25: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=\$? -chmod 700 directory -test \$status = 0 -)" -echo ignfail.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +genfile --length 10240 --file file1 +echo \"separator\" +tar cfz archive file1 +echo \"separator\" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/comprec.at:25: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -touch file -mkdir directory -touch directory/file +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +genfile --length 10240 --file file1 +echo \"separator\" +tar cfz archive file1 +echo \"separator\" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/comprec.at:25: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file - -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -at_failed=false -echo >>"$at_stderr"; echo "----- -tar: file: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: file: Warning: Cannot open: Permission denied ------ -tar: directory: Cannot open: Permission denied -tar: Exiting with failure status due to previous errors ------ -tar: directory: Warning: Cannot open: Permission denied -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/ignfail.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile --length 10240 --file file1 +echo \"separator\" +tar cfz archive file1 +echo \"separator\" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +)" +at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -$at_traceon +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +separator +file1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 40 ) # 40. link01.at:33: link count gt 2 - at_setup_line='link01.at:33' - at_desc="link count gt 2" - $at_quiet $ECHO_N " 40: link count gt 2 $ECHO_C" - at_xfail=no + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_138 +#AT_START_139 +at_fn_group_banner 139 'shortfile.at:26' \ + "short input files" " " 23 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "40. link01.at:33: testing ..." - $at_traceon +( + $as_echo "139. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/link01.at:36: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + { set +x +$as_echo "$at_srcdir/shortfile.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 +genfile --length 511 --file foo || exit 5 +tar tf foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "shortfile.at:29" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 +genfile --length 511 --file foo || exit 5 +tar tf foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: This does not look like a tar archive +tar: Exiting with failure status due to previous errors +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/shortfile.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } -tar cf archive directory/test1/test.txt directory/test1/test.txt -rm -r directory -tar xf archive -ls directory/test1 -)" -echo link01.at:36 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_139 +#AT_START_140 +at_fn_group_banner 140 'shortupd.at:31' \ + "updating short archives" " " 23 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "140. $at_setup_line: testing $at_desc ..." + $at_traceon + + + -if test -n "$at_trace_this"; then - ( $at_traceon; + + { set +x +$as_echo "$at_srcdir/shortupd.at:34: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +touch foo +tar uf archive foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18716,43 +32094,20 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "test.txt -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/link01.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/link01.at:36: +touch foo +tar uf archive foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortupd.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -18761,56 +32116,11 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 +touch foo +tar uf archive foo )" -echo link01.at:36 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -18819,43 +32129,20 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "test.txt -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/link01.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/link01.at:36: +touch foo +tar uf archive foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortupd.at:34: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -18864,56 +32151,11 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 +touch foo +tar uf archive foo )" -echo link01.at:36 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -18922,101 +32164,33 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "test.txt -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/link01.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/link01.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -)" -echo link01.at:36 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +touch foo +tar uf archive foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortupd.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +touch foo +tar uf archive foo +)" +at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19025,43 +32199,20 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "test.txt -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/link01.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon -$at_traceoff -echo "$at_srcdir/link01.at:36: +touch foo +tar uf archive foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/shortupd.at:34: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19070,56 +32221,11 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 +touch foo +tar uf archive foo )" -echo link01.at:36 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19128,70 +32234,41 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive - -ls directory/test1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "test.txt -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/link01.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 41 ) # 41. longv7.at:24: long names in V7 archives - at_setup_line='longv7.at:24' - at_desc="long names in V7 archives" - $at_quiet $ECHO_N " 41: long names in V7 archives $ECHO_C" - at_xfail=no +touch foo +tar uf archive foo +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_140 +#AT_START_141 +at_fn_group_banner 141 'truncate.at:29' \ + "truncate" " " 23 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "41. longv7.at:24: testing ..." - $at_traceon - - - +( + $as_echo "141. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/longv7.at:30: + { set +x +$as_echo "$at_srcdir/truncate.at:32: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19200,22 +32277,15 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems -touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c - -tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: \$? echo separator -tar tf archive -)" -echo longv7.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar)" +at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19224,129 +32294,449 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems -touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +Exit status: 1 +separator +foo +foo: Mod time differs +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/truncate.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * -tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: \$? echo separator -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar)" +at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems -touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +Exit status: 1 +separator +foo +foo: Mod time differs +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/truncate.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: \$? echo separator -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar)" +at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -at_failed=false -echo >>"$at_stderr"; echo "tar: this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c: file name is too long (max 99); not dumped -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -this_is_a_very_long_name_for_a_directory_which_causes_problems/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/longv7.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +Exit status: 1 +separator +foo +foo: Mod time differs +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/truncate.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * + +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: \$? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar)" +at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +Exit status: 1 +separator +foo +foo: Mod time differs +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/truncate.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: \$? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar)" +at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -$at_traceon +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +Exit status: 1 +separator +foo +foo: Mod time differs +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 42 ) # 42. long01.at:28: long file names divisible by block size - at_setup_line='long01.at:28' - at_desc="long file names divisible by block size" - $at_quiet $ECHO_N " 42: long file names divisible by block size $ECHO_C" - at_xfail=no + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_141 +#AT_START_142 +at_fn_group_banner 142 'grow.at:24' \ + "grow" " " 23 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "42. long01.at:28: testing ..." - $at_traceon - +( + $as_echo "142. $at_setup_line: testing $at_desc ..." + $at_traceon + { set +x +$as_echo "$at_srcdir/grow.at:27: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H v7\" +export TAR_OPTIONS +rm -rf * +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +)" +at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/grow.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H oldgnu\" +export TAR_OPTIONS +rm -rf * - $at_traceoff -echo "$at_srcdir/long01.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +)" +at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/grow.at:27: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H ustar\" +export TAR_OPTIONS +rm -rf * -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +)" +at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile -tar tf archive)" -echo long01.at:36 >"$at_check_line_file" +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/grow.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +)" +at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -if test -n "$at_trace_this"; then - ( $at_traceon; +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/grow.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * - -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile - -tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +)" +at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19355,455 +32745,688 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +genfile --file foo --length 50000k +genfile --file baz +genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "foo +baz +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27" +$at_failed && at_fn_log_failure +$at_traceon; } -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile -tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde -endfile -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/long01.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_142 +#AT_START_143 +at_fn_group_banner 143 'sigpipe.at:21' \ + "sigpipe handling" " " 23 +at_xfail=no +( + $as_echo "143. $at_setup_line: testing $at_desc ..." + $at_traceon - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/long01.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" -export TAR_OPTIONS -rm -rf * +# Description: Tar 1.23 ignored sigpipe which lead to spurious "write +# error" diagnostics when piping output to another programs. +# Reported-by: "Dmitry V. Levin" +# References: http://lists.gnu.org/archive/html/bug-tar/2010-03/msg00039.html +# <20100319184141.GC30047@wo.int.altlinux.org> -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile +{ set +x +$as_echo "$at_srcdir/sigpipe.at:30: -tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile -tar tf archive)" -echo long01.at:36 >"$at_check_line_file" +case \`(cat \"\$at_myself\" 2>&3 | :) 3>&1 >/dev/null\` in #( +?*) exit 77;; +esac -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +genfile --length 2048 --file first +genfile --length 2048 --file second +genfile --length 2049 --file third +tar cf archive first second third -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile +# Discard diagnostics that some shells generate about broken pipes. +(tar tf archive 2>&3 | :) 3>&2 2>/dev/null +" +at_fn_check_prepare_notrace 'a `...` command substitution' "sigpipe.at:30" +( $at_check_trace; -tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( +?*) exit 77;; +esac -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile +genfile --length 2048 --file first +genfile --length 2048 --file second +genfile --length 2049 --file third -tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar cf archive first second third -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde -endfile -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/long01.at:36: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# Discard diagnostics that some shells generate about broken pipes. +(tar tf archive 2>&3 | :) 3>&2 2>/dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/sigpipe.at:30" +$at_failed && at_fn_log_failure +$at_traceon; } - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_143 +#AT_START_144 +at_fn_group_banner 144 'remfiles01.at:28' \ + "remove-files with compression" " " 24 +at_xfail=no +( + $as_echo "144. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +unset TAR_OPTIONS +{ set +x +$as_echo "$at_srcdir/remfiles01.at:32: - 43 ) # 43. lustar01.at:21: ustar: unsplittable file name - at_setup_line='lustar01.at:21' - at_desc="ustar: unsplittable file name" - $at_quiet $ECHO_N " 43: ustar: unsplittable file name $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "43. lustar01.at:21: testing ..." - $at_traceon +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 && exit 77 +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +case \`(cat \"\$at_myself\" 2>&3 | :) 3>&1 >/dev/null\` in #( +?*) exit 77;; +esac +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - $at_traceoff -echo "$at_srcdir/lustar01.at:27: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" -export TAR_OPTIONS -rm -rf * -genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix -)" -echo lustar01.at:27 >"$at_check_line_file" +mkdir dir +cd dir +genfile --file a --length 0 +chmod 0 a +genfile --file b +mkdir c + +# Depending on when the SIGPIPE gets delivered, the invocation below +# may finish with either +# tar: a: Cannot write: Broken pipe +# or +# tar: Child returned status 2 + +# Discard diagnostics that some shells generate about broken pipes, +# and discard all of tar's diagnostics except for the ones saying \"(child)\". +# Gzip's exit code is propagated to the shell. Usually it is 141. +# Convert all non-zero exits to 2 to make it predictable. +(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null +EC=\$? +sed -n '/(child)/p' err >&2 +rm err +find . | sort +exit \$EC +" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles01.at:32" +( $at_check_trace; -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix: file name is too long (cannot be split); not dumped -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 2) ;; - *) echo "$at_srcdir/lustar01.at:27: exit code was $at_status, expected 2" - at_failed=:;; +case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( +?*) exit 77;; esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir dir +cd dir +genfile --file a --length 0 +chmod 0 a +genfile --file b +mkdir c + +# Depending on when the SIGPIPE gets delivered, the invocation below +# may finish with either +# tar: a: Cannot write: Broken pipe +# or +# tar: Child returned status 2 + +# Discard diagnostics that some shells generate about broken pipes, +# and discard all of tar's diagnostics except for the ones saying "(child)". +# Gzip's exit code is propagated to the shell. Usually it is 141. +# Convert all non-zero exits to 2 to make it predictable. +(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null +EC=$? +sed -n '/(child)/p' err >&2 +rm err +find . | sort +exit $EC + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar (child): a: Cannot open: Permission denied +tar (child): Error is not recoverable: exiting now +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo ". +./a +./b +./c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/remfiles01.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_144 +#AT_START_145 +at_fn_group_banner 145 'remfiles02.at:28' \ + "remove-files with compression: grand-child" " " 24 +at_xfail=no +( + $as_echo "145. $at_setup_line: testing $at_desc ..." + $at_traceon -$at_traceon +unset TAR_OPTIONS +{ set +x +$as_echo "$at_srcdir/remfiles02.at:32: - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - 44 ) # 44. lustar02.at:21: ustar: unsplittable path name - at_setup_line='lustar02.at:21' - at_desc="ustar: unsplittable path name" - $at_quiet $ECHO_N " 44: ustar: unsplittable path name $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "44. lustar02.at:21: testing ..." - $at_traceon +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir dir +cd dir +mkdir a +genfile --file b +mkdir c + +tar -c -f a -z --remove-files b c 2>err +EC=\$? +sed -n '/(child)/p' err >&2 +rm err +find . | sort +exit \$EC +" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles02.at:32" +( $at_check_trace; +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +cd dir +mkdir a +genfile --file b +mkdir c + +tar -c -f a -z --remove-files b c 2>err +EC=$? +sed -n '/(child)/p' err >&2 +rm err +find . | sort +exit $EC + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "tar (child): a: Cannot open: Is a directory +tar (child): Error is not recoverable: exiting now +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo ". +./a +./b +./c +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/remfiles02.at:32" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_145 +#AT_START_146 +at_fn_group_banner 146 'remfiles03.at:28' \ + "remove-files with symbolic links" " " 24 +at_xfail=no +( + $as_echo "146. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/lustar02.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" -export TAR_OPTIONS -rm -rf * +{ set +x +$as_echo "$at_srcdir/remfiles03.at:31: +mkdir a +mkdir a/b +ln -s b a/c || exit 77 +tar --remove-files -cf a.tar a +genfile --stat a +" +at_fn_check_prepare_notrace 'an embedded newline' "remfiles03.at:31" +( $at_check_trace; +mkdir a +mkdir a/b +ln -s b a/c || exit 77 +tar --remove-files -cf a.tar a +genfile --stat a + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "genfile: stat(a) failed: No such file or directory +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles03.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_146 +#AT_START_147 +at_fn_group_banner 147 'remfiles04a.at:25' \ + "remove-files with -C:rel in -c/non-incr. mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "147. $at_setup_line: testing $at_desc ..." + $at_traceon -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -)" -echo lustar02.at:32 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + + { set +x +$as_echo "$at_srcdir/remfiles04a.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir foo +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar --remove-files -C foo bar +echo A +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04a.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 -at_failed=false -echo >>"$at_stderr"; echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/: file name is too long (cannot be split); not dumped -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 2) ;; - *) echo "$at_srcdir/lustar02.at:32: exit code was $at_status, expected 2" - at_failed=:;; -esac -if $at_failed; then +mkdir foo +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar --remove-files -C foo bar +echo A +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./bar +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles04a.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_147 +#AT_START_148 +at_fn_group_banner 148 'remfiles04b.at:33' \ + "remove-files with -C:rel in -c/incr. mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "148. $at_setup_line: testing $at_desc ..." + $at_traceon - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + { set +x +$as_echo "$at_srcdir/remfiles04b.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 45 ) # 45. lustar03.at:21: ustar: splitting long names - at_setup_line='lustar03.at:21' - at_desc="ustar: splitting long names" - $at_quiet $ECHO_N " 45: ustar: splitting long names $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "45. lustar03.at:21: testing ..." - $at_traceon +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir foo +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar --incremental --remove-files -C foo bar +echo A +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04b.at:36" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir foo +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar --incremental --remove-files -C foo bar +echo A +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./bar +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles04b.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_148 +#AT_START_149 +at_fn_group_banner 149 'remfiles04c.at:33' \ + "remove-files with -C:rel in -r mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "149. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/lustar03.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + { set +x +$as_echo "$at_srcdir/remfiles04c.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 -echo \"Create archive\" -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -echo \"List archive\" -tar tf archive)" -echo lustar03.at:29 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir foo +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar -C foo bar +echo A +find . | sort +tar -rf foo.tar --remove-files -C foo bar +echo B +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04c.at:36" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 -echo "Create archive" -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -echo "List archive" -tar tf archive) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir foo +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar -C foo bar +echo A +find . | sort +tar -rf foo.tar --remove-files -C foo bar +echo B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./bar +./foo +./foo.tar +./foo/bar +B +. +./bar +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles04c.at:36" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_149 +#AT_START_150 +at_fn_group_banner 150 'remfiles05a.at:34' \ + "remove-files with -C:rel,rel in -c/non-incr. mode" "" 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "150. $at_setup_line: testing $at_desc ..." + $at_traceon -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 -echo "Create archive" -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -echo "List archive" -tar tf archive) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Create archive -List archive -this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/ -this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/lustar03.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + { set +x +$as_echo "$at_srcdir/remfiles05a.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +decho A +tar -cvf foo.tar --remove-files -C foo file -C ../bar file +decho B +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05a.at:37" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * - 46 ) # 46. multiv01.at:23: multivolume dumps from pipes - at_setup_line='multiv01.at:23' - at_desc="multivolume dumps from pipes" - $at_quiet $ECHO_N " 46: multivolume dumps from pipes $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "46. multiv01.at:23: testing ..." - $at_traceon +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +decho A +tar -cvf foo.tar --remove-files -C foo file -C ../bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles05a.at:37" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_150 +#AT_START_151 +at_fn_group_banner 151 'remfiles05b.at:25' \ + "remove-files with -C:rel,rel in -c/incr. mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "151. $at_setup_line: testing $at_desc ..." + $at_traceon -# Fixme: should be configurable -# TRUSS=truss -o /tmp/tr -# TRUSS=strace - $at_traceoff -echo "$at_srcdir/multiv01.at:30: + + { set +x +$as_echo "$at_srcdir/remfiles05b.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19812,45 +33435,21 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 - -for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\ - \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\ - echo \"file2 block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" - for count in 2 3 4 5 6 7 8 ; do - echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" - done -done >file2 - -if test \$TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi - -tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\ - --listed-incremental=t.snar \\ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\ - -C extract-dir-pipe -x --multi-volume \\ - --tape-length=\$TAPE_LENGTH --read-full-records || exit 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +decho A +tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file +decho B +find . | sort )" -echo multiv01.at:30 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a ${...} parameter expansion)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05b.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19859,425 +33458,638 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +decho A +tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles05b.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_151 +#AT_START_152 +at_fn_group_banner 152 'remfiles05c.at:25' \ + "remove-files with -C:rel,rel in -r mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "152. $at_setup_line: testing $at_desc ..." + $at_traceon -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - --listed-incremental=t.snar \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + + { set +x +$as_echo "$at_srcdir/remfiles05c.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +tar -cf foo.tar -C foo file -C ../bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C foo file -C ../bar file +decho C +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05c.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - --listed-incremental=t.snar \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +tar -cf foo.tar -C foo file -C ../bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C foo file -C ../bar file +decho C +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +C +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./bar +./bar/file +./file +./foo +./foo.tar +./foo/file +B +file +file +C +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles05c.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_152 +#AT_START_153 +at_fn_group_banner 153 'remfiles06a.at:25' \ + "remove-files with -C:rel,abs in -c/non-incr. mode" "" 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "153. $at_setup_line: testing $at_desc ..." + $at_traceon -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv01.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/multiv01.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + { set +x +$as_echo "$at_srcdir/remfiles06a.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * + + +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 + +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +decho A +tar -cvf foo.tar --remove-files -C foo file -C \$DIR/bar file +decho B +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06a.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 -for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\ - \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\ - echo \"file2 block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" - for count in 2 3 4 5 6 7 8 ; do - echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" - done -done >file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -if test \$TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +decho A +tar -cvf foo.tar --remove-files -C foo file -C $DIR/bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles06a.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_153 +#AT_START_154 +at_fn_group_banner 154 'remfiles06b.at:25' \ + "remove-files with -C:rel,abs in -c/incr. mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "154. $at_setup_line: testing $at_desc ..." + $at_traceon -tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\ - --listed-incremental=t.snar \\ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\ - -C extract-dir-pipe -x --multi-volume \\ - --tape-length=\$TAPE_LENGTH --read-full-records || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -)" -echo multiv01.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a ${...} parameter expansion)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + { set +x +$as_echo "$at_srcdir/remfiles06b.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 - -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 - -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi - -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - --listed-incremental=t.snar \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +decho A +tar -cvf foo.tar --incremental --remove-files -C foo file -C \$DIR/bar file +decho B +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06b.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +decho A +tar -cvf foo.tar --incremental --remove-files -C foo file -C $DIR/bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles06b.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_154 +#AT_START_155 +at_fn_group_banner 155 'remfiles06c.at:25' \ + "remove-files with -C:rel,abs in -r mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "155. $at_setup_line: testing $at_desc ..." + $at_traceon -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - --listed-incremental=t.snar \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv01.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + + { set +x +$as_echo "$at_srcdir/remfiles06c.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -$at_traceon -$at_traceoff -echo "$at_srcdir/multiv01.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +tar -cf foo.tar -C foo file -C \$DIR/bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C foo file -C ../bar file +decho C +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06c.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H pax\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 -for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\ - \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\ - echo \"file2 block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" - for count in 2 3 4 5 6 7 8 ; do - echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\" - done -done >file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -if test \$TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +tar -cf foo.tar -C foo file -C $DIR/bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C foo file -C ../bar file +decho C +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +C +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./bar +./bar/file +./file +./foo +./foo.tar +./foo/file +B +file +file +C +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles06c.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_155 +#AT_START_156 +at_fn_group_banner 156 'remfiles07a.at:25' \ + "remove-files with -C:rel,abs in -c/non-incr. mode" "" 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "156. $at_setup_line: testing $at_desc ..." + $at_traceon -tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\ - --listed-incremental=t.snar \\ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\ - -C extract-dir-pipe -x --multi-volume \\ - --tape-length=\$TAPE_LENGTH --read-full-records || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -)" -echo multiv01.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a ${...} parameter expansion)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax + { set +x +$as_echo "$at_srcdir/remfiles07a.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 - -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 - -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi - -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - --listed-incremental=t.snar \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +decho A +tar -cvf foo.tar --remove-files -C foo file -C \$DIR/bar file +decho B +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07a.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +decho A +tar -cvf foo.tar --remove-files -C foo file -C $DIR/bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles07a.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_156 +#AT_START_157 +at_fn_group_banner 157 'remfiles07b.at:25' \ + "remove-files with -C:rel,abs in -c/incr. mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "157. $at_setup_line: testing $at_desc ..." + $at_traceon -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - --listed-incremental=t.snar \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv01.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + { set +x +$as_echo "$at_srcdir/remfiles07b.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +decho A +tar -cvf foo.tar --incremental --remove-files -C foo file -C \$DIR/bar file +decho B +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07b.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +test -z "`sort < /dev/null 2>&1`" || exit 77 - 47 ) # 47. multiv02.at:28: skipping a straddling member - at_setup_line='multiv02.at:28' - at_desc="skipping a straddling member" - $at_quiet $ECHO_N " 47: skipping a straddling member $ECHO_C" - at_xfail=no +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +decho A +tar -cvf foo.tar --incremental --remove-files -C foo file -C $DIR/bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles07b.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_157 +#AT_START_158 +at_fn_group_banner 158 'remfiles07c.at:25' \ + "remove-files with -C:rel,abs in -r mode" " " 24 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "47. multiv02.at:28: testing ..." - $at_traceon +( + $as_echo "158. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/multiv02.at:31: + { set +x +$as_echo "$at_srcdir/remfiles07c.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20286,50 +34098,128 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +tar -cf foo.tar -C foo file -C \$DIR/bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C foo file -C \$DIR/bar file +decho C +find . | sort )" -echo multiv02.at:31 >"$at_check_line_file" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07c.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +tar -cf foo.tar -C foo file -C $DIR/bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C foo file -C $DIR/bar file +decho C +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +C +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./bar +./bar/file +./file +./foo +./foo.tar +./foo/file +B +file +file +C +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles07c.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_158 +#AT_START_159 +at_fn_group_banner 159 'remfiles08a.at:25' \ + "remove-files with -C:abs,rel in -c/non-incr. mode" "" 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "159. $at_setup_line: testing $at_desc ..." + $at_traceon + -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; + + + { set +x +$as_echo "$at_srcdir/remfiles08a.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +decho A +tar -cvf foo.tar --remove-files -C \$DIR/foo file -C ../bar file +decho B +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles08a.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20338,649 +34228,994 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +decho A +tar -cvf foo.tar --remove-files -C $DIR/foo file -C ../bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles08a.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_159 +#AT_START_160 +at_fn_group_banner 160 'remfiles08b.at:25' \ + "remove-files with -C:abs,rel in -c/incr. mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "160. $at_setup_line: testing $at_desc ..." + $at_traceon -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -en -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv02.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/multiv02.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + { set +x +$as_echo "$at_srcdir/remfiles08b.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +decho A +tar -cvf foo.tar --incremental --remove-files -C \$DIR/foo file -C ../bar file +decho B +find . | sort )" -echo multiv02.at:31 >"$at_check_line_file" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles08b.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +decho A +tar -cvf foo.tar --incremental --remove-files -C $DIR/foo file -C ../bar file +decho B +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +file +file +B +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles08b.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_160 +#AT_START_161 +at_fn_group_banner 161 'remfiles08c.at:25' \ + "remove-files with -C:abs,rel in -r mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "161. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + { set +x +$as_echo "$at_srcdir/remfiles08c.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=\`pwd\` +tar -cf foo.tar -C \$DIR/foo file -C ../bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C \$DIR/foo file -C ../bar file +decho C +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles08c.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +DIR=`pwd` +tar -cf foo.tar -C $DIR/foo file -C ../bar file +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files -C $DIR/foo file -C ../bar file +decho C +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +C +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./bar +./bar/file +./file +./foo +./foo.tar +./foo/file +B +file +file +C +. +./bar +./file +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles08c.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_161 +#AT_START_162 +at_fn_group_banner 162 'remfiles09a.at:25' \ + "remove-files on full directory in -c/non-incr. mode" "" 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "162. $at_setup_line: testing $at_desc ..." + $at_traceon -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -en -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv02.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/multiv02.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax + + { set +x +$as_echo "$at_srcdir/remfiles09a.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H pax\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire +mkdir foo +echo foo/file > foo/file +decho A +tar -cvf foo.tar --remove-files foo +decho B +find . +)" +at_fn_check_prepare_notrace 'an embedded newline' "remfiles09a.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -exec <&- +mkdir foo +echo foo/file > foo/file +decho A +tar -cvf foo.tar --remove-files foo +decho B +find . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +foo/ +foo/file +B +. +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles09a.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_162 +#AT_START_163 +at_fn_group_banner 163 'remfiles09b.at:29' \ + "remove-files on full directory in -c/incr. mode" "" 24 +at_xfail=yes + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "163. $at_setup_line: testing $at_desc ..." + $at_traceon -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 -)" -echo multiv02.at:31 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax + # we expect to fail in tar 1.27 + + + + { set +x +$as_echo "$at_srcdir/remfiles09b.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +mkdir foo +echo foo/file > foo/file +decho A +tar -cvf foo.tar --incremental --remove-files foo +TARSTAT=\$? +decho B +find . +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles09b.at:34" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir foo +echo foo/file > foo/file +decho A +tar -cvf foo.tar --incremental --remove-files foo +TARSTAT=$? +decho B +find . +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +tar: foo: Directory is new +B +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +foo/ +foo/file +B +. +./foo +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles09b.at:34" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_163 +#AT_START_164 +at_fn_group_banner 164 'remfiles09c.at:25' \ + "remove-files on full directory in -r mode" " " 24 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "164. $at_setup_line: testing $at_desc ..." + $at_traceon -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -en -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv02.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + { set +x +$as_echo "$at_srcdir/remfiles09c.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H gnu\" +export TAR_OPTIONS +rm -rf * - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +test -z \"\`sort < /dev/null 2>&1\`\" || exit 77 - 48 ) # 48. multiv03.at:30: MV archive & long filenames - at_setup_line='multiv03.at:30' - at_desc="MV archive & long filenames" - $at_quiet $ECHO_N " 48: MV archive & long filenames $ECHO_C" - at_xfail=no +mkdir foo +echo foo/file > foo/file +tar -cf foo.tar foo +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files foo +decho C +find . | sort +)" +at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles09c.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +echo foo/file > foo/file +tar -cf foo.tar foo +decho A +find . | sort +decho B +tar -rvf foo.tar --remove-files foo +decho C +find . | sort +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "A +B +C +" | \ + $at_diff - "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "A +. +./foo +./foo.tar +./foo/file +B +foo/ +foo/file +C +. +./foo.tar +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/remfiles09c.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_164 +#AT_START_165 +at_fn_group_banner 165 'xattr01.at:25' \ + "xattrs: basic functionality" " " 25 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "48. multiv03.at:30: testing ..." - $at_traceon +( + $as_echo "165. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/multiv03.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + { set +x +$as_echo "$at_srcdir/xattr01.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\` -BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\` -cat > ../experr < ../expout < /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -exec <&- -tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1 -tar -tM -f arch.1 -f arch.2 || exit 1 + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -echo separator-1 -genfile --length 15360 --file \$BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -echo separator-2 -mv \$BFILE bfile -tar -M -x -f arch.1 -f arch.2 || exit 1 -cmp \$BFILE bfile -)" -echo multiv03.at:33 >"$at_check_line_file" +mkdir dir +genfile --file dir/file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^\$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -cat > ../experr < ../expout < /dev/null + if test "$?" != 0; then + exit 77 + fi -exec <&- -tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 -tar -tM -f arch.1 -f arch.2 || exit 1 + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -echo separator-1 -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 || exit 1 -cmp $BFILE bfile -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir dir +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\" +user.test=\"OurFileValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr01.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -cat > ../experr < ../expout < /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -exec <&- -tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 -tar -tM -f arch.1 -f arch.2 || exit 1 + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -echo separator-1 -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 || exit 1 -cmp $BFILE bfile -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir dir +genfile --file dir/file -at_failed=false -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv03.at:33: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file +tar --xattrs -cf archive.tar dir - echo 1 > "$at_status_file" - exit 1 -fi +rm -rf dir +tar --xattrs -xf archive.tar -$at_traceon -$at_traceoff -echo "$at_srcdir/multiv03.at:33: +getfattr -h -d dir | grep -v -e '^#' -e ^\$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\` -BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\` - -cat > ../experr < ../expout < /dev/null + if test "$?" != 0; then + exit 77 + fi -echo separator-1 -genfile --length 15360 --file \$BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1 + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -echo separator-2 -mv \$BFILE bfile -tar -M -x -f arch.1 -f arch.2 || exit 1 -cmp \$BFILE bfile -)" -echo multiv03.at:33 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir dir +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\" +user.test=\"OurFileValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr01.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -cat > ../experr < ../expout < /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -exec <&- -tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 -tar -tM -f arch.1 -f arch.2 || exit 1 + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -echo separator-1 -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 || exit 1 -cmp $BFILE bfile -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir dir +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^\$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -cat > ../experr < ../expout < /dev/null + if test "$?" != 0; then + exit 77 + fi -exec <&- -tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 -tar -tM -f arch.1 -f arch.2 || exit 1 + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -echo separator-1 -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 || exit 1 -cmp $BFILE bfile -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir dir +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\" +user.test=\"OurFileValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr01.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS=\"-H posix\" +export TAR_OPTIONS +rm -rf * -at_failed=false -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv03.at:33: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -$at_traceon + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 49 ) # 49. multiv04.at:36: split directory members in a MV archive - at_setup_line='multiv04.at:36' - at_desc="split directory members in a MV archive" - $at_quiet $ECHO_N " 49: split directory members in a MV archive $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "49. multiv04.at:36: testing ..." - $at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi +mkdir dir +genfile --file dir/file +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file +tar --xattrs -cf archive.tar dir +rm -rf dir +tar --xattrs -xf archive.tar - $at_traceoff -echo "$at_srcdir/multiv04.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +getfattr -h -d dir | grep -v -e '^#' -e ^\$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' /dev/null + if test "$?" != 0; then + exit 77 + fi -tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory -echo separator + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar -MRt -f arc.1 -f arc.2)" -echo multiv04.at:39 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; +mkdir dir +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\" +user.test=\"OurFileValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr01.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar --listed-incremental=list -c -f archive.a directory -sleep 2 + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory -echo separator + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -tar -MRt -f arc.1 -f arc.2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir dir +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^\$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20990,645 +35225,714 @@ export TAR_OPTIONS rm -rf * -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' /dev/null + if test "$?" != 0; then + exit 77 + fi -tar --listed-incremental=list -c -f archive.a directory -sleep 2 + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory -echo separator + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -tar -MRt -f arc.1 -f arc.2) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir dir +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +rm -rf dir +tar --xattrs -xf archive.tar + +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\" +user.test=\"OurFileValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_165 +#AT_START_166 +at_fn_group_banner 166 'xattr02.at:25' \ + "xattrs: change directory with -C option" " " 25 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "166. $at_setup_line: testing $at_desc ..." + $at_traceon -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -separator -block 0: directory/ -block 35: ** Block of NULs ** -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv04.at:39: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/multiv04.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + { set +x +$as_echo "$at_srcdir/xattr02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar --listed-incremental=list -c -f archive.a directory -sleep 2 + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory -echo separator + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -tar -MRt -f arc.1 -f arc.2)" -echo multiv04.at:39 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^\$ +getfattr -h -d file2 | grep -v -e '^#' -e ^\$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' /dev/null + if test "$?" != 0; then + exit 77 + fi -tar --listed-incremental=list -c -f archive.a directory -sleep 2 + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory -echo separator + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -tar -MRt -f arc.1 -f arc.2) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^$ +getfattr -h -d file2 | grep -v -e '^#' -e ^$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\" +user.test=\"OurFile2Value\" +user.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr02.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' "$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -separator -block 0: directory/ -block 35: ** Block of NULs ** -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv04.at:39: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=\$(TMPDIR=. mktemp fiXXXXXX) - echo 1 > "$at_status_file" - exit 1 -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -$at_traceon + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - 50 ) # 50. multiv05.at:26: Restoring after an out of sync volume - at_setup_line='multiv05.at:26' - at_desc="Restoring after an out of sync volume" - $at_quiet $ECHO_N " 50: Restoring after an out of sync volume $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "50. multiv05.at:26: testing ..." - $at_traceon +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir +rm -rf dir +tar --xattrs -xf archive.tar - $at_traceoff -echo "$at_srcdir/multiv05.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +getfattr -h -d file1 | grep -v -e '^#' -e ^\$ +getfattr -h -d file2 | grep -v -e '^#' -e ^\$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 250k --file jeden -genfile --length 250k --file dwa -genfile --length 250k --file trzy -genfile --length 250k --file cztery -genfile --length 250k --file piec -genfile --length 250k --file szesc + file=$(TMPDIR=. mktemp fiXXXXXX) -echo Creating archive -tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc -echo separator -mkdir bak -mv jeden dwa trzy cztery piec szesc bak -tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar -echo Diffing jeden - cmp bak/jeden jeden || exit 1 -echo Diffing dwa - cmp bak/dwa dwa || exit 1 -echo Diffing trzy - cmp bak/trzy trzy || exit 1 -echo Diffing cztery - cmp bak/cztery cztery || exit 1 -echo Diffing piec - cmp bak/piec piec || exit 1 -echo Diffing szesc - cmp bak/szesc szesc || exit 1 -)" -echo multiv05.at:30 >"$at_check_line_file" + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -exec <&- -genfile --length 250k --file jeden -genfile --length 250k --file dwa -genfile --length 250k --file trzy -genfile --length 250k --file cztery -genfile --length 250k --file piec -genfile --length 250k --file szesc + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -echo Creating archive -tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc -echo separator -mkdir bak -mv jeden dwa trzy cztery piec szesc bak -tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar -echo Diffing jeden - cmp bak/jeden jeden || exit 1 -echo Diffing dwa - cmp bak/dwa dwa || exit 1 -echo Diffing trzy - cmp bak/trzy trzy || exit 1 -echo Diffing cztery - cmp bak/cztery cztery || exit 1 -echo Diffing piec - cmp bak/piec piec || exit 1 -echo Diffing szesc - cmp bak/szesc szesc || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^$ +getfattr -h -d file2 | grep -v -e '^#' -e ^$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\" +user.test=\"OurFile2Value\" +user.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr02.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -exec <&- - -genfile --length 250k --file jeden -genfile --length 250k --file dwa -genfile --length 250k --file trzy -genfile --length 250k --file cztery -genfile --length 250k --file piec -genfile --length 250k --file szesc - - -echo Creating archive -tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc -echo separator -mkdir bak -mv jeden dwa trzy cztery piec szesc bak -tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar -echo Diffing jeden - cmp bak/jeden jeden || exit 1 -echo Diffing dwa - cmp bak/dwa dwa || exit 1 -echo Diffing trzy - cmp bak/trzy trzy || exit 1 -echo Diffing cztery - cmp bak/cztery cztery || exit 1 -echo Diffing piec - cmp bak/piec piec || exit 1 -echo Diffing szesc - cmp bak/szesc szesc || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -echo >>"$at_stderr"; echo "tar: \`trzy' is not continued on this volume -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating archive -separator -jeden -dwa -trzy -cztery -piec -szesc -Diffing jeden -Diffing dwa -Diffing trzy -Diffing cztery -Diffing piec -Diffing szesc -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv05.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - echo 1 > "$at_status_file" - exit 1 -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -$at_traceon + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 51 ) # 51. multiv06.at:27: Multivolumes with L=record_size - at_setup_line='multiv06.at:27' - at_desc="Multivolumes with L=record_size" - $at_quiet $ECHO_N " 51: Multivolumes with L=record_size $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "51. multiv06.at:27: testing ..." - $at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir - $at_traceoff -echo "$at_srcdir/multiv06.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^\$ +getfattr -h -d file2 | grep -v -e '^#' -e ^\$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3)" -echo multiv06.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + file=$(TMPDIR=. mktemp fiXXXXXX) -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "Creating file -Creating archive -Testing archive -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating file -Creating archive -Testing archive -file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv06.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -$at_traceon -$at_traceoff -echo "$at_srcdir/multiv06.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^$ +getfattr -h -d file2 | grep -v -e '^#' -e ^$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\" +user.test=\"OurFile2Value\" +user.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H pax\" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3)" -echo multiv06.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^\$ +getfattr -h -d file2 | grep -v -e '^#' -e ^\$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^$ +getfattr -h -d file2 | grep -v -e '^#' -e ^$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\" +user.test=\"OurFile2Value\" +user.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "Creating file -Creating archive -Testing archive -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Creating file -Creating archive -Testing archive -file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multiv06.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=\$(TMPDIR=. mktemp fiXXXXXX) - echo 1 > "$at_status_file" - exit 1 -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -$at_traceon + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - 52 ) # 52. old.at:23: old archives - at_setup_line='old.at:23' - at_desc="old archives" - $at_quiet $ECHO_N " 52: old archives $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "52. old.at:23: testing ..." - $at_traceon +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir -unset TAR_OPTIONS -$at_traceoff -echo "$at_srcdir/old.at:27: -mkdir directory -tar cfvo archive directory || exit 1 -tar tf archive -" -echo old.at:27 >"$at_check_line_file" +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +rm -rf dir -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir directory -tar cfvo archive directory || exit 1 -tar tf archive - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir directory -tar cfvo archive directory || exit 1 -tar tf archive - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar --xattrs -xf archive.tar -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/old.at:27: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +getfattr -h -d file1 | grep -v -e '^#' -e ^\$ +getfattr -h -d file2 | grep -v -e '^#' -e ^\$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 53 ) # 53. recurse.at:21: recurse - at_setup_line='recurse.at:21' - at_desc="recurse" - $at_quiet $ECHO_N " 53: recurse $ECHO_C" - at_xfail=no +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs -xf archive.tar + +getfattr -h -d file1 | grep -v -e '^#' -e ^$ +getfattr -h -d file2 | grep -v -e '^#' -e ^$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\" +user.test=\"OurFile2Value\" +user.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_166 +#AT_START_167 +at_fn_group_banner 167 'xattr03.at:25' \ + "xattrs: trusted.* attributes" " " 25 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "53. recurse.at:21: testing ..." - $at_traceon +( + $as_echo "167. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/recurse.at:24: + { set +x +$as_echo "$at_srcdir/xattr03.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -21637,38 +35941,61 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -)" -echo recurse.at:24 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -21677,34 +36004,74 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/recurse.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + -$at_traceon -$at_traceoff -echo "$at_srcdir/recurse.at:24: +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\" +trusted.test=\"OurFile2Value\" +trusted.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr03.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -21713,38 +36080,61 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -)" -echo recurse.at:24 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -21753,34 +36143,74 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/recurse.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/recurse.at:24: + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\" +trusted.test=\"OurFile2Value\" +trusted.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr03.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -21789,38 +36219,61 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -)" -echo recurse.at:24 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -21829,34 +36282,74 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/recurse.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/recurse.at:24: + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\" +trusted.test=\"OurFile2Value\" +trusted.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr03.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -21865,38 +36358,61 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -)" -echo recurse.at:24 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -21905,34 +36421,74 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/recurse.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/recurse.at:24: + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\" +trusted.test=\"OurFile2Value\" +trusted.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr03.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -21941,38 +36497,61 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -)" -echo recurse.at:24 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^\$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^\$ +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -21981,58 +36560,95 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "directory/ -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/recurse.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - 54 ) # 54. same-order01.at:26: working -C with --same-order - at_setup_line='same-order01.at:26' - at_desc="working -C with --same-order" - $at_quiet $ECHO_N " 54: working -C with --same-order $ECHO_C" - at_xfail=no + +mkdir dir +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 + +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir + +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir + +rm -rf dir + +tar --xattrs --xattrs-include=trusted* -xf archive.tar + +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\" +trusted.test=\"OurFile2Value\" +trusted.test=\"OurDirValue\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_167 +#AT_START_168 +at_fn_group_banner 168 'xattr04.at:26' \ + "xattrs: s/open/openat/ regression" " " 25 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "54. same-order01.at:26: testing ..." - $at_traceon +( + $as_echo "168. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/same-order01.at:29: + { set +x +$as_echo "$at_srcdir/xattr04.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -22042,53 +36658,46 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -tar -xf archive --same-order -C directory || exit 1 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -ls directory|sort -)" -echo same-order01.at:29 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +mkdir output +genfile --file dir/file -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +setfattr -n user.test -v value dir/file -mkdir directory -tar -xf archive --same-order -C directory || exit 1 +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -ls directory|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar --xattrs -xf archive.tar -C output +ret=\$? +getfattr -h -d output/file | grep -v -e '^#' -e ^\$ +exit \$ret +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -22098,42 +36707,57 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -mkdir directory -tar -xf archive --same-order -C directory || exit 1 -ls directory|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order01.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order01.at:29: +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.test -v value dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +ret=$? +getfattr -h -d output/file | grep -v -e '^#' -e ^$ +exit $ret +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"value\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr04.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -22143,53 +36767,46 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -tar -xf archive --same-order -C directory || exit 1 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -ls directory|sort -)" -echo same-order01.at:29 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +mkdir output +genfile --file dir/file -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +setfattr -n user.test -v value dir/file -mkdir directory -tar -xf archive --same-order -C directory || exit 1 +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -ls directory|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar --xattrs -xf archive.tar -C output +ret=\$? +getfattr -h -d output/file | grep -v -e '^#' -e ^\$ +exit \$ret +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -22199,42 +36816,57 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -mkdir directory -tar -xf archive --same-order -C directory || exit 1 -ls directory|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order01.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order01.at:29: +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.test -v value dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +ret=$? +getfattr -h -d output/file | grep -v -e '^#' -e ^$ +exit $ret +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"value\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr04.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -22244,53 +36876,46 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -tar -xf archive --same-order -C directory || exit 1 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -ls directory|sort -)" -echo same-order01.at:29 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +mkdir output +genfile --file dir/file -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +setfattr -n user.test -v value dir/file -mkdir directory -tar -xf archive --same-order -C directory || exit 1 +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -ls directory|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar --xattrs -xf archive.tar -C output +ret=\$? +getfattr -h -d output/file | grep -v -e '^#' -e ^\$ +exit \$ret +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -22300,42 +36925,57 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -mkdir directory -tar -xf archive --same-order -C directory || exit 1 -ls directory|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order01.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order01.at:29: +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.test -v value dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +ret=$? +getfattr -h -d output/file | grep -v -e '^#' -e ^$ +exit $ret +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"value\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr04.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -22345,53 +36985,46 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -tar -xf archive --same-order -C directory || exit 1 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -ls directory|sort -)" -echo same-order01.at:29 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +mkdir output +genfile --file dir/file -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +setfattr -n user.test -v value dir/file -mkdir directory -tar -xf archive --same-order -C directory || exit 1 +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -ls directory|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar --xattrs -xf archive.tar -C output +ret=\$? +getfattr -h -d output/file | grep -v -e '^#' -e ^\$ +exit \$ret +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -22401,42 +37034,57 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -mkdir directory -tar -xf archive --same-order -C directory || exit 1 -ls directory|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order01.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order01.at:29: +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.test -v value dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +ret=$? +getfattr -h -d output/file | grep -v -e '^#' -e ^$ +exit $ret +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"value\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr04.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -22446,53 +37094,46 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -tar -xf archive --same-order -C directory || exit 1 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -ls directory|sort -)" -echo same-order01.at:29 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +mkdir output +genfile --file dir/file -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +setfattr -n user.test -v value dir/file -mkdir directory -tar -xf archive --same-order -C directory || exit 1 +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -ls directory|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar --xattrs -xf archive.tar -C output +ret=\$? +getfattr -h -d output/file | grep -v -e '^#' -e ^\$ +exit \$ret +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -22502,124 +37143,127 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - -mkdir directory -tar -xf archive --same-order -C directory || exit 1 -ls directory|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi - -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order01.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 55 ) # 55. same-order02.at:25: multiple -C options - at_setup_line='same-order02.at:25' - at_desc="multiple -C options" - $at_quiet $ECHO_N " 55: multiple -C options $ECHO_C" - at_xfail=no +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.test -v value dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +ret=$? +getfattr -h -d output/file | grep -v -e '^#' -e ^$ +exit $ret +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "user.test=\"value\" +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_168 +#AT_START_169 +at_fn_group_banner 169 'xattr05.at:28' \ + "xattrs: keywords with '=' and '%'" " " 25 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "55. same-order02.at:25: testing ..." - $at_traceon - - - - - - $at_traceoff -echo "$at_srcdir/same-order02.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +( + $as_echo "169. $at_setup_line: testing $at_desc ..." + $at_traceon -mkdir en -mkdir to -HERE=\`pwd\` -tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1 -ls en -echo separator -ls to -)" -echo same-order02.at:28 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; + { set +x +$as_echo "$at_srcdir/xattr05.at:31: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -22628,45 +37272,56 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -separator -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order02.at:28: +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr05.at:31: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -22675,56 +37330,47 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=\`pwd\` -tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -)" -echo same-order02.at:28 >"$at_check_line_file" + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -22733,45 +37379,56 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -separator -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order02.at:28: + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr05.at:31: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -22780,56 +37437,47 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=\`pwd\` -tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -)" -echo same-order02.at:28 >"$at_check_line_file" + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -22838,45 +37486,56 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -separator -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order02.at:28: +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr05.at:31: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -22885,56 +37544,47 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=\`pwd\` -tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -)" -echo same-order02.at:28 >"$at_check_line_file" + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -22943,45 +37593,56 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -separator -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/same-order02.at:28: + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/xattr05.at:31: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -22990,56 +37651,47 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to -HERE=\`pwd\` -tar -xf archive --same-order -C \$HERE/en file1 -C \$HERE/to file2 || exit 1 + file=\$(TMPDIR=. mktemp fiXXXXXX) -ls en -echo separator -ls to -)" -echo same-order02.at:28 >"$at_check_line_file" + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains a `...` command substitution)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -23048,69 +37700,77 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - -mkdir en -mkdir to - -HERE=`pwd` -tar -xf archive --same-order -C $HERE/en file1 -C $HERE/to file2 || exit 1 -ls en -echo separator -ls to -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "file1 -separator -file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/same-order02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 56 ) # 56. shortrec.at:25: short records - at_setup_line='shortrec.at:25' - at_desc="short records" - $at_quiet $ECHO_N " 56: short records $ECHO_C" - at_xfail=no +mkdir dir +mkdir output +genfile --file dir/file + +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . + +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_169 +#AT_START_170 +at_fn_group_banner 170 'acls01.at:25' \ + "acls: basic functionality" " " 25 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "56. shortrec.at:25: testing ..." - $at_traceon +( + $as_echo "170. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/shortrec.at:28: + { set +x +$as_echo "$at_srcdir/acls01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -23119,46 +37779,68 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -)" -echo shortrec.at:28 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -rm -r directory -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=\$( id -un ) + +setfacl -m u:\$MYNAME:--x dir/file +setfacl -m u:\$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir + +tar --acls -xf archive.tar + +getfattr -h -m. -d dir dir/file > after + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -23167,37 +37849,77 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortrec.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file -$at_traceon -$at_traceoff -echo "$at_srcdir/shortrec.at:28: + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=$( id -un ) + +setfacl -m u:$MYNAME:--x dir/file +setfacl -m u:$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir + +tar --acls -xf archive.tar + +getfattr -h -m. -d dir dir/file > after + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/acls01.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -23206,46 +37928,68 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -)" -echo shortrec.at:28 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -rm -r directory -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=\$( id -un ) + +setfacl -m u:\$MYNAME:--x dir/file +setfacl -m u:\$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir + +tar --acls -xf archive.tar + +getfattr -h -m. -d dir dir/file > after + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -23254,37 +37998,77 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortrec.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=$( id -un ) + +setfacl -m u:$MYNAME:--x dir/file +setfacl -m u:$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir + +tar --acls -xf archive.tar + +getfattr -h -m. -d dir dir/file > after + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } -$at_traceon -$at_traceoff -echo "$at_srcdir/shortrec.at:28: + { set +x +$as_echo "$at_srcdir/acls01.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -23293,46 +38077,68 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -)" -echo shortrec.at:28 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -rm -r directory -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=\$( id -un ) + +setfacl -m u:\$MYNAME:--x dir/file +setfacl -m u:\$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir + +tar --acls -xf archive.tar + +getfattr -h -m. -d dir dir/file > after + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -23341,37 +38147,77 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortrec.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=$( id -un ) + +setfacl -m u:$MYNAME:--x dir/file +setfacl -m u:$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir +tar --acls -xf archive.tar - echo 1 > "$at_status_file" - exit 1 -fi +getfattr -h -m. -d dir dir/file > after + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } -$at_traceon -$at_traceoff -echo "$at_srcdir/shortrec.at:28: + { set +x +$as_echo "$at_srcdir/acls01.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -23380,46 +38226,68 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -)" -echo shortrec.at:28 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -rm -r directory -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=\$( id -un ) + +setfacl -m u:\$MYNAME:--x dir/file +setfacl -m u:\$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir + +tar --acls -xf archive.tar + +getfattr -h -m. -d dir dir/file > after + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -23428,37 +38296,77 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortrec.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -$at_traceon -$at_traceoff -echo "$at_srcdir/shortrec.at:28: + + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file + +MYNAME=$( id -un ) + +setfacl -m u:$MYNAME:--x dir/file +setfacl -m u:$MYNAME:--x dir + +getfattr -h -m. -d dir dir/file > before + +tar --acls -cf archive.tar dir +rm -rf dir + +tar --acls -xf archive.tar + +getfattr -h -m. -d dir dir/file > after + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/acls01.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -23467,616 +38375,329 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -)" -echo shortrec.at:28 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -rm -r directory -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - >/dev/null -tar -c -b 1 -f archive directory -tar -t -f archive >/dev/null -tar -t -f - < archive >/dev/null -rm -r directory -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortrec.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +mkdir dir +genfile --file dir/file - 57 ) # 57. sparse01.at:21: sparse files - at_setup_line='sparse01.at:21' - at_desc="sparse files" - $at_quiet $ECHO_N " 57: sparse files $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "57. sparse01.at:21: testing ..." - $at_traceon +MYNAME=\$( id -un ) +setfacl -m u:\$MYNAME:--x dir/file +setfacl -m u:\$MYNAME:--x dir +getfattr -h -m. -d dir dir/file > before +tar --acls -cf archive.tar dir +rm -rf dir +tar --acls -xf archive.tar - $at_traceoff -echo "$at_srcdir/sparse01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +getfattr -h -m. -d dir dir/file > after + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -)" -echo sparse01.at:24 >"$at_check_line_file" + file=$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparse01.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/sparse01.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator + rm -rf $file -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -)" -echo sparse01.at:24 >"$at_check_line_file" + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +mkdir dir +genfile --file dir/file -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator +MYNAME=$( id -un ) -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +setfacl -m u:$MYNAME:--x dir/file +setfacl -m u:$MYNAME:--x dir -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator +getfattr -h -m. -d dir dir/file > before -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar --acls -cf archive.tar dir +rm -rf dir -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparse01.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +tar --acls -xf archive.tar +getfattr -h -m. -d dir dir/file > after - echo 1 > "$at_status_file" - exit 1 -fi +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } -$at_traceon -$at_traceoff -echo "$at_srcdir/sparse01.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" -export TAR_OPTIONS -rm -rf * -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -)" -echo sparse01.at:24 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_170 +#AT_START_171 +at_fn_group_banner 171 'acls02.at:25' \ + "acls: work with -C" " " 25 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "171. $at_setup_line: testing $at_desc ..." + $at_traceon -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + + { set +x +$as_echo "$at_srcdir/acls02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator - -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparse01.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -cat >stdout.re <<'_ATEOF' -separator --rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin --rw-r--r-- ^ ^ * *10344448 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile --rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end -separator -sparsefile 10344448 -_ATEOF + file=\$(TMPDIR=. mktemp fiXXXXXX) -awk '{print NR " " $0}' stdout > $$.1 -awk '{print NR " " $0}' stdout.re | join - $$.1 | -while read NUM RE LINE -do - echo "$LINE" | grep -- "$RE" >/dev/null || exit 1 -done + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - 58 ) # 58. sparse02.at:21: extracting sparse file over a pipe - at_setup_line='sparse02.at:21' - at_desc="extracting sparse file over a pipe" - $at_quiet $ECHO_N " 58: extracting sparse file over a pipe $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "58. sparse02.at:21: testing ..." - $at_traceon + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -# Tar 1.14 - 1.15.1 was unable to extract sparse files to a pipe. -# References: <16896.21739.460782.124775@jik.kamens.brookline.ma.us> -# http://lists.gnu.org/archive/html/bug-tar/2005-02/msg00003.html +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file +MYNAME=\$( id -un ) +setfacl -m u:\$MYNAME:--x dir/subdir +setfacl -m u:\$MYNAME:--x dir/subdir/file - $at_traceoff -echo "$at_srcdir/sparse02.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator +tar --acls -cf archive.tar -C dir subdir +rm -rf dir -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -)" -echo sparse02.at:28 >"$at_check_line_file" +mkdir dir +tar --acls -xf archive.tar -C dir -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + file=$(TMPDIR=. mktemp fiXXXXXX) -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparse02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/sparse02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator + file=$(TMPDIR=. mktemp fiXXXXXX) -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -)" -echo sparse02.at:28 >"$at_check_line_file" + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator + rm -rf $file -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparse02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +MYNAME=$( id -un ) +setfacl -m u:$MYNAME:--x dir/subdir +setfacl -m u:$MYNAME:--x dir/subdir/file - echo 1 > "$at_status_file" - exit 1 -fi +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. + +tar --acls -cf archive.tar -C dir subdir +rm -rf dir -$at_traceon -$at_traceoff -echo "$at_srcdir/sparse02.at:28: +mkdir dir +tar --acls -xf archive.tar -C dir + +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/acls02.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -24085,42 +38706,74 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -)" -echo sparse02.at:28 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file + +MYNAME=\$( id -un ) + +setfacl -m u:\$MYNAME:--x dir/subdir +setfacl -m u:\$MYNAME:--x dir/subdir/file + +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. + +tar --acls -cf archive.tar -C dir subdir +rm -rf dir + +mkdir dir +tar --acls -xf archive.tar -C dir + +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -24129,953 +38782,587 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse sparsefile || exit 1 -echo separator -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparse02.at:28: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=$(TMPDIR=. mktemp fiXXXXXX) - 59 ) # 59. sparse03.at:21: storing sparse files > 8G - at_setup_line='sparse03.at:21' - at_desc="storing sparse files > 8G" - $at_quiet $ECHO_N " 59: storing sparse files > 8G $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "59. sparse03.at:21: testing ..." - $at_traceon + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -# Tar 1.15.1 incorrectly computed sparse member size if the extended -# PAX header contained size keyword. -# References: <87vf46nb36.fsf@penguin.cs.ucla.edu> -# http://lists.gnu.org/archive/html/bug-tar/2005-06/msg00040.html + rm -rf $file + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/sparse03.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file -genfile --length 1000 --file begin -genfile --length 1000 --file end -genfile --sparse --file sparsefile --block-size 512 8G A || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator +MYNAME=$( id -un ) -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -)" -echo sparse03.at:29 >"$at_check_line_file" +setfacl -m u:$MYNAME:--x dir/subdir +setfacl -m u:$MYNAME:--x dir/subdir/file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +tar --acls -cf archive.tar -C dir subdir +rm -rf dir -genfile --length 1000 --file begin -genfile --length 1000 --file end -genfile --sparse --file sparsefile --block-size 512 8G A || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator +mkdir dir +tar --acls -xf archive.tar -C dir -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/acls02.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile --length 1000 --file begin -genfile --length 1000 --file end -genfile --sparse --file sparsefile --block-size 512 8G A || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo stdout:; tee stdout <"$at_stdout" -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparse03.at:29: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -$at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) -cat >stdout.re <<'_ATEOF' -separator --rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin --rw-r--r-- ^ ^ * *8589935104 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile --rw-r--r-- ^ ^ * *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end -separator -sparsefile 8589935104 -_ATEOF + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -awk '{print NR " " $0}' stdout > $$.1 -awk '{print NR " " $0}' stdout.re | join - $$.1 | -while read NUM RE LINE -do - echo "$LINE" | grep -- "$RE" >/dev/null || exit 1 -done + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + rm -rf \$file - 60 ) # 60. sparsemv.at:21: sparse files in MV archives - at_setup_line='sparsemv.at:21' - at_desc="sparse files in MV archives" - $at_quiet $ECHO_N " 60: sparse files in MV archives $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "60. sparsemv.at:21: testing ..." - $at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file -# Check if sparse files are correctly split between GNU multi-volume -# archives. -# There are two cases: the file can be split within an empty (null) block, -# or within a data block. Since null blocks are not archived, the first -# case means the file is split between two consecutive data blocks. -# +MYNAME=\$( id -un ) +setfacl -m u:\$MYNAME:--x dir/subdir +setfacl -m u:\$MYNAME:--x dir/subdir/file + +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. +tar --acls -cf archive.tar -C dir subdir +rm -rf dir - $at_traceoff -echo "$at_srcdir/sparsemv.at:31: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir dir +tar --acls -xf archive.tar -C dir + +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo \"Pass 1: Split between data blocks\" -echo \"Create archive\" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo \"Test archive\" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo \"Compare archive\" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -echo \"Pass 2: Split within a data block\" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo \"Create archive\" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo \"Test archive\" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo \"Compare archive\" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -)" -echo sparsemv.at:31 >"$at_check_line_file" + file=$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Pass 1: Split between data blocks -Create archive -Test archive -sparsefile -Compare archive -Pass 2: Split within a data block -Create archive -Test archive -sparsefile -Compare archive -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparsemv.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/sparsemv.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" -export TAR_OPTIONS -rm -rf * + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo \"Pass 1: Split between data blocks\" -echo \"Create archive\" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo \"Test archive\" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo \"Compare archive\" -tar --record-size=512 -d -M -f arc.1 -f arc.2 + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file + +MYNAME=$( id -un ) -echo \"Pass 2: Split within a data block\" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo \"Create archive\" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo \"Test archive\" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo \"Compare archive\" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -)" -echo sparsemv.at:31 >"$at_check_line_file" +setfacl -m u:$MYNAME:--x dir/subdir +setfacl -m u:$MYNAME:--x dir/subdir/file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +tar --acls -cf archive.tar -C dir subdir +rm -rf dir -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 +mkdir dir +tar --acls -xf archive.tar -C dir -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/acls02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Pass 1: Split between data blocks -Create archive -Test archive -sparsefile -Compare archive -Pass 2: Split within a data block -Create archive -Test archive -sparsefile -Compare archive -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/sparsemv.at:31: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=\$(TMPDIR=. mktemp fiXXXXXX) - 61 ) # 61. spmvp00.at:21: sparse files in PAX MV archives, v.0.0 - at_setup_line='spmvp00.at:21' - at_desc="sparse files in PAX MV archives, v.0.0" - $at_quiet $ECHO_N " 61: sparse files in PAX MV archives, v.0.0 $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "61. spmvp00.at:21: testing ..." - $at_traceon + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/spmvp00.at:24: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H pax\" -export TAR_OPTIONS -rm -rf * +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77 -echo \"Pass 1: Split between data blocks\" -echo \"Create archive\" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo \"Test archive\" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo \"Compare archive\" -tar -d -M -f arc.1 -f arc.2 -f arc.3 +MYNAME=\$( id -un ) -echo \"Pass 2: Split within a data block\" -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 -echo \"Create archive\" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo \"Test archive\" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo \"Compare archive\" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -)" -echo spmvp00.at:24 >"$at_check_line_file" +setfacl -m u:\$MYNAME:--x dir/subdir +setfacl -m u:\$MYNAME:--x dir/subdir/file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * +tar --acls -cf archive.tar -C dir subdir +rm -rf dir -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 +mkdir dir +tar --acls -xf archive.tar -C dir -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 12 blocks -tar: Record size = 12 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Pass 1: Split between data blocks -Create archive -Test archive -sparsefile -Compare archive -Pass 2: Split within a data block -Create archive -Test archive -sparsefile -Compare archive -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/spmvp00.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=$(TMPDIR=. mktemp fiXXXXXX) - 62 ) # 62. spmvp01.at:21: sparse files in PAX MV archives, v.0.1 - at_setup_line='spmvp01.at:21' - at_desc="sparse files in PAX MV archives, v.0.1" - $at_quiet $ECHO_N " 62: sparse files in PAX MV archives, v.0.1 $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "62. spmvp01.at:21: testing ..." - $at_traceon + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/spmvp01.at:24: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H pax\" -export TAR_OPTIONS -rm -rf * +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo \"Pass 1: Split between data blocks\" -echo \"Create archive\" -tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo \"Test archive\" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo \"Compare archive\" -tar -d -M -f arc.1 -f arc.2 -f arc.3 +MYNAME=$( id -un ) -echo \"Pass 2: Split within a data block\" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo \"Create archive\" -tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo \"Test archive\" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo \"Compare archive\" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -)" -echo spmvp01.at:24 >"$at_check_line_file" +setfacl -m u:$MYNAME:--x dir/subdir +setfacl -m u:$MYNAME:--x dir/subdir/file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * +tar --acls -cf archive.tar -C dir subdir +rm -rf dir -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 +mkdir dir +tar --acls -xf archive.tar -C dir -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/acls02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 12 blocks -tar: Record size = 12 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Pass 1: Split between data blocks -Create archive -Test archive -sparsefile -Compare archive -Pass 2: Split within a data block -Create archive -Test archive -sparsefile -Compare archive -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/spmvp01.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=\$(TMPDIR=. mktemp fiXXXXXX) - 63 ) # 63. spmvp10.at:21: sparse files in PAX MV archives, v.1.0 - at_setup_line='spmvp10.at:21' - at_desc="sparse files in PAX MV archives, v.1.0" - $at_quiet $ECHO_N " 63: sparse files in PAX MV archives, v.1.0 $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "63. spmvp10.at:21: testing ..." - $at_traceon + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/spmvp10.at:24: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H pax\" -export TAR_OPTIONS -rm -rf * +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 -echo \"Pass 1: Split between data blocks\" -echo \"Create archive\" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo \"Test archive\" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo \"Compare archive\" -tar -d -M -f arc.1 -f arc.2 -f arc.3 +MYNAME=\$( id -un ) -echo \"Pass 2: Split within a data block\" -genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77 -echo \"Create archive\" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo \"Test archive\" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo \"Compare archive\" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -)" -echo spmvp10.at:24 >"$at_check_line_file" +setfacl -m u:\$MYNAME:--x dir/subdir +setfacl -m u:\$MYNAME:--x dir/subdir/file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * +tar --acls -cf archive.tar -C dir subdir +rm -rf dir -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 +mkdir dir +tar --acls -xf archive.tar -C dir -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test \"\$?\" = 0 +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -exec <&- -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile -echo "Test archive" -tar -t -M -f arc.1 -f arc.2 -f arc.3 -echo "Compare archive" -tar -d -M -f arc.1 -f arc.2 -f arc.3 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 12 blocks -tar: Record size = 12 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Pass 1: Split between data blocks -Create archive -Test archive -sparsefile -Compare archive -Pass 2: Split within a data block -Create archive -Test archive -sparsefile -Compare archive -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/spmvp10.at:24: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -$at_traceon - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file + +MYNAME=$( id -un ) - 64 ) # 64. update.at:27: update unchanged directories - at_setup_line='update.at:27' - at_desc="update unchanged directories" - $at_quiet $ECHO_N " 64: update unchanged directories $ECHO_C" - at_xfail=no +setfacl -m u:$MYNAME:--x dir/subdir +setfacl -m u:$MYNAME:--x dir/subdir/file + +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. + +tar --acls -cf archive.tar -C dir subdir +rm -rf dir + +mkdir dir +tar --acls -xf archive.tar -C dir + +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test "$?" = 0 +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_171 +#AT_START_172 +at_fn_group_banner 172 'selnx01.at:25' \ + "selinux: basic store/restore" " " 25 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "64. update.at:27: testing ..." - $at_traceon +( + $as_echo "172. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/update.at:30: + { set +x +$as_echo "$at_srcdir/selnx01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -25085,53 +39372,106 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -)" -echo update.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file +ln -s file dir/link + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored + +tar --selinux -xf archive.tar + +# archive for later debugging +cp archive.tar archive_origin.tar + +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\ + grep -v -e '^#' -e ^\$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux + +diff with_selinux without_selinux > diff_with_without +if test \"\$?\" -eq \"0\"; then + echo \"selinux contexts probably restored while --selinux is off\" fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir -test -z "`sort < /dev/null 2>&1`" || exit 77 +# clear the directory +rm -rf dir -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +# restore (with --selinux) +tar --selinux -xf archive.tar dir -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test \"\$?\" -ne \"0\"; then + echo \"bad result\" +fi + +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -25141,45 +39481,119 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file +ln -s file dir/link + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored + +tar --selinux -xf archive.tar -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +# archive for later debugging +cp archive.tar archive_origin.tar -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ + grep -v -e '^#' -e ^$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux + +diff with_selinux without_selinux > diff_with_without +if test "$?" -eq "0"; then + echo "selinux contexts probably restored while --selinux is off" fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -directory/ -directory/file1 -directory/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/update.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir - echo 1 > "$at_status_file" - exit 1 +# clear the directory +rm -rf dir + +# restore (with --selinux) +tar --selinux -xf archive.tar dir + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test "$?" -ne "0"; then + echo "bad result" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/update.at:30: +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u +security.selinux=\"unconfined_u +security.selinux=\"system_u +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/selnx01.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -25189,53 +39603,106 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -)" -echo update.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file +ln -s file dir/link + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored + +tar --selinux -xf archive.tar + +# archive for later debugging +cp archive.tar archive_origin.tar + +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\ + grep -v -e '^#' -e ^\$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux + +diff with_selinux without_selinux > diff_with_without +if test \"\$?\" -eq \"0\"; then + echo \"selinux contexts probably restored while --selinux is off\" fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir -test -z "`sort < /dev/null 2>&1`" || exit 77 +# clear the directory +rm -rf dir -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +# restore (with --selinux) +tar --selinux -xf archive.tar dir -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test \"\$?\" -ne \"0\"; then + echo \"bad result\" +fi + +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -25245,45 +39712,119 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file +ln -s file dir/link + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored + +tar --selinux -xf archive.tar + +# archive for later debugging +cp archive.tar archive_origin.tar + +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ + grep -v -e '^#' -e ^$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux + +diff with_selinux without_selinux > diff_with_without +if test "$?" -eq "0"; then + echo "selinux contexts probably restored while --selinux is off" fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -directory/ -directory/file1 -directory/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/update.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir - echo 1 > "$at_status_file" - exit 1 +# clear the directory +rm -rf dir + +# restore (with --selinux) +tar --selinux -xf archive.tar dir + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test "$?" -ne "0"; then + echo "bad result" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/update.at:30: +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u +security.selinux=\"unconfined_u +security.selinux=\"system_u +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/selnx01.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -25293,1388 +39834,1169 @@ export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -)" -echo update.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + file=\$(TMPDIR=. mktemp fiXXXXXX) -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + rm -rf \$file -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file +ln -s file dir/link + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored + +tar --selinux -xf archive.tar + +# archive for later debugging +cp archive.tar archive_origin.tar + +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\ + grep -v -e '^#' -e ^\$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux + +diff with_selinux without_selinux > diff_with_without +if test \"\$?\" -eq \"0\"; then + echo \"selinux contexts probably restored while --selinux is off\" fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -directory/ -directory/file1 -directory/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/update.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir - echo 1 > "$at_status_file" - exit 1 +# clear the directory +rm -rf dir + +# restore (with --selinux) +tar --selinux -xf archive.tar dir + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test \"\$?\" -ne \"0\"; then + echo \"bad result\" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/update.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -)" -echo update.at:30 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + file=$(TMPDIR=. mktemp fiXXXXXX) -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +genfile --file dir/file +ln -s file dir/link -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -directory/ -directory/file1 -directory/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/update.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir +# clear the directory +rm -rf dir - echo 1 > "$at_status_file" - exit 1 -fi +# ================================================ +# check if selinux contexts are correctly restored -$at_traceon -$at_traceoff -echo "$at_srcdir/update.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * +tar --selinux -xf archive.tar +# archive for later debugging +cp archive.tar archive_origin.tar -test -z "`sort < /dev/null 2>&1`" || exit 77 +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ + grep -v -e '^#' -e ^$ | cut -d: -f1 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -)" -echo update.at:30 >"$at_check_line_file" +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' +diff with_selinux without_selinux > diff_with_without +if test "$?" -eq "0"; then + echo "selinux contexts probably restored while --selinux is off" fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir -test -z "`sort < /dev/null 2>&1`" || exit 77 +# clear the directory +rm -rf dir -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +# restore (with --selinux) +tar --selinux -xf archive.tar dir -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test "$?" -ne "0"; then + echo "bad result" +fi + +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u +security.selinux=\"unconfined_u +security.selinux=\"system_u +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/selnx01.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 + file=\$(TMPDIR=. mktemp fiXXXXXX) -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -directory/ -directory/file1 -directory/file2 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/update.at:30: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - 65 ) # 65. volume.at:23: volume - at_setup_line='volume.at:23' - at_desc="volume" - $at_quiet $ECHO_N " 65: volume $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "65. volume.at:23: testing ..." - $at_traceon + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/volume.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * +mkdir dir +genfile --file dir/file +ln -s file dir/link -tar -cf archive -V label -T /dev/null || exit 1 +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link -echo 1>&2 ----- -tar xfV archive lab -test \$? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test \$? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test \$? = 2 -)" -echo volume.at:26 >"$at_check_line_file" +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +# clear the directory +rm -rf dir -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +# ================================================ +# check if selinux contexts are correctly restored -tar -cf archive -V label -T /dev/null || exit 1 +tar --selinux -xf archive.tar -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 +# archive for later debugging +cp archive.tar archive_origin.tar -echo 1>&2 ----- -tar xfV archive lab -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test $? = 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\ + grep -v -e '^#' -e ^\$ | cut -d: -f1 -tar -cf archive -V label -T /dev/null || exit 1 +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux -echo 1>&2 ----- -tar xfV archive lab -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test $? = 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? +diff with_selinux without_selinux > diff_with_without +if test \"\$?\" -eq \"0\"; then + echo \"selinux contexts probably restored while --selinux is off\" fi -at_failed=false -echo >>"$at_stderr"; echo "----- -tar: Volume \`label' does not match \`lab' -tar: Error is not recoverable: exiting now ------ -tar: Volume \`label' does not match \`bel' -tar: Error is not recoverable: exiting now ------ -tar: Volume \`label' does not match \`babel' -tar: Error is not recoverable: exiting now -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/volume.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir - echo 1 > "$at_status_file" - exit 1 +# clear the directory +rm -rf dir + +# restore (with --selinux) +tar --selinux -xf archive.tar dir + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test \"\$?\" -ne \"0\"; then + echo \"bad result\" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/volume.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -tar -cf archive -V label -T /dev/null || exit 1 -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) -echo 1>&2 ----- -tar xfV archive lab -test \$? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test \$? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test \$? = 2 -)" -echo volume.at:26 >"$at_check_line_file" + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar -cf archive -V label -T /dev/null || exit 1 -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 -echo 1>&2 ----- -tar xfV archive lab -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test $? = 2 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -tar -cf archive -V label -T /dev/null || exit 1 + file=$(TMPDIR=. mktemp fiXXXXXX) -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -echo 1>&2 ----- -tar xfV archive lab -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test $? = 2 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "----- -tar: Volume \`label' does not match \`lab' -tar: Error is not recoverable: exiting now ------ -tar: Volume \`label' does not match \`bel' -tar: Error is not recoverable: exiting now ------ -tar: Volume \`label' does not match \`babel' -tar: Error is not recoverable: exiting now -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/volume.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +genfile --file dir/file +ln -s file dir/link + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored +tar --selinux -xf archive.tar - echo 1 > "$at_status_file" - exit 1 -fi +# archive for later debugging +cp archive.tar archive_origin.tar -$at_traceon +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ + grep -v -e '^#' -e ^$ | cut -d: -f1 +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +diff with_selinux without_selinux > diff_with_without +if test "$?" -eq "0"; then + echo "selinux contexts probably restored while --selinux is off" +fi - 66 ) # 66. volsize.at:29: volume header size - at_setup_line='volsize.at:29' - at_desc="volume header size" - $at_quiet $ECHO_N " 66: volume header size $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "66. volsize.at:29: testing ..." - $at_traceon +# ================================================================= +# check if selinux is not archived when --selinux option is missing + +tar -cf archive.tar dir +# clear the directory +rm -rf dir +# restore (with --selinux) +tar --selinux -xf archive.tar dir +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test "$?" -ne "0"; then + echo "bad result" +fi +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u +security.selinux=\"unconfined_u +security.selinux=\"system_u +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } - $at_traceoff -echo "$at_srcdir/volsize.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + { set +x +$as_echo "$at_srcdir/selnx01.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo Short Listing -tar tf \$TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf \$TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf \$TEST_DATA_DIR/abc.tar -find abc|sort -)" -echo volsize.at:32 >"$at_check_line_file" + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + rm -rf \$file -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 +mkdir dir +genfile --file dir/file +ln -s file dir/link -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored + +tar --selinux -xf archive.tar + +# archive for later debugging +cp archive.tar archive_origin.tar + +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\ + grep -v -e '^#' -e ^\$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux + +diff with_selinux without_selinux > diff_with_without +if test \"\$?\" -eq \"0\"; then + echo \"selinux contexts probably restored while --selinux is off\" fi -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 5 blocks -tar: Record size = 5 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Short Listing -abc/not-a-file.gif -abc/CCC -Verbose Listing -V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- --rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC -Extracted directory -abc -abc/CCC -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/volsize.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir - echo 1 > "$at_status_file" - exit 1 +# clear the directory +rm -rf dir + +# restore (with --selinux) +tar --selinux -xf archive.tar dir + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test \"\$?\" -ne \"0\"; then + echo \"bad result\" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/volsize.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo Short Listing -tar tf \$TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf \$TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf \$TEST_DATA_DIR/abc.tar -find abc|sort -)" -echo volsize.at:32 >"$at_check_line_file" + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file -test -z "`sort < /dev/null 2>&1`" || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 +mkdir dir +genfile --file dir/file +ln -s file dir/link -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start + +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link + +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir + +# clear the directory +rm -rf dir + +# ================================================ +# check if selinux contexts are correctly restored + +tar --selinux -xf archive.tar + +# archive for later debugging +cp archive.tar archive_origin.tar + +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ + grep -v -e '^#' -e ^$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux + +diff with_selinux without_selinux > diff_with_without +if test "$?" -eq "0"; then + echo "selinux contexts probably restored while --selinux is off" fi -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 5 blocks -tar: Record size = 5 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Short Listing -abc/not-a-file.gif -abc/CCC -Verbose Listing -V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- --rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC -Extracted directory -abc -abc/CCC -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/volsize.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# ================================================================= +# check if selinux is not archived when --selinux option is missing +tar -cf archive.tar dir - echo 1 > "$at_status_file" - exit 1 +# clear the directory +rm -rf dir + +# restore (with --selinux) +tar --selinux -xf archive.tar dir + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test "$?" -ne "0"; then + echo "bad result" fi -$at_traceon -$at_traceoff -echo "$at_srcdir/volsize.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" -export TAR_OPTIONS -rm -rf * +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u +security.selinux=\"unconfined_u +security.selinux=\"system_u +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } -test -z "`sort < /dev/null 2>&1`" || exit 77 -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_172 +#AT_START_173 +at_fn_group_banner 173 'selacl01.at:25' \ + "acls/selinux: special files & fifos" " " 25 +at_xfail=no + test -f $XFAILFILE && at_xfail=yes +( + $as_echo "173. $at_setup_line: testing $at_desc ..." + $at_traceon -echo Short Listing -tar tf \$TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf \$TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf \$TEST_DATA_DIR/abc.tar -find abc|sort -)" -echo volsize.at:32 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + + + { set +x +$as_echo "$at_srcdir/selacl01.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +mkfifo dir/fifo +MAJOR=\$( stat /dev/urandom --printf=\"%t\" ) +MINOR=\$( stat /dev/urandom --printf=\"%T\" ) +mknod dir/chartype c \$MAJOR \$MINOR +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:\$UID:--- dir/fifo +setfacl -m u:\$UID:rwx dir/chartype -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +tar --xattrs --selinux --acls -cf archive.tar dir -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 5 blocks -tar: Record size = 5 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Short Listing -abc/not-a-file.gif -abc/CCC -Verbose Listing -V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- --rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC -Extracted directory -abc -abc/CCC -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/volsize.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +mv dir olddir +tar --xattrs --selinux --acls -xf archive.tar - echo 1 > "$at_status_file" - exit 1 -fi +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after -$at_traceon -$at_traceoff -echo "$at_srcdir/volsize.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +diff before after +echo separator +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28" +( $at_check_trace; +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -echo Short Listing -tar tf \$TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf \$TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf \$TEST_DATA_DIR/abc.tar -find abc|sort -)" -echo volsize.at:32 >"$at_check_line_file" + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 5 blocks -tar: Record size = 5 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Short Listing -abc/not-a-file.gif -abc/CCC -Verbose Listing -V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- --rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC -Extracted directory -abc -abc/CCC -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/volsize.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) - echo 1 > "$at_status_file" - exit 1 -fi + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -$at_traceon -$at_traceoff -echo "$at_srcdir/volsize.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -test -z "`sort < /dev/null 2>&1`" || exit 77 + rm -rf $file + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo Short Listing -tar tf \$TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf \$TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf \$TEST_DATA_DIR/abc.tar -find abc|sort -)" -echo volsize.at:32 >"$at_check_line_file" +mkdir dir +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:$UID:--- dir/fifo +setfacl -m u:$UID:rwx dir/chartype -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before +tar --xattrs --selinux --acls -cf archive.tar dir -test -z "`sort < /dev/null 2>&1`" || exit 77 +mv dir olddir +tar --xattrs --selinux --acls -xf archive.tar -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +diff before after +echo separator +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/selacl01.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + file=\$(TMPDIR=. mktemp fiXXXXXX) -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_failed=false -echo >>"$at_stderr"; echo "tar: Record size = 5 blocks -tar: Record size = 5 blocks -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "Short Listing -abc/not-a-file.gif -abc/CCC -Verbose Listing -V--------- 0/0 1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header-- --rw-r--r-- tom/users 0 2006-04-22 19:52 abc/CCC -Extracted directory -abc -abc/CCC -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/volsize.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - 67 ) # 67. comprec.at:21: compressed format recognition - at_setup_line='comprec.at:21' - at_desc="compressed format recognition" - $at_quiet $ECHO_N " 67: compressed format recognition $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "67. comprec.at:21: testing ..." - $at_traceon + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/comprec.at:25: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -genfile --length 10240 --file file1 -echo \"separator\" -tar cfz archive file1 -echo \"separator\" -mv file1 orig -tar xfv archive -cmp orig file1 -)" -echo comprec.at:25 >"$at_check_line_file" + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + rm -rf \$file -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +mkdir dir +mkfifo dir/fifo +MAJOR=\$( stat /dev/urandom --printf=\"%t\" ) +MINOR=\$( stat /dev/urandom --printf=\"%T\" ) +mknod dir/chartype c \$MAJOR \$MINOR -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:\$UID:--- dir/fifo +setfacl -m u:\$UID:rwx dir/chartype + +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before + +tar --xattrs --selinux --acls -cf archive.tar dir + +mv dir olddir + +tar --xattrs --selinux --acls -xf archive.tar + +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after + +diff before after +echo separator +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28" +( $at_check_trace; +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/comprec.at:25: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file - echo 1 > "$at_status_file" - exit 1 -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -$at_traceon -$at_traceoff -echo "$at_srcdir/comprec.at:25: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" -export TAR_OPTIONS -rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) -genfile --length 10240 --file file1 -echo \"separator\" -tar cfz archive file1 -echo \"separator\" -mv file1 orig -tar xfv archive -cmp orig file1 -)" -echo comprec.at:25 >"$at_check_line_file" + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +mkdir dir +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:$UID:--- dir/fifo +setfacl -m u:$UID:rwx dir/chartype -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/comprec.at:25: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +tar --xattrs --selinux --acls -cf archive.tar dir +mv dir olddir - echo 1 > "$at_status_file" - exit 1 -fi +tar --xattrs --selinux --acls -xf archive.tar + +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after -$at_traceon -$at_traceoff -echo "$at_srcdir/comprec.at:25: +diff before after +echo separator +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/selacl01.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -26684,1257 +41006,705 @@ export TAR_OPTIONS rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -genfile --length 10240 --file file1 -echo \"separator\" -tar cfz archive file1 -echo \"separator\" -mv file1 orig -tar xfv archive -cmp orig file1 -)" -echo comprec.at:25 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/comprec.at:25: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -$at_traceon -$at_traceoff -echo "$at_srcdir/comprec.at:25: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -genfile --length 10240 --file file1 -echo \"separator\" -tar cfz archive file1 -echo \"separator\" -mv file1 orig -tar xfv archive -cmp orig file1 -)" -echo comprec.at:25 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +mkdir dir +mkfifo dir/fifo +MAJOR=\$( stat /dev/urandom --printf=\"%t\" ) +MINOR=\$( stat /dev/urandom --printf=\"%T\" ) +mknod dir/chartype c \$MAJOR \$MINOR -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/comprec.at:25: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:\$UID:--- dir/fifo +setfacl -m u:\$UID:rwx dir/chartype +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before - echo 1 > "$at_status_file" - exit 1 -fi +tar --xattrs --selinux --acls -cf archive.tar dir -$at_traceon -$at_traceoff -echo "$at_srcdir/comprec.at:25: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mv dir olddir + +tar --xattrs --selinux --acls -xf archive.tar + +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after + +diff before after +echo separator +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28" +( $at_check_trace; +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 -genfile --length 10240 --file file1 -echo \"separator\" -tar cfz archive file1 -echo \"separator\" -mv file1 orig -tar xfv archive -cmp orig file1 -)" -echo comprec.at:25 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive -cmp orig file1 -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "separator -separator -file1 -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/comprec.at:25: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + rm -rf $file -$at_traceon + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi +mkdir dir +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:$UID:--- dir/fifo +setfacl -m u:$UID:rwx dir/chartype - 68 ) # 68. shortfile.at:26: short input files - at_setup_line='shortfile.at:26' - at_desc="short input files" - $at_quiet $ECHO_N " 68: short input files $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "68. shortfile.at:26: testing ..." - $at_traceon +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before +tar --xattrs --selinux --acls -cf archive.tar dir +mv dir olddir +tar --xattrs --selinux --acls -xf archive.tar +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after - $at_traceoff -echo "$at_srcdir/shortfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +diff before after +echo separator +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/selacl01.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" +TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -genfile --length 511 --file foo || exit 5 -tar tf foo -)" -echo shortfile.at:29 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -genfile --length 511 --file foo || exit 5 -tar tf foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + file=\$(TMPDIR=. mktemp fiXXXXXX) -genfile --length 511 --file foo || exit 5 -tar tf foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -at_failed=false -echo >>"$at_stderr"; echo "tar: This does not look like a tar archive -tar: Exiting with failure status due to previous errors -" | $at_diff - "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 2) ;; - *) echo "$at_srcdir/shortfile.at:29: exit code was $at_status, expected 2" - at_failed=:;; -esac -if $at_failed; then + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - 69 ) # 69. shortupd.at:29: updating short archives - at_setup_line='shortupd.at:29' - at_desc="updating short archives" - $at_quiet $ECHO_N " 69: updating short archives $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "69. shortupd.at:29: testing ..." - $at_traceon + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + rm -rf \$file + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/shortupd.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" -export TAR_OPTIONS -rm -rf * -touch foo -tar uf archive foo -)" -echo shortupd.at:32 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + rm -rf \$file -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortupd.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi +mkdir dir +mkfifo dir/fifo +MAJOR=\$( stat /dev/urandom --printf=\"%t\" ) +MINOR=\$( stat /dev/urandom --printf=\"%T\" ) +mknod dir/chartype c \$MAJOR \$MINOR -$at_traceon -$at_traceoff -echo "$at_srcdir/shortupd.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" -export TAR_OPTIONS -rm -rf * +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:\$UID:--- dir/fifo +setfacl -m u:\$UID:rwx dir/chartype -touch foo -tar uf archive foo -)" -echo shortupd.at:32 >"$at_check_line_file" +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +tar --xattrs --selinux --acls -cf archive.tar dir -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +mv dir olddir -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +tar --xattrs --selinux --acls -xf archive.tar + +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after + +diff before after +echo separator +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28" +( $at_check_trace; +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortupd.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -$at_traceon -$at_traceoff -echo "$at_srcdir/shortupd.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" -export TAR_OPTIONS -rm -rf * + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -touch foo -tar uf archive foo -)" -echo shortupd.at:32 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortupd.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + file=$(TMPDIR=. mktemp fiXXXXXX) + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/shortupd.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -touch foo -tar uf archive foo -)" -echo shortupd.at:32 >"$at_check_line_file" + rm -rf $file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortupd.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -$at_traceon -$at_traceoff -echo "$at_srcdir/shortupd.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * + rm -rf $file -touch foo -tar uf archive foo -)" -echo shortupd.at:32 >"$at_check_line_file" + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +mkdir dir +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:$UID:--- dir/fifo +setfacl -m u:$UID:rwx dir/chartype + +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before + +tar --xattrs --selinux --acls -cf archive.tar dir + +mv dir olddir + +tar --xattrs --selinux --acls -xf archive.tar + +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after + +diff before after +echo separator +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/selacl01.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -touch foo -tar uf archive foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -$at_diff "$at_devnull" "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/shortupd.at:32: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -$at_traceon + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - 70 ) # 70. truncate.at:29: truncate - at_setup_line='truncate.at:29' - at_desc="truncate" - $at_quiet $ECHO_N " 70: truncate $ECHO_C" - at_xfail=no - test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "70. truncate.at:29: testing ..." - $at_traceon + file=\$(TMPDIR=. mktemp fiXXXXXX) + restorecon \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - $at_traceoff -echo "$at_srcdir/truncate.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H v7\" -export TAR_OPTIONS -rm -rf * + chcon -h --user=unconfined_u \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: \$? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar)" -echo truncate.at:32 >"$at_check_line_file" + rm -rf \$file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) + err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + file=\$(TMPDIR=. mktemp fiXXXXXX) -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: File shrank by 5120 bytes; padding with zeros -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -Exit status: 1 -separator -foo -foo: Mod time differs -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/truncate.at:32: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then + setfacl -m u:\$UID:rwx \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi + getfacl \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi -$at_traceon -$at_traceoff -echo "$at_srcdir/truncate.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H oldgnu\" -export TAR_OPTIONS -rm -rf * + rm -rf \$file -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: \$? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar)" -echo truncate.at:32 >"$at_check_line_file" + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:\$UID:rwx \$file + err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +mkdir dir +mkfifo dir/fifo +MAJOR=\$( stat /dev/urandom --printf=\"%t\" ) +MINOR=\$( stat /dev/urandom --printf=\"%T\" ) +mknod dir/chartype c \$MAJOR \$MINOR -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:\$UID:--- dir/fifo +setfacl -m u:\$UID:rwx dir/chartype -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: File shrank by 5120 bytes; padding with zeros -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -Exit status: 1 -separator -foo -foo: Mod time differs -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/truncate.at:32: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then +tar --xattrs --selinux --acls -cf archive.tar dir +mv dir olddir - echo 1 > "$at_status_file" - exit 1 -fi +tar --xattrs --selinux --acls -xf archive.tar -$at_traceon -$at_traceoff -echo "$at_srcdir/truncate.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after + +diff before after +echo separator +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28" +( $at_check_trace; +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H ustar\" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: \$? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar)" -echo truncate.at:32 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * + file=$(TMPDIR=. mktemp fiXXXXXX) -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: File shrank by 5120 bytes; padding with zeros -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -Exit status: 1 -separator -foo -foo: Mod time differs -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/truncate.at:32: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/truncate.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H posix\" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: \$? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar)" -echo truncate.at:32 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + file=$(TMPDIR=. mktemp fiXXXXXX) -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: File shrank by 5120 bytes; padding with zeros -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -Exit status: 1 -separator -foo -foo: Mod time differs -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/truncate.at:32: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then + rm -rf $file + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/truncate.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS=\"-H gnu\" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: \$? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar)" -echo truncate.at:32 >"$at_check_line_file" + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + rm -rf $file -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 49995k --truncate foo -echo Exit status: $? -echo separator -sleep 1 -genfile --file foo --seek 49995k --length 5k --pattern=zeros -tar dvf bar) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: File shrank by 5120 bytes; padding with zeros -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -Exit status: 1 -separator -foo -foo: Mod time differs -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/truncate.at:32: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then +mkdir dir +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:$UID:--- dir/fifo +setfacl -m u:$UID:rwx dir/chartype - echo 1 > "$at_status_file" - exit 1 -fi +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before -$at_traceon +tar --xattrs --selinux --acls -cf archive.tar dir +mv dir olddir +tar --xattrs --selinux --acls -xf archive.tar - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after - 71 ) # 71. grow.at:24: grow - at_setup_line='grow.at:24' - at_desc="grow" - $at_quiet $ECHO_N " 71: grow $ECHO_C" - at_xfail=no +diff before after +echo separator +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "separator +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_173 +#AT_START_174 +at_fn_group_banner 174 'capabs_raw01.at:25' \ + "capabilities: binary store/restore" " " 25 +at_xfail=no test -f $XFAILFILE && at_xfail=yes - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "71. grow.at:24: testing ..." - $at_traceon +( + $as_echo "174. $at_setup_line: testing $at_desc ..." + $at_traceon - $at_traceoff -echo "$at_srcdir/grow.at:27: + { set +x +$as_echo "$at_srcdir/capabs_raw01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -27943,38 +41713,73 @@ TAR_OPTIONS=\"-H v7\" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \\ - --append foo -)" -echo grow.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setcap \"= cap_chown=ei\" \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getcap \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + +mkdir dir +genfile --file dir/file + +setcap \"= cap_chown=ei\" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28" +( $at_check_trace; mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -27983,36 +41788,84 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: file changed as we read it -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/grow.at:27: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/grow.at:27: + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setcap "= cap_chown=ei" $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getcap $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + +mkdir dir +genfile --file dir/file + +setcap "= cap_chown=ei" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/capabs_raw01.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -28021,38 +41874,73 @@ TAR_OPTIONS=\"-H oldgnu\" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \\ - --append foo -)" -echo grow.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setcap \"= cap_chown=ei\" \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getcap \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + +mkdir dir +genfile --file dir/file + +setcap \"= cap_chown=ei\" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28" +( $at_check_trace; mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -28061,36 +41949,84 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: file changed as we read it -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/grow.at:27: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/grow.at:27: + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setcap "= cap_chown=ei" $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getcap $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + +mkdir dir +genfile --file dir/file + +setcap "= cap_chown=ei" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/capabs_raw01.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -28099,38 +42035,73 @@ TAR_OPTIONS=\"-H ustar\" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \\ - --append foo -)" -echo grow.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setcap \"= cap_chown=ei\" \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getcap \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + +mkdir dir +genfile --file dir/file + +setcap \"= cap_chown=ei\" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28" +( $at_check_trace; mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -28139,36 +42110,84 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: file changed as we read it -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/grow.at:27: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setcap "= cap_chown=ei" $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getcap $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/grow.at:27: +mkdir dir +genfile --file dir/file + +setcap "= cap_chown=ei" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/capabs_raw01.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -28177,38 +42196,73 @@ TAR_OPTIONS=\"-H posix\" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \\ - --append foo -)" -echo grow.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setcap \"= cap_chown=ei\" \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getcap \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + +mkdir dir +genfile --file dir/file + +setcap \"= cap_chown=ei\" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28" +( $at_check_trace; mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -28217,36 +42271,84 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: file changed as we read it -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/grow.at:27: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon -$at_traceoff -echo "$at_srcdir/grow.at:27: + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setcap "= cap_chown=ei" $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getcap $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + +mkdir dir +genfile --file dir/file + +setcap "= cap_chown=ei" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/capabs_raw01.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -28255,38 +42357,73 @@ TAR_OPTIONS=\"-H gnu\" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \\ - --append foo -)" -echo grow.at:27 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +echo \"test\" > \$\$ +chmod 0 \$\$ +cat \$\$ > /dev/null 2>&1 +result=\$? +rm -f \$\$ +test \$result -eq 0 || exit 77 -if test -n "$at_trace_this"; then - ( $at_traceon; -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getfattr \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj \$file + # check whether tar fails to store xattrs + err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l ) + if test \"\$err\" != \"0\"; then + exit 77 + fi + + + file=\$(TMPDIR=. mktemp fiXXXXXX) + + setcap \"= cap_chown=ei\" \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + + getcap \$file &> /dev/null + if test \"\$?\" != 0; then + exit 77 + fi + + rm -rf \$file + + +mkdir dir +genfile --file dir/file + +setcap \"= cap_chown=ei\" dir/file + +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir + +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +)" +at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28" +( $at_check_trace; mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -28295,182 +42432,175 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run 'tar -vcf bar foo baz' --checkpoint 10 --length 1024 \ - --append foo -) ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -echo >>"$at_stderr"; echo "tar: foo: file changed as we read it -" | $at_diff - "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "foo -baz -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 1) ;; - *) echo "$at_srcdir/grow.at:27: exit code was $at_status, expected 1" - at_failed=:;; -esac -if $at_failed; then +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo 1 > "$at_status_file" - exit 1 -fi -$at_traceon + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - 72 ) # 72. gtarfail.at:21: gtarfail - at_setup_line='gtarfail.at:21' - at_desc="gtarfail" - $at_quiet $ECHO_N " 72: gtarfail $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "72. gtarfail.at:21: testing ..." - $at_traceon + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -unset TAR_OPTIONS + file=$(TMPDIR=. mktemp fiXXXXXX) -$at_traceoff -echo "$at_srcdir/gtarfail.at:26: + setcap "= cap_chown=ei" $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + getcap $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi -tar --utc -tvf \$STAR_TESTSCRIPTS/gtarfail.tar -" -echo gtarfail.at:26 >"$at_check_line_file" + rm -rf $file -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi -if test -n "$at_trace_this"; then - ( $at_traceon; +mkdir dir +genfile --file dir/file -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +setcap "= cap_chown=ei" dir/file +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +# clear the directory +rm -rf dir + +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar + +getcap dir/file +) +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_174 +#AT_START_175 +at_fn_group_banner 175 'gtarfail.at:21' \ + "gtarfail" " " 26 +at_xfail=no +( + $as_echo "175. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +unset TAR_OPTIONS + +{ set +x +$as_echo "$at_srcdir/gtarfail.at:26: + +test -z \"\$STAR_TESTSCRIPTS\" && exit 77 +tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77 + + +tar --utc -tvf \$STAR_TESTSCRIPTS/gtarfail.tar +" +at_fn_check_prepare_notrace 'an embedded newline' "gtarfail.at:26" +( $at_check_trace; test -z "$STAR_TESTSCRIPTS" && exit 77 tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "-rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "-rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif -rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif -rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG -rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg -rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif -rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/gtarfail.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 73 ) # 73. gtarfail2.at:21: gtarfail2 - at_setup_line='gtarfail2.at:21' - at_desc="gtarfail2" - $at_quiet $ECHO_N " 73: gtarfail2 $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "73. gtarfail2.at:21: testing ..." - $at_traceon +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/gtarfail.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_175 +#AT_START_176 +at_fn_group_banner 176 'gtarfail2.at:21' \ + "gtarfail2" " " 26 +at_xfail=no +( + $as_echo "176. $at_setup_line: testing $at_desc ..." + $at_traceon unset TAR_OPTIONS -$at_traceoff -echo "$at_srcdir/gtarfail2.at:26: +{ set +x +$as_echo "$at_srcdir/gtarfail2.at:26: -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +test -z \"\$STAR_TESTSCRIPTS\" && exit 77 +tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77 tar --utc -tvf \$STAR_TESTSCRIPTS/gtarfail2.tar " -echo gtarfail2.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "gtarfail2.at:26" +( $at_check_trace; test -z "$STAR_TESTSCRIPTS" && exit 77 tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "-rwxr-xr-x jes/glone 214 2001-09-21 14:08 .clean +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "-rwxr-xr-x jes/glone 214 2001-09-21 14:08 .clean lrwxrwxrwx jes/cats 0 1998-05-07 12:39 RULES -> makefiles/RULES drwxr-sr-x jes/glone 0 2001-12-10 00:00 build/ -rw-r--r-- jes/glone 312019 2001-12-10 00:00 build/smake-1.2.tar.gz @@ -28480,83 +42610,46 @@ drwxr-sr-x jes/glone 0 2001-11-09 18:20 build/psmake/ -rw-r--r-- jes/glone 647 2001-02-25 23:50 build/psmake/Makefile lrwxrwxrwx jes/glone 0 2001-08-29 10:53 build/psmake/archconf.c -> ../archconf.c lrwxrwxrwx jes/glone 0 2001-08-29 10:54 build/psmake/astoi.c -> ../../lib/astoi.c -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/gtarfail2.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 74 ) # 74. multi-fail.at:21: multi-fail - at_setup_line='multi-fail.at:21' - at_desc="multi-fail" - $at_quiet $ECHO_N " 74: multi-fail $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "74. multi-fail.at:21: testing ..." - $at_traceon +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/gtarfail2.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_176 +#AT_START_177 +at_fn_group_banner 177 'multi-fail.at:21' \ + "multi-fail" " " 26 +at_xfail=no +( + $as_echo "177. $at_setup_line: testing $at_desc ..." + $at_traceon unset TAR_OPTIONS -$at_traceoff -echo "$at_srcdir/multi-fail.at:26: +{ set +x +$as_echo "$at_srcdir/multi-fail.at:26: -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +test -z \"\$STAR_TESTSCRIPTS\" && exit 77 +tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77 -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +test -z \"\$STAR_TESTSCRIPTS\" && exit 77 +tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77 tar --utc -tvM -f \$STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \\ -f \$STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- " -echo multi-fail.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ - -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "multi-fail.at:26" +( $at_check_trace; test -z "$STAR_TESTSCRIPTS" && exit 77 tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 @@ -28568,13 +42661,12 @@ tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STA tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false -$at_diff "$at_devnull" "$at_stderr" || at_failed=: -echo >>"$at_stdout"; echo "drwxrwsr-x joerg/bs 0 2003-10-11 14:32 OBJ/i386-sunos5-gcc/ +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "drwxrwsr-x joerg/bs 0 2003-10-11 14:32 OBJ/i386-sunos5-gcc/ -rw-r--r-- joerg/bs 1 2003-10-11 14:32 OBJ/i386-sunos5-gcc/Dnull -rw-r--r-- joerg/bs 1743 2003-10-10 18:06 OBJ/i386-sunos5-gcc/star.d -rw-r--r-- joerg/bs 1460 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.d @@ -28625,80 +42717,45 @@ echo >>"$at_stdout"; echo "drwxrwsr-x joerg/bs 0 2003-10-11 14:32 OBJ/i -rw-r--r-- joerg/bs 3864 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.o -rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.o -rw-r--r-- joerg/bs 952 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.o --rw-r--r-- joerg/bs 2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/multi-fail.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon - - - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 75 ) # 75. ustar-big-2g.at:21: ustar-big-2g - at_setup_line='ustar-big-2g.at:21' - at_desc="ustar-big-2g" - $at_quiet $ECHO_N " 75: ustar-big-2g $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "75. ustar-big-2g.at:21: testing ..." - $at_traceon - - - -unset TAR_OPTIONS - -$at_traceoff -echo "$at_srcdir/ustar-big-2g.at:26: - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +-rw-r--r-- joerg/bs 2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/multi-fail.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_177 +#AT_START_178 +at_fn_group_banner 178 'ustar-big-2g.at:21' \ + "ustar-big-2g" " " 26 +at_xfail=no +( + $as_echo "178. $at_setup_line: testing $at_desc ..." + $at_traceon -tar --utc -tvjf \$STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 -" -echo ustar-big-2g.at:26 >"$at_check_line_file" -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi +unset TAR_OPTIONS -if test -n "$at_trace_this"; then - ( $at_traceon; +{ set +x +$as_echo "$at_srcdir/ustar-big-2g.at:26: cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +test -z \"\$STAR_TESTSCRIPTS\" && exit 77 +tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77 -tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +tar --utc -tvjf \$STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 +" +at_fn_check_prepare_notrace 'an embedded newline' "ustar-big-2g.at:26" +( $at_check_trace; cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 @@ -28708,29 +42765,18 @@ tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTS tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; echo "-rw------- jes/glone 2147483647 2002-06-15 14:53 big +echo >>"$at_stdout"; $as_echo "-rw------- jes/glone 2147483647 2002-06-15 14:53 big -rw-r--r-- jes/glone 0 2002-06-15 14:53 file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/ustar-big-2g.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/ustar-big-2g.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -28746,62 +42792,37 @@ do done - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 76 ) # 76. ustar-big-8g.at:21: ustar-big-8g - at_setup_line='ustar-big-8g.at:21' - at_desc="ustar-big-8g" - $at_quiet $ECHO_N " 76: ustar-big-8g $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "76. ustar-big-8g.at:21: testing ..." - $at_traceon + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_178 +#AT_START_179 +at_fn_group_banner 179 'ustar-big-8g.at:21' \ + "ustar-big-8g" " " 26 +at_xfail=no +( + $as_echo "179. $at_setup_line: testing $at_desc ..." + $at_traceon unset TAR_OPTIONS -$at_traceoff -echo "$at_srcdir/ustar-big-8g.at:26: +{ set +x +$as_echo "$at_srcdir/ustar-big-8g.at:26: cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +test -z \"\$STAR_TESTSCRIPTS\" && exit 77 +tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77 tar --utc -tvjf \$STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 " -echo ustar-big-8g.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "ustar-big-8g.at:26" +( $at_check_trace; cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 @@ -28811,29 +42832,18 @@ tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTS tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; echo "-rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1 +echo >>"$at_stdout"; $as_echo "-rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1 -rw-r--r-- jes/glone 0 2002-06-15 14:53 file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/ustar-big-8g.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/ustar-big-8g.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -28849,62 +42859,37 @@ do done - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - 77 ) # 77. pax-big-10g.at:21: pax-big-10g - at_setup_line='pax-big-10g.at:21' - at_desc="pax-big-10g" - $at_quiet $ECHO_N " 77: pax-big-10g $ECHO_C" - at_xfail=no - echo "# -*- compilation -*-" >> "$at_group_log" - ( - echo "77. pax-big-10g.at:21: testing ..." - $at_traceon + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_179 +#AT_START_180 +at_fn_group_banner 180 'pax-big-10g.at:21' \ + "pax-big-10g" " " 26 +at_xfail=no +( + $as_echo "180. $at_setup_line: testing $at_desc ..." + $at_traceon unset TAR_OPTIONS -$at_traceoff -echo "$at_srcdir/pax-big-10g.at:26: +{ set +x +$as_echo "$at_srcdir/pax-big-10g.at:26: cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +test -z \"\$STAR_TESTSCRIPTS\" && exit 77 +tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77 tar --utc -tvjf \$STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 " -echo pax-big-10g.at:26 >"$at_check_line_file" - -at_trace_this= -if test -n "$at_traceon"; then - echo 'Not enabling shell tracing (command contains an embedded newline)' -fi - -if test -n "$at_trace_this"; then - ( $at_traceon; - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 - ) >"$at_stdout" 2>"$at_stder1" - at_status=$? - grep '^ *+' "$at_stder1" >&2 - grep -v '^ *+' "$at_stder1" >"$at_stderr" -else - ( :; +at_fn_check_prepare_notrace 'an embedded newline' "pax-big-10g.at:26" +( $at_check_trace; cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 @@ -28914,29 +42899,18 @@ tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSC tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 - ) >"$at_stdout" 2>"$at_stderr" - at_status=$? -fi -at_failed=false +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; echo "-rw------- jes/glone 10737418240 2002-06-15 21:18 10g +echo >>"$at_stdout"; $as_echo "-rw------- jes/glone 10737418240 2002-06-15 21:18 10g -rw-r--r-- jes/glone 0 2002-06-15 14:53 file -" | $at_diff - "$at_stdout" || at_failed=: -case $at_status in - 77) echo 77 > "$at_status_file"; exit 77;; - 0) ;; - *) echo "$at_srcdir/pax-big-10g.at:26: exit code was $at_status, expected 0" - at_failed=:;; -esac -if $at_failed; then - - - echo 1 > "$at_status_file" - exit 1 -fi - -$at_traceon +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/pax-big-10g.at:26" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -28952,315 +42926,8 @@ do done - $at_traceoff - $at_times_p && times >"$at_times_file" - ) 5>&1 2>&1 | eval $at_tee_pipe - at_status=`cat "$at_status_file"` - ;; - - - * ) - echo "$as_me: no such test group: $at_group" >&2 - continue - ;; - esac - - # Be sure to come back to the suite directory, in particular - # since below we might `rm' the group directory we are in currently. - cd "$at_suite_dir" - - case $at_group in - banner-*) ;; - *) - if test ! -f "$at_check_line_file"; then - sed "s/^ */$as_me: warning: /" <<_ATEOF - A failure happened in a test group before any test could be - run. This means that test suite is improperly designed. Please - report this failure to . -_ATEOF - echo "$at_setup_line" >"$at_check_line_file" - fi - at_group_count=`expr 1 + $at_group_count` - $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" - echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> "$at_group_log" - case $at_xfail:$at_status in - yes:0) - at_msg="UNEXPECTED PASS" - at_xpass_list="$at_xpass_list $at_group" - at_errexit=$at_errexit_p - ;; - no:0) - at_msg="ok" - at_pass_list="$at_pass_list $at_group" - at_errexit=false - ;; - *:77) - at_msg='skipped ('`cat "$at_check_line_file"`')' - at_skip_list="$at_skip_list $at_group" - at_errexit=false - ;; - yes:*) - at_msg='expected failure ('`cat "$at_check_line_file"`')' - at_xfail_list="$at_xfail_list $at_group" - at_errexit=false - ;; - no:*) - at_msg='FAILED ('`cat "$at_check_line_file"`')' - at_fail_list="$at_fail_list $at_group" - at_errexit=$at_errexit_p - ;; - esac - # Make sure there is a separator even with long titles. - echo " $at_msg" - at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" - case $at_status in - 0|77) - # $at_times_file is only available if the group succeeded. - # We're not including the group log, so the success message - # is written in the global log separately. But we also - # write to the group log in case they're using -d. - if test -f "$at_times_file"; then - at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')' - rm -f "$at_times_file" - fi - echo "$at_log_msg" >> "$at_group_log" - echo "$at_log_msg" >&5 - - # Cleanup the group directory, unless the user wants the files. - if $at_debug_p ; then - { - echo "#! /bin/sh" - echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' - echo "cd '$at_dir'" - echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ - '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' - echo 'exit 1' - } >$at_group_dir/run - chmod +x $at_group_dir/run - - elif test -d "$at_group_dir"; then - find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; - rm -fr "$at_group_dir" - fi - ;; - *) - # Upon failure, include the log into the testsuite's global - # log. The failure message is written in the group log. It - # is later included in the global log. - echo "$at_log_msg" >> "$at_group_log" - - # Upon failure, keep the group directory for autopsy, and - # create the debugging script. - { - echo "#! /bin/sh" - echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' - echo "cd '$at_dir'" - echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ - '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' - echo 'exit 1' - } >$at_group_dir/run - chmod +x $at_group_dir/run - - $at_errexit && break - ;; - esac - ;; - esac -done - -# Back to the top directory. -cd "$at_dir" - -# Compute the duration of the suite. -at_stop_date=`date` -at_stop_time=`date +%s 2>/dev/null` -echo "$as_me: ending at: $at_stop_date" >&5 -case $at_start_time,$at_stop_time in - [0-9]*,[0-9]*) - at_duration_s=`expr $at_stop_time - $at_start_time` - at_duration_m=`expr $at_duration_s / 60` - at_duration_h=`expr $at_duration_m / 60` - at_duration_s=`expr $at_duration_s % 60` - at_duration_m=`expr $at_duration_m % 60` - at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" - echo "$as_me: test suite duration: $at_duration" >&5 - ;; -esac - -# Wrap up the test suite with summary statistics. -at_skip_count=`set dummy $at_skip_list; shift; echo $#` -at_fail_count=`set dummy $at_fail_list; shift; echo $#` -at_xpass_count=`set dummy $at_xpass_list; shift; echo $#` -at_xfail_count=`set dummy $at_xfail_list; shift; echo $#` - -at_run_count=`expr $at_group_count - $at_skip_count` -at_unexpected_count=`expr $at_xpass_count + $at_fail_count` -at_total_fail_count=`expr $at_xfail_count + $at_fail_count` - -echo -cat <<\_ASBOX -## ------------- ## -## Test results. ## -## ------------- ## -_ASBOX -echo -{ - echo - cat <<\_ASBOX -## ------------- ## -## Test results. ## -## ------------- ## -_ASBOX - echo -} >&5 - -if test $at_run_count = 1; then - at_result="1 test" - at_were=was -else - at_result="$at_run_count tests" - at_were=were -fi -if $at_errexit_p && test $at_unexpected_count != 0; then - if test $at_xpass_count = 1; then - at_result="$at_result $at_were run, one passed" - else - at_result="$at_result $at_were run, one failed" - fi - at_result="$at_result unexpectedly and inhibited subsequent tests." -else - # Don't you just love exponential explosion of the number of cases? - case $at_xpass_count:$at_fail_count:$at_xfail_count in - # So far, so good. - 0:0:0) at_result="$at_result $at_were successful." ;; - 0:0:*) at_result="$at_result behaved as expected." ;; - - # Some unexpected failures - 0:*:0) at_result="$at_result $at_were run, -$at_fail_count failed unexpectedly." ;; - - # Some failures, both expected and unexpected - 0:*:1) at_result="$at_result $at_were run, -$at_total_fail_count failed ($at_xfail_count expected failure)." ;; - 0:*:*) at_result="$at_result $at_were run, -$at_total_fail_count failed ($at_xfail_count expected failures)." ;; - - # No unexpected failures, but some xpasses - *:0:*) at_result="$at_result $at_were run, -$at_xpass_count passed unexpectedly." ;; - - # No expected failures, but failures and xpasses - *:1:0) at_result="$at_result $at_were run, -$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; - *:*:0) at_result="$at_result $at_were run, -$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; - - # All of them. - *:*:1) at_result="$at_result $at_were run, -$at_xpass_count passed unexpectedly, -$at_total_fail_count failed ($at_xfail_count expected failure)." ;; - *:*:*) at_result="$at_result $at_were run, -$at_xpass_count passed unexpectedly, -$at_total_fail_count failed ($at_xfail_count expected failures)." ;; - esac - - if test $at_skip_count = 0 && test $at_run_count -gt 1; then - at_result="All $at_result" - fi -fi - -# Now put skips in the mix. -case $at_skip_count in - 0) ;; - 1) at_result="$at_result -1 test was skipped." ;; - *) at_result="$at_result -$at_skip_count tests were skipped." ;; -esac - -if test $at_unexpected_count = 0; then - echo "$at_result" - echo "$at_result" >&5 -else - echo "ERROR: $at_result" >&2 - echo "ERROR: $at_result" >&5 - { - echo - cat <<\_ASBOX -## ------------------------ ## -## Summary of the failures. ## -## ------------------------ ## -_ASBOX - - # Summary of failed and skipped tests. - if test $at_fail_count != 0; then - echo "Failed tests:" - $SHELL "$0" $at_fail_list --list - echo - fi - if test $at_skip_count != 0; then - echo "Skipped tests:" - $SHELL "$0" $at_skip_list --list - echo - fi - if test $at_xpass_count != 0; then - echo "Unexpected passes:" - $SHELL "$0" $at_xpass_list --list - echo - fi - if test $at_fail_count != 0; then - cat <<\_ASBOX -## ---------------------- ## -## Detailed failed tests. ## -## ---------------------- ## -_ASBOX - echo - for at_group in $at_fail_list - do - at_group_normalized=$at_group - - while :; do - case $at_group_normalized in #( - $at_format*) break;; - esac - at_group_normalized=0$at_group_normalized - done - - cat "$at_suite_dir/$at_group_normalized/$as_me.log" - echo - done - echo - fi - if test -n "$at_top_srcdir"; then - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## ${at_top_build_prefix}config.log ## -_ASBOX - sed 's/^/| /' ${at_top_build_prefix}config.log - echo - fi - } >&5 - - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## $as_me.log was created. ## -_ASBOX - - echo - echo "Please send \`${at_testdir+${at_testdir}/}$as_me.log' and all information you think might help:" - echo - echo " To: " - echo " Subject: [GNU tar 1.21] $as_me:$at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}$at_xpass_list${at_xpass_list:+ passed unexpectedly}" - echo - if test $at_debug_p = false; then - echo - echo 'You may investigate any problem if you feel able to do so, in which' - echo 'case the test suite provides a good starting point. Its output may' - echo "be found below \`${at_testdir+${at_testdir}/}$as_me.dir'." - echo - fi - exit 1 -fi - -exit 0 - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_180