2 # Generated from testsuite.at by GNU Autoconf 2.69.
4 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
6 # This test suite is free software; the Free Software Foundation gives
7 # unlimited permission to copy, distribute and modify it.
8 ## -------------------- ##
9 ## M4sh Initialization. ##
10 ## -------------------- ##
12 # Be more Bourne compatible
13 DUALCASE=1; export DUALCASE # for MKS sh
14 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
17 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
18 # is contrary to our usage. Disable this feature.
19 alias -g '${1+"$@"}'='"$@"'
22 case `(set -o) 2>/dev/null` in #(
34 # Printing a long string crashes Solaris 7 /usr/bin/printf.
35 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
36 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
37 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
38 # Prefer a ksh shell builtin over an external printf program on Solaris,
39 # but without wasting forks for bash or zsh.
40 if test -z "$BASH_VERSION$ZSH_VERSION" \
41 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
43 as_echo_n='print -rn --'
44 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
48 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
49 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
50 as_echo_n='/usr/ucb/echo -n'
52 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
57 expr "X$arg" : "X\\(.*\\)$as_nl";
58 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
60 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
63 as_echo_n='sh -c $as_echo_n_body as_echo'
66 as_echo='sh -c $as_echo_body as_echo'
69 # The user is always right.
70 if test "${PATH_SEPARATOR+set}" != set; then
72 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
73 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
80 # We need space, tab and new line, in precisely that order. Quoting is
81 # there to prevent editors from complaining about space-tab.
82 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
83 # splitting by setting IFS to empty value.)
86 # Find who we are. Look in the path if we contain no directory separator.
89 *[\\/]* ) as_myself=$0 ;;
90 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
94 test -z "$as_dir" && as_dir=.
95 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
101 # We did not find ourselves, most probably we were run as `sh COMMAND'
102 # in which case we are not to be found in the path.
103 if test "x$as_myself" = x; then
106 if test ! -f "$as_myself"; then
107 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
111 # Unset variables that we do not need and which cause bugs (e.g. in
112 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
113 # suppresses any "Segmentation fault" message there. '((' could
114 # trigger a bug in pdksh 5.2.14.
115 for as_var in BASH_ENV ENV MAIL MAILPATH
116 do eval test x\${$as_var+set} = xset \
117 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
130 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
132 if test "x$CONFIG_SHELL" = x; then
133 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
136 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
137 # is contrary to our usage. Disable this feature.
138 alias -g '\${1+\"\$@\"}'='\"\$@\"'
141 case \`(set -o) 2>/dev/null\` in #(
149 as_required="as_fn_return () { (exit \$1); }
150 as_fn_success () { as_fn_return 0; }
151 as_fn_failure () { as_fn_return 1; }
152 as_fn_ret_success () { return 0; }
153 as_fn_ret_failure () { return 1; }
156 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
157 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
158 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
159 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
160 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
163 exitcode=1; echo positional parameters were not saved.
165 test x\$exitcode = x0 || exit 1
167 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
168 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
169 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
170 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
171 test \$(( 1 + 1 )) = 2 || exit 1"
172 if (eval "$as_required") 2>/dev/null; then :
177 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
180 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
182 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
185 test -z "$as_dir" && as_dir=.
189 for as_base in sh bash ksh sh5; do
190 # Try only shells that exist, to save several forks.
191 as_shell=$as_dir/$as_base
192 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
193 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
194 CONFIG_SHELL=$as_shell as_have_required=yes
195 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
203 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
204 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
205 CONFIG_SHELL=$SHELL as_have_required=yes
210 if test "x$CONFIG_SHELL" != x; then :
212 # We cannot yet assume a decent shell, so we have to provide a
213 # neutralization value for shells without unset; and this also
214 # works around shells that cannot unset nonexistent variables.
215 # Preserve -v and -x to the replacement shell.
218 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
220 *v*x* | *x*v* ) as_opts=-vx ;;
225 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
226 # Admittedly, this is quite paranoid, since all the known shells bail
227 # out after a failed `exec'.
228 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
232 if test x$as_have_required = xno; then :
233 $as_echo "$0: This script requires a shell more modern than all"
234 $as_echo "$0: the shells that I found on your system."
235 if test x${ZSH_VERSION+set} = xset ; then
236 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
237 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
239 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
240 $0: including any error possibly output before this
241 $0: message. Then install a modern shell, or manually run
242 $0: the script under such a shell if you do have one."
248 SHELL=${CONFIG_SHELL-/bin/sh}
250 # Unset more variables known to interfere with behavior of common tools.
251 CLICOLOR_FORCE= GREP_OPTIONS=
252 unset CLICOLOR_FORCE GREP_OPTIONS
254 ## --------------------- ##
255 ## M4sh Shell Functions. ##
256 ## --------------------- ##
259 # Portably unset VAR.
262 { eval $1=; unset $1;}
266 # as_fn_set_status STATUS
267 # -----------------------
268 # Set $? to STATUS, without forking.
276 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
286 # Create "$as_dir" as a directory, including parents if necessary.
291 -*) as_dir=./$as_dir;;
293 test -d "$as_dir" || eval $as_mkdir_p || {
297 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
300 as_dirs="'$as_qdir' $as_dirs"
301 as_dir=`$as_dirname -- "$as_dir" ||
302 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
303 X"$as_dir" : 'X\(//\)[^/]' \| \
304 X"$as_dir" : 'X\(//\)$' \| \
305 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
306 $as_echo X"$as_dir" |
307 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
324 test -d "$as_dir" && break
326 test -z "$as_dirs" || eval "mkdir $as_dirs"
327 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
332 # as_fn_executable_p FILE
333 # -----------------------
334 # Test if FILE is an executable regular file.
335 as_fn_executable_p ()
337 test -f "$1" && test -x "$1"
338 } # as_fn_executable_p
339 # as_fn_append VAR VALUE
340 # ----------------------
341 # Append the text in VALUE to the end of the definition contained in VAR. Take
342 # advantage of any shell optimizations that allow amortized linear growth over
343 # repeated appends, instead of the typical quadratic growth present in naive
345 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
346 eval 'as_fn_append ()
359 # Perform arithmetic evaluation on the ARGs, and store the result in the
360 # global $as_val. Take advantage of shells that can avoid forks. The arguments
361 # must be portable across $(()) and expr.
362 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
370 as_val=`expr "$@" || test $? -eq 1`
375 # as_fn_error STATUS ERROR [LINENO LOG_FD]
376 # ----------------------------------------
377 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
378 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
379 # script with STATUS, using 1 if that was 0.
382 as_status=$1; test $as_status -eq 0 && as_status=1
384 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
385 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
387 $as_echo "$as_me: error: $2" >&2
388 as_fn_exit $as_status
391 if expr a : '\(a\)' >/dev/null 2>&1 &&
392 test "X`expr 00001 : '.*\(...\)'`" = X001; then
398 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
404 as_me=`$as_basename -- "$0" ||
405 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
406 X"$0" : 'X\(//\)$' \| \
407 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
409 sed '/^.*\/\([^/][^/]*\)\/*$/{
423 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
429 # Avoid depending upon Character Ranges.
430 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
431 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
432 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
433 as_cr_digits='0123456789'
434 as_cr_alnum=$as_cr_Letters$as_cr_digits
437 as_lineno_1=$LINENO as_lineno_1a=$LINENO
438 as_lineno_2=$LINENO as_lineno_2a=$LINENO
439 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
440 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
441 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
453 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
457 chmod +x "$as_me.lineno" ||
458 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
460 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
461 # already done that, so ensure we don't try to do so again and fall
462 # in an infinite loop. This has already happened in practice.
463 _as_can_reexec=no; export _as_can_reexec
464 # Don't try to exec as it changes $[0], causing all sort of problems
465 # (the dirname of $[0] is not the place where we might find the
466 # original and so on. Autoconf is especially sensitive to this).
468 # Exit status is that of the last command.
472 ECHO_C= ECHO_N= ECHO_T=
473 case `echo -n x` in #(((((
475 case `echo 'xy\c'` in
476 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
478 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
485 rm -f conf$$ conf$$.exe conf$$.file
486 if test -d conf$$.dir; then
487 rm -f conf$$.dir/conf$$.file
490 mkdir conf$$.dir 2>/dev/null
492 if (echo >conf$$.file) 2>/dev/null; then
493 if ln -s conf$$.file conf$$ 2>/dev/null; then
495 # ... but there are two gotchas:
496 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
497 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
498 # In both cases, we have to default to `cp -pR'.
499 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
501 elif ln conf$$.file conf$$ 2>/dev/null; then
509 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
510 rmdir conf$$.dir 2>/dev/null
512 if mkdir -p . 2>/dev/null; then
513 as_mkdir_p='mkdir -p "$as_dir"'
515 test -d ./-p && rmdir ./-p
520 as_executable_p=as_fn_executable_p
522 # Sed expression to map a string onto a valid CPP name.
523 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
525 # Sed expression to map a string onto a valid variable name.
526 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
532 SHELL=${CONFIG_SHELL-/bin/sh}
538 # Not all shells have the 'times' builtin; the subshell is needed to make
539 # sure we discard the 'times: not found' message from the shell.
541 (times) >/dev/null 2>&1 && at_times_p=:
543 # CLI Arguments to pass to the debugging scripts.
547 # Shall we be verbose? ':' means no, empty means yes.
550 # Running several jobs in parallel, 0 means as many as test groups.
554 at_check_filter_trace=:
556 # Shall we keep the debug scripts? Must be `:' when the suite is
557 # run by a debug script, so that the script doesn't remove itself.
559 # Display help message?
561 # Display the version message?
569 # Whether to rerun failed tests.
571 # Whether a write failure occurred
574 # The directory we run the suite in. Default to . if no -C option.
576 # An absolute reference to this testsuite script.
578 [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
579 * ) at_myself=$at_dir/$as_myself ;;
581 # Whether -C is in effect.
584 # Whether to enable colored test results.
586 # List of the tested programs.
589 # As many question marks as there are digits in the last test group number.
590 # Used to normalize the test group numbers so that `ls' lists them in
593 # Description of all the test groups.
594 at_help_all="1;deb-format.at:3;dpkg-deb options;dpkg-deb command-line;
595 2;deb-format.at:8;dpkg-deb .deb format;dpkg-deb deb;
596 3;deb-content.at:3;dpkg-deb .deb conffiles;dpkg-deb deb conffiles;
597 4;deb-fields.at:3;dpkg-deb .deb fields;dpkg-deb deb fields;
598 5;deb-split.at:3;dpkg-split options;dpkg-split command-line;
599 6;deb-split.at:8;dpkg-split .deb format;dpkg-split deb-split;
601 # List of the all the test groups.
602 at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
604 # at_fn_validate_ranges NAME...
605 # -----------------------------
606 # Validate and normalize the test group number contained in each variable
607 # NAME. Leading zeroes are treated as decimal.
608 at_fn_validate_ranges ()
612 eval at_value=\$$at_grp
613 if test $at_value -lt 1 || test $at_value -gt 6; then
614 $as_echo "invalid test group: $at_value" >&2
618 0*) # We want to treat leading 0 as decimal, like expr and test, but
619 # AS_VAR_ARITH treats it as octal if it uses $(( )).
620 # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
621 # expr fork, but it is not worth the effort to determine if the
622 # shell supports XSI when the user can just avoid leading 0.
623 eval $at_grp='`expr $at_value + 0`' ;;
631 # If the previous option needs an argument, assign it.
632 if test -n "$at_prev"; then
633 at_option=$at_prev=$at_option
638 *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
642 # Accept the important Cygnus configure options, so we can diagnose typos.
666 no | never | none) at_color=never ;;
667 auto | tty | if-tty) at_color=auto ;;
668 always | yes | force) at_color=always ;;
669 *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
670 as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
684 at_verbose=; at_quiet=:
690 at_check_filter_trace=at_fn_filter_trace
693 [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
694 at_fn_validate_ranges at_option
695 as_fn_append at_groups "$at_option$as_nl"
699 [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
700 at_range_start=`echo $at_option |tr -d X-`
701 at_fn_validate_ranges at_range_start
702 at_range=`$as_echo "$at_groups_all" | \
703 sed -ne '/^'$at_range_start'$/,$p'`
704 as_fn_append at_groups "$at_range$as_nl"
707 -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
708 at_range_end=`echo $at_option |tr -d X-`
709 at_fn_validate_ranges at_range_end
710 at_range=`$as_echo "$at_groups_all" | \
711 sed -ne '1,/^'$at_range_end'$/p'`
712 as_fn_append at_groups "$at_range$as_nl"
715 [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
716 [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
717 [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
718 [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
719 [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
720 [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
721 at_range_start=`expr $at_option : '\(.*\)-'`
722 at_range_end=`expr $at_option : '.*-\(.*\)'`
723 if test $at_range_start -gt $at_range_end; then
725 at_range_end=$at_range_start
726 at_range_start=$at_tmp
728 at_fn_validate_ranges at_range_start at_range_end
729 at_range=`$as_echo "$at_groups_all" | \
730 sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
731 as_fn_append at_groups "$at_range$as_nl"
734 # Directory selection.
741 if test x- = "x$at_dir" ; then
746 # Parallel execution.
750 --jobs=* | -j[0-9]* )
751 if test -n "$at_optarg"; then
754 at_jobs=`expr X$at_option : 'X-j\(.*\)'`
756 case $at_jobs in *[!0-9]*)
757 at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
758 as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
767 at_groups_selected=$at_help_all
779 at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
782 # It is on purpose that we match the test group titles too.
783 at_groups_selected=`$as_echo "$at_groups_selected" |
784 grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
786 # Smash the keywords.
787 at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
788 as_fn_append at_groups "$at_groups_selected$as_nl"
795 at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
796 # Reject names that are not valid shell variable names.
798 '' | [0-9]* | *[!_$as_cr_alnum]* )
799 as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
801 at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
802 # Export now, but save eval for later and for debug scripts.
804 as_fn_append at_debug_args " $at_envvar='$at_value'"
807 *) $as_echo "$as_me: invalid option: $at_option" >&2
808 $as_echo "Try \`$0 --help' for more information." >&2
814 # Verify our last option didn't require an argument
815 if test -n "$at_prev"; then :
816 as_fn_error $? "\`$at_prev' requires an argument"
819 # The file containing the suite.
820 at_suite_log=$at_dir/$as_me.log
822 # Selected test groups.
823 if test -z "$at_groups$at_recheck"; then
824 at_groups=$at_groups_all
826 if test -n "$at_recheck" && test -r "$at_suite_log"; then
827 at_oldfails=`sed -n '
828 /^Failed tests:$/,/^Skipped tests:$/{
829 s/^[ ]*\([1-9][0-9]*\):.*/\1/p
831 /^Unexpected passes:$/,/^## Detailed failed tests/{
832 s/^[ ]*\([1-9][0-9]*\):.*/\1/p
834 /^## Detailed failed tests/q
836 as_fn_append at_groups "$at_oldfails$as_nl"
838 # Sort the tests, removing duplicates.
839 at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
842 if test x"$at_color" = xalways \
843 || { test x"$at_color" = xauto && test -t 1; }; then
844 at_red=`printf '\033[0;31m'`
845 at_grn=`printf '\033[0;32m'`
846 at_lgn=`printf '\033[1;32m'`
847 at_blu=`printf '\033[1;34m'`
848 at_std=`printf '\033[m'`
850 at_red= at_grn= at_lgn= at_blu= at_std=
855 cat <<_ATEOF || at_write_fail=1
856 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
858 Run all the tests, or the selected TESTS, given by numeric ranges, and
859 save a detailed log file. Upon failure, create debugging scripts.
861 Do not change environment variables directly. Instead, set them via
862 command line arguments. Set \`AUTOTEST_PATH' to select the executables
863 to exercise. Each relative directory is expanded as build and source
864 directories relative to the top level of this distribution.
865 E.g., from within the build directory /tmp/foo-1.0, invoking this:
867 $ $0 AUTOTEST_PATH=bin
869 is equivalent to the following, assuming the source directory is /src/foo-1.0:
871 PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
873 cat <<_ATEOF || at_write_fail=1
876 -h, --help print the help message, then exit
877 -V, --version print version number, then exit
878 -c, --clean remove all the files this test suite might create and exit
879 -l, --list describes all the tests, or the selected TESTS
881 cat <<_ATEOF || at_write_fail=1
885 change to directory DIR before starting
886 --color[=never|auto|always]
887 disable colored test results, or enable even without terminal
889 Allow N jobs at once; infinite jobs with no arg (default 1)
890 -k, --keywords=KEYWORDS
891 select the tests matching all the comma-separated KEYWORDS
892 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
893 --recheck select all tests that failed or passed unexpectedly last time
894 -e, --errexit abort as soon as a test fails; implies --debug
895 -v, --verbose force more detailed output
896 default for debugging scripts
897 -d, --debug inhibit clean up and top-level logging
898 default for debugging scripts
899 -x, --trace enable tests shell tracing
901 cat <<_ATEOF || at_write_fail=1
903 Report bugs to <debian-dpkg@lists.debian.org>.
910 cat <<_ATEOF || at_write_fail=1
911 dpkg 1.18.25 test suite: dpkg tools functional test suite test groups:
913 NUM: FILE-NAME:LINE TEST-GROUP-NAME
917 # Pass an empty line as separator between selected groups and help.
918 $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
919 awk 'NF == 1 && FS != ";" {
926 printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
932 n = split ($ 4, a, " ")
933 for (i = 1; i <= n; i++) {
934 l = length (a[i]) + 1
935 if (i > 1 && len + l > lmax) {
937 line = indent " " a[i]
948 }' || at_write_fail=1
951 if $at_version_p; then
952 $as_echo "$as_me (dpkg 1.18.25)" &&
953 cat <<\_ATEOF || at_write_fail=1
955 Copyright (C) 2012 Free Software Foundation, Inc.
956 This test suite is free software; the Free Software Foundation gives
957 unlimited permission to copy, distribute and modify it.
962 # Should we print banners? Yes if more than one test is run.
963 case $at_groups in #(
965 at_print_banners=: ;; #(
966 * ) at_print_banners=false ;;
968 # Text for banner N, set to a single space once printed.
969 # Banner 1. testsuite.at:4
970 # Category starts at test group 1.
971 at_banner_text_1="Binary .deb packages"
972 # Banner 2. testsuite.at:9
973 # Category starts at test group 5.
974 at_banner_text_2="Split .deb packages"
976 # Take any -C into account.
977 if $at_change_dir ; then
978 test x != "x$at_dir" && cd "$at_dir" \
979 || as_fn_error $? "unable to change directory"
983 # Load the config files for any default variable assignments.
984 for at_file in atconfig atlocal
986 test -r $at_file || continue
987 . ./$at_file || as_fn_error $? "invalid content: $at_file"
990 # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
991 : "${at_top_build_prefix=$at_top_builddir}"
993 # Perform any assignments requested during argument parsing.
994 eval "$at_debug_args"
996 # atconfig delivers names relative to the directory the test suite is
997 # in, but the groups themselves are run in testsuite-dir/group-dir.
998 if test -n "$at_top_srcdir"; then
1000 for at_dir_var in srcdir top_srcdir top_build_prefix
1002 eval at_val=\$at_$at_dir_var
1004 [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1005 *) at_prefix=../../ ;;
1007 eval "$at_dir_var=\$at_prefix\$at_val"
1011 ## -------------------- ##
1012 ## Directory structure. ##
1013 ## -------------------- ##
1015 # This is the set of directories and files used by this script
1016 # (non-literals are capitalized):
1018 # TESTSUITE - the testsuite
1019 # TESTSUITE.log - summarizes the complete testsuite run
1020 # TESTSUITE.dir/ - created during a run, remains after -d or failed test
1021 # + at-groups/ - during a run: status of all groups in run
1022 # | + NNN/ - during a run: meta-data about test group NNN
1023 # | | + check-line - location (source file and line) of current AT_CHECK
1024 # | | + status - exit status of current AT_CHECK
1025 # | | + stdout - stdout of current AT_CHECK
1026 # | | + stder1 - stderr, including trace
1027 # | | + stderr - stderr, with trace filtered out
1028 # | | + test-source - portion of testsuite that defines group
1029 # | | + times - timestamps for computing duration
1030 # | | + pass - created if group passed
1031 # | | + xpass - created if group xpassed
1032 # | | + fail - created if group failed
1033 # | | + xfail - created if group xfailed
1034 # | | + skip - created if group skipped
1035 # + at-stop - during a run: end the run if this file exists
1036 # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1037 # + 0..NNN/ - created for each group NNN, remains after -d or failed test
1038 # | + TESTSUITE.log - summarizes the group results
1039 # | + ... - files created during the group
1041 # The directory the whole suite works in.
1042 # Should be absolute to let the user `cd' at will.
1043 at_suite_dir=$at_dir/$as_me.dir
1044 # The file containing the suite ($at_dir might have changed since earlier).
1045 at_suite_log=$at_dir/$as_me.log
1046 # The directory containing helper files per test group.
1047 at_helper_dir=$at_suite_dir/at-groups
1048 # Stop file: if it exists, do not start new jobs.
1049 at_stop_file=$at_suite_dir/at-stop
1050 # The fifo used for the job dispatcher.
1051 at_job_fifo=$at_suite_dir/at-job-fifo
1054 test -d "$at_suite_dir" &&
1055 find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1056 rm -f -r "$at_suite_dir" "$at_suite_log"
1060 # Don't take risks: use only absolute directories in PATH.
1062 # For stand-alone test suites (ie. atconfig was not found),
1063 # AUTOTEST_PATH is relative to `.'.
1065 # For embedded test suites, AUTOTEST_PATH is relative to the top level
1066 # of the package. Then expand it into build/src parts, since users
1067 # may create executables in both places.
1068 AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1070 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1071 for as_dir in $AUTOTEST_PATH $PATH
1074 test -z "$as_dir" && as_dir=.
1075 test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1078 as_fn_append at_path "$as_dir"
1081 if test -z "$at_top_build_prefix"; then
1082 # Stand-alone test suite.
1083 as_fn_append at_path "$as_dir"
1085 # Embedded test suite.
1086 as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1087 as_fn_append at_path "$at_top_srcdir/$as_dir"
1095 # Now build and simplify PATH.
1097 # There might be directories that don't exist, but don't redirect
1098 # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1100 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1101 for as_dir in $at_path
1104 test -z "$as_dir" && as_dir=.
1105 test -d "$as_dir" || continue
1107 [\\/]* | ?:[\\/]* ) ;;
1108 * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1110 case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1111 *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1112 $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1113 *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1121 # Setting up the FDs.
1125 # 5 is the log file. Not to be overwritten if `-d'.
1126 if $at_debug_p; then
1127 at_suite_log=/dev/null
1131 exec 5>>"$at_suite_log"
1134 $as_echo "## ---------------------------------------------------------- ##
1135 ## dpkg 1.18.25 test suite: dpkg tools functional test suite. ##
1136 ## ---------------------------------------------------------- ##"
1138 $as_echo "## ---------------------------------------------------------- ##
1139 ## dpkg 1.18.25 test suite: dpkg tools functional test suite. ##
1140 ## ---------------------------------------------------------- ##"
1143 $as_echo "$as_me: command line was:"
1144 $as_echo " \$ $0 $at_cli_args"
1147 # If ChangeLog exists, list a few lines in case it might help determining
1148 # the exact version.
1149 if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1150 $as_echo "## ---------- ##
1154 sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1164 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1165 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1166 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1167 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1168 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1170 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1171 /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
1173 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
1174 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
1175 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1176 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
1177 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
1178 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1179 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1183 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1187 test -z "$as_dir" && as_dir=.
1188 $as_echo "PATH: $as_dir"
1195 # Contents of the config files.
1196 for at_file in atconfig atlocal
1198 test -r $at_file || continue
1199 $as_echo "$as_me: $at_file:"
1200 sed 's/^/| /' $at_file
1206 ## ------------------------- ##
1207 ## Autotest shell functions. ##
1208 ## ------------------------- ##
1210 # at_fn_banner NUMBER
1211 # -------------------
1212 # Output banner NUMBER, provided the testsuite is running multiple groups and
1213 # this particular banner has not yet been printed.
1216 $at_print_banners || return 0
1217 eval at_banner_text=\$at_banner_text_$1
1218 test "x$at_banner_text" = "x " && return 0
1219 eval "at_banner_text_$1=\" \""
1220 if test -z "$at_banner_text"; then
1223 $as_echo "$as_nl$at_banner_text$as_nl"
1227 # at_fn_check_prepare_notrace REASON LINE
1228 # ---------------------------------------
1229 # Perform AT_CHECK preparations for the command at LINE for an untraceable
1230 # command; REASON is the reason for disabling tracing.
1231 at_fn_check_prepare_notrace ()
1233 $at_trace_echo "Not enabling shell tracing (command contains $1)"
1234 $as_echo "$2" >"$at_check_line_file"
1235 at_check_trace=: at_check_filter=:
1236 : >"$at_stdout"; : >"$at_stderr"
1239 # at_fn_check_prepare_trace LINE
1240 # ------------------------------
1241 # Perform AT_CHECK preparations for the command at LINE for a traceable
1243 at_fn_check_prepare_trace ()
1245 $as_echo "$1" >"$at_check_line_file"
1246 at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1247 : >"$at_stdout"; : >"$at_stderr"
1250 # at_fn_check_prepare_dynamic COMMAND LINE
1251 # ----------------------------------------
1252 # Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1253 # preparation function.
1254 at_fn_check_prepare_dynamic ()
1258 at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1260 at_fn_check_prepare_trace "$2" ;;
1264 # at_fn_filter_trace
1265 # ------------------
1266 # Remove the lines in the file "$at_stderr" generated by "set -x" and print
1268 at_fn_filter_trace ()
1270 mv "$at_stderr" "$at_stder1"
1271 grep '^ *+' "$at_stder1" >&2
1272 grep -v '^ *+' "$at_stder1" >"$at_stderr"
1275 # at_fn_log_failure FILE-LIST
1276 # ---------------------------
1277 # Copy the files in the list on stdout with a "> " prefix, and exit the shell
1278 # with a failure exit code.
1279 at_fn_log_failure ()
1282 do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1283 echo 1 > "$at_status_file"
1287 # at_fn_check_skip EXIT-CODE LINE
1288 # -------------------------------
1289 # Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1290 # the test group subshell with that same exit code. Use LINE in any report
1291 # about test failure.
1295 99) echo 99 > "$at_status_file"; at_failed=:
1296 $as_echo "$2: hard failure"; exit 99;;
1297 77) echo 77 > "$at_status_file"; exit 77;;
1301 # at_fn_check_status EXPECTED EXIT-CODE LINE
1302 # ------------------------------------------
1303 # Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1304 # Otherwise, if it is 77 or 99, exit the test group subshell with that same
1305 # exit code; if it is anything else print an error message referring to LINE,
1306 # and fail the test.
1307 at_fn_check_status ()
1311 77) echo 77 > "$at_status_file"; exit 77;;
1312 99) echo 99 > "$at_status_file"; at_failed=:
1313 $as_echo "$3: hard failure"; exit 99;;
1314 *) $as_echo "$3: exit code was $2, expected $1"
1319 # at_fn_diff_devnull FILE
1320 # -----------------------
1321 # Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1323 at_fn_diff_devnull ()
1325 test -s "$1" || return 0
1326 $at_diff "$at_devnull" "$1"
1331 # Parse out test NUMBER from the tail of this file.
1334 eval at_sed=\$at_sed$1
1335 sed "$at_sed" "$at_myself" > "$at_test_source"
1338 # at_fn_create_debugging_script
1339 # -----------------------------
1340 # Create the debugging script $at_group_dir/run which will reproduce the
1341 # current test group.
1342 at_fn_create_debugging_script ()
1345 echo "#! /bin/sh" &&
1346 echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1347 $as_echo "cd '$at_dir'" &&
1348 $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1350 } >"$at_group_dir/run" &&
1351 chmod +x "$at_group_dir/run"
1354 ## -------------------------------- ##
1355 ## End of autotest shell functions. ##
1356 ## -------------------------------- ##
1358 $as_echo "## ---------------- ##
1359 ## Tested programs. ##
1360 ## ---------------- ##"
1364 # Report what programs are being tested.
1365 for at_program in : $at_tested
1367 test "$at_program" = : && continue
1369 [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1371 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1375 test -z "$as_dir" && as_dir=.
1376 test -f "$as_dir/$at_program" && break
1380 at_program_=$as_dir/$at_program ;;
1382 if test -f "$at_program_"; then
1384 $as_echo "$at_srcdir/testsuite.at:1: $at_program_ --version"
1385 "$at_program_" --version </dev/null
1389 as_fn_error $? "cannot find $at_program" "$LINENO" 5
1394 $as_echo "## ------------------ ##
1395 ## Running the tests. ##
1396 ## ------------------ ##"
1399 at_start_date=`date`
1400 at_start_time=`date +%s 2>/dev/null`
1401 $as_echo "$as_me: starting at: $at_start_date" >&5
1403 # Create the master directory if it doesn't already exist.
1404 as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1405 as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1407 # Can we diff with `/dev/null'? DU 5.0 refuses.
1408 if diff /dev/null /dev/null >/dev/null 2>&1; then
1409 at_devnull=/dev/null
1411 at_devnull=$at_suite_dir/devnull
1415 # Use `diff -u' when possible.
1416 if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1423 # Get the last needed group.
1424 for at_group in : $at_groups; do :; done
1426 # Extract the start and end lines of each test group at the tail
1434 test = substr ($ 0, 10)
1435 print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1436 if (test == "'"$at_group"'") exit
1437 }' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1438 . "$at_suite_dir/at-source-lines" ||
1439 as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1440 rm -f "$at_suite_dir/at-source-lines"
1442 # Set number of jobs for `-j'; avoid more jobs than test groups.
1443 set X $at_groups; shift; at_max_jobs=$#
1444 if test $at_max_jobs -eq 0; then
1447 if test $at_jobs -ne 1 &&
1448 { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1449 at_jobs=$at_max_jobs
1452 # If parallel mode, don't output banners, don't split summary lines.
1453 if test $at_jobs -ne 1; then
1454 at_print_banners=false
1458 # Set up helper dirs.
1459 rm -rf "$at_helper_dir" &&
1460 mkdir "$at_helper_dir" &&
1461 cd "$at_helper_dir" &&
1462 { test -z "$at_groups" || mkdir $at_groups; } ||
1463 as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1465 # Functions for running a test group. We leave the actual
1466 # test group execution outside of a shell function in order
1467 # to avoid hitting zsh 4.x exit status bugs.
1469 # at_fn_group_prepare
1470 # -------------------
1471 # Prepare for running a test group.
1472 at_fn_group_prepare ()
1474 # The directory for additional per-group helper files.
1475 at_job_dir=$at_helper_dir/$at_group
1476 # The file containing the location of the last AT_CHECK.
1477 at_check_line_file=$at_job_dir/check-line
1478 # The file containing the exit status of the last command.
1479 at_status_file=$at_job_dir/status
1480 # The files containing the output of the tested commands.
1481 at_stdout=$at_job_dir/stdout
1482 at_stder1=$at_job_dir/stder1
1483 at_stderr=$at_job_dir/stderr
1484 # The file containing the code for a test group.
1485 at_test_source=$at_job_dir/test-source
1486 # The file containing dates.
1487 at_times_file=$at_job_dir/times
1489 # Be sure to come back to the top test directory.
1492 # Clearly separate the test groups when verbose.
1493 $at_first || $at_verbose echo
1495 at_group_normalized=$at_group
1498 case $at_group_normalized in #(
1499 '"$at_format"'*) break;;
1501 at_group_normalized=0$at_group_normalized
1505 # Create a fresh directory for the next test group, and enter.
1506 # If one already exists, the user may have invoked ./run from
1507 # within that directory; we remove the contents, but not the
1508 # directory itself, so that we aren't pulling the rug out from
1509 # under the shell's notion of the current directory.
1510 at_group_dir=$at_suite_dir/$at_group_normalized
1511 at_group_log=$at_group_dir/$as_me.log
1512 if test -d "$at_group_dir"; then
1513 find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1514 rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1516 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1517 $as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1518 # Be tolerant if the above `rm' was not able to remove the directory.
1519 as_dir="$at_group_dir"; as_fn_mkdir_p
1521 echo 0 > "$at_status_file"
1523 # In verbose mode, append to the log file *and* show on
1524 # the standard output; in quiet mode only write to the log.
1525 if test -z "$at_verbose"; then
1526 at_tee_pipe='tee -a "$at_group_log"'
1528 at_tee_pipe='cat >> "$at_group_log"'
1532 # at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1533 # -------------------------------------------------
1534 # Declare the test group ORDINAL, located at LINE with group description DESC,
1535 # and residing under BANNER. Use PAD to align the status column.
1536 at_fn_group_banner ()
1539 test -n "$5" && at_fn_banner $5
1542 [0-9]) at_desc_line=" $1: ";;
1543 [0-9][0-9]) at_desc_line=" $1: " ;;
1544 *) at_desc_line="$1: " ;;
1546 as_fn_append at_desc_line "$3$4"
1547 $at_quiet $as_echo_n "$at_desc_line"
1548 echo "# -*- compilation -*-" >> "$at_group_log"
1551 # at_fn_group_postprocess
1552 # -----------------------
1553 # Perform cleanup after running a test group.
1554 at_fn_group_postprocess ()
1556 # Be sure to come back to the suite directory, in particular
1557 # since below we might `rm' the group directory we are in currently.
1560 if test ! -f "$at_check_line_file"; then
1561 sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1562 A failure happened in a test group before any test could be
1563 run. This means that test suite is improperly designed. Please
1564 report this failure to <debian-dpkg@lists.debian.org>.
1566 $as_echo "$at_setup_line" >"$at_check_line_file"
1569 $at_verbose $as_echo_n "$at_group. $at_setup_line: "
1570 $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
1571 case $at_xfail:$at_status in
1573 at_msg="UNEXPECTED PASS"
1575 at_errexit=$at_errexit_p
1585 at_msg='skipped ('`cat "$at_check_line_file"`')'
1591 at_msg='FAILED ('`cat "$at_check_line_file"`')'
1593 at_errexit=$at_errexit_p
1597 at_msg='expected failure ('`cat "$at_check_line_file"`')'
1603 echo "$at_res" > "$at_job_dir/$at_res"
1604 # In parallel mode, output the summary line only afterwards.
1605 if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1606 $as_echo "$at_desc_line $at_color$at_msg$at_std"
1608 # Make sure there is a separator even with long titles.
1609 $as_echo " $at_color$at_msg$at_std"
1611 at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1614 # $at_times_file is only available if the group succeeded.
1615 # We're not including the group log, so the success message
1616 # is written in the global log separately. But we also
1617 # write to the group log in case they're using -d.
1618 if test -f "$at_times_file"; then
1619 at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')'
1620 rm -f "$at_times_file"
1622 $as_echo "$at_log_msg" >> "$at_group_log"
1623 $as_echo "$at_log_msg" >&5
1625 # Cleanup the group directory, unless the user wants the files
1626 # or the success was unexpected.
1627 if $at_debug_p || test $at_res = xpass; then
1628 at_fn_create_debugging_script
1629 if test $at_res = xpass && $at_errexit; then
1630 echo stop > "$at_stop_file"
1633 if test -d "$at_group_dir"; then
1634 find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1635 rm -fr "$at_group_dir"
1637 rm -f "$at_test_source"
1641 # Upon failure, include the log into the testsuite's global
1642 # log. The failure message is written in the group log. It
1643 # is later included in the global log.
1644 $as_echo "$at_log_msg" >> "$at_group_log"
1646 # Upon failure, keep the group directory for autopsy, and create
1647 # the debugging script. With -e, do not start any further tests.
1648 at_fn_create_debugging_script
1649 if $at_errexit; then
1650 echo stop > "$at_stop_file"
1662 if (set -m && set +m && set +b) >/dev/null 2>&1; then
1664 at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1666 at_job_control_on=: at_job_control_off=: at_job_group=
1669 for at_signal in 1 2 15; do
1670 trap 'set +x; set +e
1672 at_signal='"$at_signal"'
1673 echo stop > "$at_stop_file"
1676 for at_pgid in `jobs -p 2>/dev/null`; do
1677 at_pgids="$at_pgids $at_job_group$at_pgid"
1679 test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1681 if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1684 at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1686 test 1 -gt 2 && at_signame=$at_signal
1687 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1688 $as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1689 as_fn_arith 128 + $at_signal && exit_status=$as_val
1690 as_fn_exit $exit_status' $at_signal
1693 rm -f "$at_stop_file"
1696 if test $at_jobs -ne 1 &&
1697 rm -f "$at_job_fifo" &&
1698 test -n "$at_job_group" &&
1699 ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1701 # FIFO job dispatcher.
1704 for at_pid in `jobs -p`; do
1705 at_pids="$at_pids $at_job_group$at_pid"
1707 if test -n "$at_pids"; then
1709 test "${TMOUT+set}" = set && at_sig=STOP
1710 kill -$at_sig $at_pids 2>/dev/null
1713 test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1716 # Turn jobs into a list of numbers, starting from 1.
1717 at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
1721 for at_group in $at_groups; do
1722 $at_job_control_on 2>/dev/null
1724 # Start one test group.
1727 exec 7>"$at_job_fifo"
1731 trap 'set +x; set +e
1733 echo stop > "$at_stop_file"
1735 as_fn_exit 141' PIPE
1737 if cd "$at_group_dir" &&
1738 at_fn_test $at_group &&
1741 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1742 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1745 at_fn_group_postprocess
1751 exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1753 shift # Consume one token.
1754 if test $# -gt 0; then :; else
1755 read at_token <&6 || break
1758 test -f "$at_stop_file" && break
1761 # Read back the remaining ($at_jobs - 1) tokens.
1764 if test $# -gt 0; then
1774 # Run serially, avoid forks and other potential surprises.
1775 for at_group in $at_groups; do
1777 if cd "$at_group_dir" &&
1778 at_fn_test $at_group &&
1779 . "$at_test_source"; then :; else
1780 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1781 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1784 at_fn_group_postprocess
1785 test -f "$at_stop_file" && break
1790 # Wrap up the test suite with summary statistics.
1793 # Use ?..???? when the list must remain sorted, the faster * otherwise.
1794 at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1795 at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1796 at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1797 at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1798 echo $f; done | sed '/?/d; s,/xpass,,'`
1799 at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1800 echo $f; done | sed '/?/d; s,/fail,,'`
1802 set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1803 shift; at_group_count=$#
1804 set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1805 set X $at_xfail_list; shift; at_xfail_count=$#
1806 set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1807 set X $at_skip_list; shift; at_skip_count=$#
1809 as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1810 as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1811 as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1813 # Back to the top directory.
1815 rm -rf "$at_helper_dir"
1817 # Compute the duration of the suite.
1819 at_stop_time=`date +%s 2>/dev/null`
1820 $as_echo "$as_me: ending at: $at_stop_date" >&5
1821 case $at_start_time,$at_stop_time in
1823 as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1824 as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1825 as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1826 as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1827 as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1828 at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1829 $as_echo "$as_me: test suite duration: $at_duration" >&5
1834 $as_echo "## ------------- ##
1836 ## ------------- ##"
1840 $as_echo "## ------------- ##
1842 ## ------------- ##"
1846 if test $at_run_count = 1; then
1850 at_result="$at_run_count tests"
1853 if $at_errexit_p && test $at_unexpected_count != 0; then
1854 if test $at_xpass_count = 1; then
1855 at_result="$at_result $at_were run, one passed"
1857 at_result="$at_result $at_were run, one failed"
1859 at_result="$at_result unexpectedly and inhibited subsequent tests."
1862 # Don't you just love exponential explosion of the number of cases?
1864 case $at_xpass_count:$at_fail_count:$at_xfail_count in
1866 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1867 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1869 # Some unexpected failures
1870 0:*:0) at_result="$at_result $at_were run,
1871 $at_fail_count failed unexpectedly." ;;
1873 # Some failures, both expected and unexpected
1874 0:*:1) at_result="$at_result $at_were run,
1875 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1876 0:*:*) at_result="$at_result $at_were run,
1877 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1879 # No unexpected failures, but some xpasses
1880 *:0:*) at_result="$at_result $at_were run,
1881 $at_xpass_count passed unexpectedly." ;;
1883 # No expected failures, but failures and xpasses
1884 *:1:0) at_result="$at_result $at_were run,
1885 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1886 *:*:0) at_result="$at_result $at_were run,
1887 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1890 *:*:1) at_result="$at_result $at_were run,
1891 $at_xpass_count passed unexpectedly,
1892 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1893 *:*:*) at_result="$at_result $at_were run,
1894 $at_xpass_count passed unexpectedly,
1895 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1898 if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1899 at_result="All $at_result"
1903 # Now put skips in the mix.
1904 case $at_skip_count in
1906 1) at_result="$at_result
1907 1 test was skipped." ;;
1908 *) at_result="$at_result
1909 $at_skip_count tests were skipped." ;;
1912 if test $at_unexpected_count = 0; then
1913 echo "$at_color$at_result$at_std"
1914 echo "$at_result" >&5
1916 echo "${at_color}ERROR: $at_result$at_std" >&2
1917 echo "ERROR: $at_result" >&5
1920 $as_echo "## ------------------------ ##
1921 ## Summary of the failures. ##
1922 ## ------------------------ ##"
1924 # Summary of failed and skipped tests.
1925 if test $at_fail_count != 0; then
1926 echo "Failed tests:"
1927 $SHELL "$at_myself" $at_fail_list --list
1930 if test $at_skip_count != 0; then
1931 echo "Skipped tests:"
1932 $SHELL "$at_myself" $at_skip_list --list
1935 if test $at_xpass_count != 0; then
1936 echo "Unexpected passes:"
1937 $SHELL "$at_myself" $at_xpass_list --list
1940 if test $at_fail_count != 0; then
1941 $as_echo "## ---------------------- ##
1942 ## Detailed failed tests. ##
1943 ## ---------------------- ##"
1945 for at_group in $at_fail_list
1947 at_group_normalized=$at_group
1950 case $at_group_normalized in #(
1951 '"$at_format"'*) break;;
1953 at_group_normalized=0$at_group_normalized
1956 cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1961 if test -n "$at_top_srcdir"; then
1962 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1963 ## ${at_top_build_prefix}config.log ##
1965 sed 's/^/| /' ${at_top_build_prefix}config.log
1970 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1971 ## $as_me.log was created. ##
1975 if $at_debug_p; then
1976 at_msg='per-test log files'
1978 at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
1980 $as_echo "Please send $at_msg and all information you think might help:
1982 To: <debian-dpkg@lists.debian.org>
1983 Subject: [dpkg 1.18.25] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
1985 You may investigate any problem if you feel able to do so, in which
1986 case the test suite provides a good starting point. Its output may
1987 be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
1998 at_fn_group_banner 1 'deb-format.at:3' \
1999 "dpkg-deb options" " " 1
2002 $as_echo "1. $at_setup_line: testing $at_desc ..."
2007 $as_echo "$at_srcdir/deb-format.at:5: dpkg-deb --help"
2008 at_fn_check_prepare_trace "deb-format.at:5"
2009 ( $at_check_trace; dpkg-deb --help
2010 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2011 at_status=$? at_failed=false
2013 at_fn_diff_devnull "$at_stderr" || at_failed=:
2014 echo stdout:; cat "$at_stdout"
2015 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:5"
2016 $at_failed && at_fn_log_failure
2020 $at_times_p && times >"$at_times_file"
2021 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2022 read at_status <"$at_status_file"
2025 at_fn_group_banner 2 'deb-format.at:8' \
2026 "dpkg-deb .deb format" " " 1
2029 $as_echo "2. $at_setup_line: testing $at_desc ..."
2035 mkdir -p 'pkg-deb-format/DEBIAN'
2037 cat >'pkg-deb-format/DEBIAN/control' <<CTRL_TEMPL
2038 Package: pkg-deb-format
2042 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2044 Description: test package
2048 sed -i -e 's/^Description:.*$/& - deb format support/' 'pkg-deb-format/DEBIAN/control'
2050 cat >pkg-deb-format/file-templ <<'_ATEOF'
2055 $as_echo "$at_srcdir/deb-format.at:16:
2056 # Initialize the template package
2057 mv pkg-deb-format pkg-templ
2058 chmod -R u+w pkg-templ
2059 find pkg-templ | xargs touch -t 197001010100.00
2060 \$ASROOT dpkg-deb --uniform-compression -Znone -b pkg-templ >/dev/null
2062 # Extract the base members
2064 gzip -c control.tar >control.tar.gz
2065 gzip -c data.tar >data.tar.gz
2066 xz -c control.tar >control.tar.xz
2067 xz -c data.tar >data.tar.xz
2068 bzip2 -c data.tar >data.tar.bz2
2069 lzma -c data.tar >data.tar.lzma
2073 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:16"
2075 # Initialize the template package
2076 mv pkg-deb-format pkg-templ
2077 chmod -R u+w pkg-templ
2078 find pkg-templ | xargs touch -t 197001010100.00
2079 $ASROOT dpkg-deb --uniform-compression -Znone -b pkg-templ >/dev/null
2081 # Extract the base members
2083 gzip -c control.tar >control.tar.gz
2084 gzip -c data.tar >data.tar.gz
2085 xz -c control.tar >control.tar.xz
2086 xz -c data.tar >data.tar.xz
2087 bzip2 -c data.tar >data.tar.bz2
2088 lzma -c data.tar >data.tar.lzma
2092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2093 at_status=$? at_failed=false
2095 at_fn_diff_devnull "$at_stderr" || at_failed=:
2096 at_fn_diff_devnull "$at_stdout" || at_failed=:
2097 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:16"
2098 $at_failed && at_fn_log_failure
2103 $as_echo "$at_srcdir/deb-format.at:35:
2104 # Test debian-binary with 2.x versions
2105 cp pkg-templ.deb pkg-version-2x.deb
2106 echo 2.999 >debian-binary
2107 ar rc pkg-version-2x.deb debian-binary
2108 ar t pkg-version-2x.deb
2109 ar x pkg-templ.deb debian-binary
2110 # XXX: Ideally we would have no need to strip trailing spaces.
2111 dpkg-deb -I pkg-version-2x.deb | sed -e 's/ *\$//'
2113 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:35"
2115 # Test debian-binary with 2.x versions
2116 cp pkg-templ.deb pkg-version-2x.deb
2117 echo 2.999 >debian-binary
2118 ar rc pkg-version-2x.deb debian-binary
2119 ar t pkg-version-2x.deb
2120 ar x pkg-templ.deb debian-binary
2121 # XXX: Ideally we would have no need to strip trailing spaces.
2122 dpkg-deb -I pkg-version-2x.deb | sed -e 's/ *$//'
2124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2125 at_status=$? at_failed=false
2127 at_fn_diff_devnull "$at_stderr" || at_failed=:
2128 echo >>"$at_stdout"; $as_echo "debian-binary
2131 new debian package, version 2.999.
2132 size 20674 bytes: control archive=10240 bytes.
2133 193 bytes, 7 lines control
2134 Package: pkg-deb-format
2138 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2140 Description: test package - deb format support
2142 $at_diff - "$at_stdout" || at_failed=:
2143 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:35"
2144 $at_failed && at_fn_log_failure
2149 $as_echo "$at_srcdir/deb-format.at:59:
2150 # Test debian-binary with extra lines
2151 cp pkg-templ.deb pkg-magic-extra.deb
2152 echo \"extra line\" >>debian-binary
2153 ar rc pkg-magic-extra.deb debian-binary
2154 ar t pkg-magic-extra.deb
2155 ar x pkg-templ.deb debian-binary
2156 # XXX: Ideally we would have no need to strip trailing spaces.
2157 dpkg-deb -I pkg-magic-extra.deb | sed -e 's/ *\$//'
2159 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:59"
2161 # Test debian-binary with extra lines
2162 cp pkg-templ.deb pkg-magic-extra.deb
2163 echo "extra line" >>debian-binary
2164 ar rc pkg-magic-extra.deb debian-binary
2165 ar t pkg-magic-extra.deb
2166 ar x pkg-templ.deb debian-binary
2167 # XXX: Ideally we would have no need to strip trailing spaces.
2168 dpkg-deb -I pkg-magic-extra.deb | sed -e 's/ *$//'
2170 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2171 at_status=$? at_failed=false
2173 at_fn_diff_devnull "$at_stderr" || at_failed=:
2174 echo >>"$at_stdout"; $as_echo "debian-binary
2177 new debian package, version 2.0.
2178 size 20684 bytes: control archive=10240 bytes.
2179 193 bytes, 7 lines control
2180 Package: pkg-deb-format
2184 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2186 Description: test package - deb format support
2188 $at_diff - "$at_stdout" || at_failed=:
2189 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:59"
2190 $at_failed && at_fn_log_failure
2195 $as_echo "$at_srcdir/deb-format.at:83:
2196 # Test missing debian-binary member
2197 cp pkg-templ.deb pkg-missing-magic.deb
2198 ar d pkg-missing-magic.deb debian-binary
2199 ar t pkg-missing-magic.deb
2200 dpkg-deb -I pkg-missing-magic.deb
2202 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:83"
2204 # Test missing debian-binary member
2205 cp pkg-templ.deb pkg-missing-magic.deb
2206 ar d pkg-missing-magic.deb debian-binary
2207 ar t pkg-missing-magic.deb
2208 dpkg-deb -I pkg-missing-magic.deb
2210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2211 at_status=$? at_failed=false
2213 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: file 'pkg-missing-magic.deb' is not a debian binary archive (try dpkg-split?)
2215 $at_diff - "$at_stderr" || at_failed=:
2216 echo >>"$at_stdout"; $as_echo "control.tar
2219 $at_diff - "$at_stdout" || at_failed=:
2220 at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:83"
2221 $at_failed && at_fn_log_failure
2226 $as_echo "$at_srcdir/deb-format.at:94:
2227 # Test missing control member
2228 cp pkg-templ.deb pkg-missing-control.deb
2229 ar d pkg-missing-control.deb control.tar
2230 ar t pkg-missing-control.deb
2231 dpkg-deb -I pkg-missing-control.deb
2233 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:94"
2235 # Test missing control member
2236 cp pkg-templ.deb pkg-missing-control.deb
2237 ar d pkg-missing-control.deb control.tar
2238 ar t pkg-missing-control.deb
2239 dpkg-deb -I pkg-missing-control.deb
2241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2242 at_status=$? at_failed=false
2244 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-missing-control.deb' has premature member 'data.tar' before 'control.tar', giving up
2246 $at_diff - "$at_stderr" || at_failed=:
2247 echo >>"$at_stdout"; $as_echo "debian-binary
2250 $at_diff - "$at_stdout" || at_failed=:
2251 at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:94"
2252 $at_failed && at_fn_log_failure
2257 $as_echo "$at_srcdir/deb-format.at:105:
2258 # Test missing data member
2259 cp pkg-templ.deb pkg-missing-data.deb
2260 ar d pkg-missing-data.deb data.tar
2261 ar t pkg-missing-data.deb
2262 dpkg-deb -c pkg-missing-data.deb
2264 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:105"
2266 # Test missing data member
2267 cp pkg-templ.deb pkg-missing-data.deb
2268 ar d pkg-missing-data.deb data.tar
2269 ar t pkg-missing-data.deb
2270 dpkg-deb -c pkg-missing-data.deb
2272 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2273 at_status=$? at_failed=false
2275 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: unexpected end of file in archive member header in pkg-missing-data.deb
2277 $at_diff - "$at_stderr" || at_failed=:
2278 echo >>"$at_stdout"; $as_echo "debian-binary
2281 $at_diff - "$at_stdout" || at_failed=:
2282 at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:105"
2283 $at_failed && at_fn_log_failure
2288 $as_echo "$at_srcdir/deb-format.at:116:
2289 # Test mixed member (index 1)
2290 cp pkg-templ.deb pkg-mixed-1-member.deb
2291 ar ra debian-binary pkg-mixed-1-member.deb unknown
2292 ar t pkg-mixed-1-member.deb
2293 dpkg-deb -I pkg-mixed-1-member.deb
2295 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:116"
2297 # Test mixed member (index 1)
2298 cp pkg-templ.deb pkg-mixed-1-member.deb
2299 ar ra debian-binary pkg-mixed-1-member.deb unknown
2300 ar t pkg-mixed-1-member.deb
2301 dpkg-deb -I pkg-mixed-1-member.deb
2303 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2304 at_status=$? at_failed=false
2306 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-mixed-1-member.deb' has premature member 'unknown' before 'control.tar', giving up
2308 $at_diff - "$at_stderr" || at_failed=:
2309 echo >>"$at_stdout"; $as_echo "debian-binary
2314 $at_diff - "$at_stdout" || at_failed=:
2315 at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:116"
2316 $at_failed && at_fn_log_failure
2321 $as_echo "$at_srcdir/deb-format.at:129:
2322 # Test mixed member (index 2)
2323 cp pkg-templ.deb pkg-mixed-2-member.deb
2324 ar ra control.tar pkg-mixed-2-member.deb unknown
2325 ar t pkg-mixed-2-member.deb
2326 dpkg-deb -c pkg-mixed-2-member.deb
2328 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:129"
2330 # Test mixed member (index 2)
2331 cp pkg-templ.deb pkg-mixed-2-member.deb
2332 ar ra control.tar pkg-mixed-2-member.deb unknown
2333 ar t pkg-mixed-2-member.deb
2334 dpkg-deb -c pkg-mixed-2-member.deb
2336 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2337 at_status=$? at_failed=false
2339 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-mixed-2-member.deb' has premature member 'unknown' before 'data.tar', giving up
2341 $at_diff - "$at_stderr" || at_failed=:
2342 echo >>"$at_stdout"; $as_echo "debian-binary
2347 $at_diff - "$at_stdout" || at_failed=:
2348 at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:129"
2349 $at_failed && at_fn_log_failure
2354 $as_echo "$at_srcdir/deb-format.at:142:
2355 # Test swapped control and data members
2356 cp pkg-templ.deb pkg-swap-members.deb
2357 ar ma data.tar pkg-swap-members.deb control.tar
2358 ar t pkg-swap-members.deb
2359 dpkg-deb -I pkg-swap-members.deb
2361 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:142"
2363 # Test swapped control and data members
2364 cp pkg-templ.deb pkg-swap-members.deb
2365 ar ma data.tar pkg-swap-members.deb control.tar
2366 ar t pkg-swap-members.deb
2367 dpkg-deb -I pkg-swap-members.deb
2369 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2370 at_status=$? at_failed=false
2372 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-swap-members.deb' has premature member 'data.tar' before 'control.tar', giving up
2374 $at_diff - "$at_stderr" || at_failed=:
2375 echo >>"$at_stdout"; $as_echo "debian-binary
2379 $at_diff - "$at_stdout" || at_failed=:
2380 at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:142"
2381 $at_failed && at_fn_log_failure
2386 $as_echo "$at_srcdir/deb-format.at:154:
2388 cp pkg-templ.deb pkg-extra-member.deb
2389 ar q pkg-extra-member.deb unknown
2390 ar t pkg-extra-member.deb
2391 # XXX: Ideally we would have no need to strip trailing spaces.
2392 dpkg-deb -I pkg-extra-member.deb | sed -e 's/ *\$//'
2394 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:154"
2397 cp pkg-templ.deb pkg-extra-member.deb
2398 ar q pkg-extra-member.deb unknown
2399 ar t pkg-extra-member.deb
2400 # XXX: Ideally we would have no need to strip trailing spaces.
2401 dpkg-deb -I pkg-extra-member.deb | sed -e 's/ *$//'
2403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2404 at_status=$? at_failed=false
2406 at_fn_diff_devnull "$at_stderr" || at_failed=:
2407 echo >>"$at_stdout"; $as_echo "debian-binary
2411 new debian package, version 2.0.
2412 size 20732 bytes: control archive=10240 bytes.
2413 193 bytes, 7 lines control
2414 Package: pkg-deb-format
2418 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2420 Description: test package - deb format support
2422 $at_diff - "$at_stdout" || at_failed=:
2423 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:154"
2424 $at_failed && at_fn_log_failure
2429 $as_echo "$at_srcdir/deb-format.at:177:
2431 cp pkg-templ.deb pkg-under-member.deb
2432 ar ra debian-binary pkg-under-member.deb _ignore
2433 ar t pkg-under-member.deb
2434 # XXX: Ideally we would have no need to strip trailing spaces.
2435 dpkg-deb -I pkg-under-member.deb | sed -e 's/ *\$//'
2437 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:177"
2440 cp pkg-templ.deb pkg-under-member.deb
2441 ar ra debian-binary pkg-under-member.deb _ignore
2442 ar t pkg-under-member.deb
2443 # XXX: Ideally we would have no need to strip trailing spaces.
2444 dpkg-deb -I pkg-under-member.deb | sed -e 's/ *$//'
2446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2447 at_status=$? at_failed=false
2449 at_fn_diff_devnull "$at_stderr" || at_failed=:
2450 echo >>"$at_stdout"; $as_echo "debian-binary
2454 new debian package, version 2.0.
2455 size 20732 bytes: control archive=10240 bytes.
2456 193 bytes, 7 lines control
2457 Package: pkg-deb-format
2461 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2463 Description: test package - deb format support
2465 $at_diff - "$at_stdout" || at_failed=:
2466 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:177"
2467 $at_failed && at_fn_log_failure
2472 $as_echo "$at_srcdir/deb-format.at:200:
2473 # Test data.tar.bad member
2474 dd if=/dev/zero of=data.tar.bad bs=1K count=4 status=none
2475 ar rc pkg-data-bad.deb debian-binary control.tar.gz data.tar.bad
2476 ar t pkg-data-bad.deb
2477 dpkg-deb -c pkg-data-bad.deb
2479 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:200"
2481 # Test data.tar.bad member
2482 dd if=/dev/zero of=data.tar.bad bs=1K count=4 status=none
2483 ar rc pkg-data-bad.deb debian-binary control.tar.gz data.tar.bad
2484 ar t pkg-data-bad.deb
2485 dpkg-deb -c pkg-data-bad.deb
2487 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2488 at_status=$? at_failed=false
2490 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-data-bad.deb' uses unknown compression for member 'data.tar.bad', giving up
2492 $at_diff - "$at_stderr" || at_failed=:
2493 echo >>"$at_stdout"; $as_echo "debian-binary
2497 $at_diff - "$at_stdout" || at_failed=:
2498 at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:200"
2499 $at_failed && at_fn_log_failure
2504 $as_echo "$at_srcdir/deb-format.at:212:
2505 # Test control.tar member
2506 ar rc pkg-control-none.deb debian-binary control.tar data.tar
2507 ar t pkg-control-none.deb
2508 # XXX: Ideally we would have no need to strip trailing spaces.
2509 dpkg-deb -I pkg-control-none.deb | sed -e 's/ *\$//'
2511 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:212"
2513 # Test control.tar member
2514 ar rc pkg-control-none.deb debian-binary control.tar data.tar
2515 ar t pkg-control-none.deb
2516 # XXX: Ideally we would have no need to strip trailing spaces.
2517 dpkg-deb -I pkg-control-none.deb | sed -e 's/ *$//'
2519 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2520 at_status=$? at_failed=false
2522 at_fn_diff_devnull "$at_stderr" || at_failed=:
2523 echo >>"$at_stdout"; $as_echo "debian-binary
2526 new debian package, version 2.0.
2527 size 20672 bytes: control archive=10240 bytes.
2528 193 bytes, 7 lines control
2529 Package: pkg-deb-format
2533 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2535 Description: test package - deb format support
2537 $at_diff - "$at_stdout" || at_failed=:
2538 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:212"
2539 $at_failed && at_fn_log_failure
2544 $as_echo "$at_srcdir/deb-format.at:233:
2545 # Test control.tar.xz member
2546 ar rc pkg-control-xz.deb debian-binary control.tar.xz data.tar.xz
2547 ar t pkg-control-xz.deb
2548 dpkg-deb -c pkg-control-xz.deb
2550 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:233"
2552 # Test control.tar.xz member
2553 ar rc pkg-control-xz.deb debian-binary control.tar.xz data.tar.xz
2554 ar t pkg-control-xz.deb
2555 dpkg-deb -c pkg-control-xz.deb
2557 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2558 at_status=$? at_failed=false
2560 at_fn_diff_devnull "$at_stderr" || at_failed=:
2561 echo >>"$at_stdout"; $as_echo "debian-binary
2564 drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2565 -rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2567 $at_diff - "$at_stdout" || at_failed=:
2568 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:233"
2569 $at_failed && at_fn_log_failure
2574 $as_echo "$at_srcdir/deb-format.at:245:
2575 # Test data.tar member
2576 ar rc pkg-data-none.deb debian-binary control.tar.gz data.tar
2577 ar t pkg-data-none.deb
2578 dpkg-deb -c pkg-data-none.deb
2580 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:245"
2582 # Test data.tar member
2583 ar rc pkg-data-none.deb debian-binary control.tar.gz data.tar
2584 ar t pkg-data-none.deb
2585 dpkg-deb -c pkg-data-none.deb
2587 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2588 at_status=$? at_failed=false
2590 at_fn_diff_devnull "$at_stderr" || at_failed=:
2591 echo >>"$at_stdout"; $as_echo "debian-binary
2594 drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2595 -rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2597 $at_diff - "$at_stdout" || at_failed=:
2598 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:245"
2599 $at_failed && at_fn_log_failure
2604 $as_echo "$at_srcdir/deb-format.at:257:
2605 # Test data.tar.gz member
2606 ar rc pkg-data-gz.deb debian-binary control.tar.gz data.tar.gz
2607 ar t pkg-data-gz.deb
2608 dpkg-deb -c pkg-data-gz.deb
2610 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:257"
2612 # Test data.tar.gz member
2613 ar rc pkg-data-gz.deb debian-binary control.tar.gz data.tar.gz
2614 ar t pkg-data-gz.deb
2615 dpkg-deb -c pkg-data-gz.deb
2617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2618 at_status=$? at_failed=false
2620 at_fn_diff_devnull "$at_stderr" || at_failed=:
2621 echo >>"$at_stdout"; $as_echo "debian-binary
2624 drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2625 -rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2627 $at_diff - "$at_stdout" || at_failed=:
2628 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:257"
2629 $at_failed && at_fn_log_failure
2634 $as_echo "$at_srcdir/deb-format.at:269:
2635 # Test data.tar.xz member
2636 ar rc pkg-data-xz.deb debian-binary control.tar.gz data.tar.xz
2637 ar t pkg-data-xz.deb
2638 dpkg-deb -c pkg-data-xz.deb
2640 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:269"
2642 # Test data.tar.xz member
2643 ar rc pkg-data-xz.deb debian-binary control.tar.gz data.tar.xz
2644 ar t pkg-data-xz.deb
2645 dpkg-deb -c pkg-data-xz.deb
2647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2648 at_status=$? at_failed=false
2650 at_fn_diff_devnull "$at_stderr" || at_failed=:
2651 echo >>"$at_stdout"; $as_echo "debian-binary
2654 drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2655 -rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2657 $at_diff - "$at_stdout" || at_failed=:
2658 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:269"
2659 $at_failed && at_fn_log_failure
2664 $as_echo "$at_srcdir/deb-format.at:281:
2665 # Test data.tar.bz2 member
2666 ar rc pkg-data-bz2.deb debian-binary control.tar.gz data.tar.bz2
2667 ar t pkg-data-bz2.deb
2668 dpkg-deb -c pkg-data-bz2.deb
2670 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:281"
2672 # Test data.tar.bz2 member
2673 ar rc pkg-data-bz2.deb debian-binary control.tar.gz data.tar.bz2
2674 ar t pkg-data-bz2.deb
2675 dpkg-deb -c pkg-data-bz2.deb
2677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2678 at_status=$? at_failed=false
2680 at_fn_diff_devnull "$at_stderr" || at_failed=:
2681 echo >>"$at_stdout"; $as_echo "debian-binary
2684 drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2685 -rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2687 $at_diff - "$at_stdout" || at_failed=:
2688 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:281"
2689 $at_failed && at_fn_log_failure
2694 $as_echo "$at_srcdir/deb-format.at:293:
2695 # Test data.tar.lzma member
2696 ar rc pkg-data-lzma.deb debian-binary control.tar.gz data.tar.lzma
2697 ar t pkg-data-lzma.deb
2698 dpkg-deb -c pkg-data-lzma.deb
2700 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:293"
2702 # Test data.tar.lzma member
2703 ar rc pkg-data-lzma.deb debian-binary control.tar.gz data.tar.lzma
2704 ar t pkg-data-lzma.deb
2705 dpkg-deb -c pkg-data-lzma.deb
2707 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2708 at_status=$? at_failed=false
2710 at_fn_diff_devnull "$at_stderr" || at_failed=:
2711 echo >>"$at_stdout"; $as_echo "debian-binary
2714 drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2715 -rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2717 $at_diff - "$at_stdout" || at_failed=:
2718 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:293"
2719 $at_failed && at_fn_log_failure
2724 $as_echo "$at_srcdir/deb-format.at:305:
2725 # Test non-uniform data.tar/control.tar member compression
2726 ar rc pkg-mixed-comp.deb debian-binary control.tar.xz data.tar.gz
2727 ar t pkg-mixed-comp.deb
2728 # XXX: Ideally we would have no need to strip trailing spaces.
2729 dpkg-deb -I pkg-mixed-comp.deb | sed -e 's/ *\$//'
2730 dpkg-deb -c pkg-mixed-comp.deb
2732 at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:305"
2734 # Test non-uniform data.tar/control.tar member compression
2735 ar rc pkg-mixed-comp.deb debian-binary control.tar.xz data.tar.gz
2736 ar t pkg-mixed-comp.deb
2737 # XXX: Ideally we would have no need to strip trailing spaces.
2738 dpkg-deb -I pkg-mixed-comp.deb | sed -e 's/ *$//'
2739 dpkg-deb -c pkg-mixed-comp.deb
2741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2742 at_status=$? at_failed=false
2744 at_fn_diff_devnull "$at_stderr" || at_failed=:
2745 echo >>"$at_stdout"; $as_echo "debian-binary
2748 new debian package, version 2.0.
2749 size 682 bytes: control archive=336 bytes.
2750 193 bytes, 7 lines control
2751 Package: pkg-deb-format
2755 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2757 Description: test package - deb format support
2758 drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2759 -rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2761 $at_diff - "$at_stdout" || at_failed=:
2762 at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:305"
2763 $at_failed && at_fn_log_failure
2768 $at_times_p && times >"$at_times_file"
2769 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2770 read at_status <"$at_status_file"
2773 at_fn_group_banner 3 'deb-content.at:3' \
2774 "dpkg-deb .deb conffiles" " " 1
2777 $as_echo "3. $at_setup_line: testing $at_desc ..."
2783 mkdir -p 'pkg-conff-dupe/DEBIAN'
2785 cat >'pkg-conff-dupe/DEBIAN/control' <<CTRL_TEMPL
2786 Package: pkg-conff-dupe
2790 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2792 Description: test package
2796 mkdir -p 'pkg-conff-dupe/DEBIAN'
2798 cat >'pkg-conff-dupe/DEBIAN/conffiles' <<CTRL_TEMPL
2804 cat >pkg-conff-dupe/test-conffile-1 <<'_ATEOF'
2808 cat >pkg-conff-dupe/test-conffile-2 <<'_ATEOF'
2813 $as_echo "$at_srcdir/deb-content.at:14:
2814 # Duplicate conffile entries should produce a warning.
2815 dpkg-deb -b pkg-conff-dupe
2817 at_fn_check_prepare_notrace 'an embedded newline' "deb-content.at:14"
2819 # Duplicate conffile entries should produce a warning.
2820 dpkg-deb -b pkg-conff-dupe
2822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2823 at_status=$? at_failed=false
2825 echo >>"$at_stderr"; $as_echo "dpkg-deb: warning: conffile name '/test-conffile-1' is duplicated
2826 dpkg-deb: warning: ignoring 1 warning about the control file(s)
2828 $at_diff - "$at_stderr" || at_failed=:
2829 echo stdout:; cat "$at_stdout"
2830 at_fn_check_status 0 $at_status "$at_srcdir/deb-content.at:14"
2831 $at_failed && at_fn_log_failure
2836 mkdir -p 'pkg-conff-noel/DEBIAN'
2838 cat >'pkg-conff-noel/DEBIAN/control' <<CTRL_TEMPL
2839 Package: pkg-conff-noel
2843 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2845 Description: test package
2848 printf "/test-conffile-1" >"pkg-conff-noel/DEBIAN/conffiles"
2849 cat >pkg-conff-noel/test-conffile-1 <<'_ATEOF'
2854 $as_echo "$at_srcdir/deb-content.at:25:
2855 # Conffiles need a final newline to guarantee there's been no accidental
2857 dpkg-deb -b pkg-conff-noel pkg-conff-noel.deb
2859 at_fn_check_prepare_notrace 'an embedded newline' "deb-content.at:25"
2861 # Conffiles need a final newline to guarantee there's been no accidental
2863 dpkg-deb -b pkg-conff-noel pkg-conff-noel.deb
2865 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2866 at_status=$? at_failed=false
2868 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: conffile name '/test-conffile-1' is too long, or missing final newline
2870 $at_diff - "$at_stderr" || at_failed=:
2871 echo stdout:; cat "$at_stdout"
2872 at_fn_check_status 2 $at_status "$at_srcdir/deb-content.at:25"
2873 $at_failed && at_fn_log_failure
2878 mkdir -p 'pkg-deb-newline/DEBIAN'
2880 cat >'pkg-deb-newline/DEBIAN/control' <<CTRL_TEMPL
2881 Package: pkg-deb-newline
2885 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2887 Description: test package
2890 touch 'pkg-deb-newline/file
2893 $as_echo "$at_srcdir/deb-content.at:35:
2894 # Cannot create package with newlines in filenames.
2895 dpkg-deb -b pkg-deb-newline
2897 at_fn_check_prepare_notrace 'an embedded newline' "deb-content.at:35"
2899 # Cannot create package with newlines in filenames.
2900 dpkg-deb -b pkg-deb-newline
2902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2903 at_status=$? at_failed=false
2905 echo >>"$at_stderr"; $as_echo "dpkg-deb: error: newline not allowed in pathname './file
2908 $at_diff - "$at_stderr" || at_failed=:
2909 echo stdout:; cat "$at_stdout"
2910 at_fn_check_status 2 $at_status "$at_srcdir/deb-content.at:35"
2911 $at_failed && at_fn_log_failure
2916 $at_times_p && times >"$at_times_file"
2917 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2918 read at_status <"$at_status_file"
2921 at_fn_group_banner 4 'deb-fields.at:3' \
2922 "dpkg-deb .deb fields" " " 1
2925 $as_echo "4. $at_setup_line: testing $at_desc ..."
2931 mkdir -p 'pkg-package-type-void/DEBIAN'
2933 cat >'pkg-package-type-void/DEBIAN/control' <<CTRL_TEMPL
2934 Package: pkg-package-type-void
2938 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2940 Description: test package
2944 $as_echo "$at_srcdir/deb-fields.at:7:
2945 dpkg-deb -b pkg-package-type-void
2946 # Test absence of Package-Type field.
2947 test -z \"\$(dpkg-deb -f pkg-package-type-void.deb Package-Type)\"
2949 at_fn_check_prepare_notrace 'a $(...) command substitution' "deb-fields.at:7"
2951 dpkg-deb -b pkg-package-type-void
2952 # Test absence of Package-Type field.
2953 test -z "$(dpkg-deb -f pkg-package-type-void.deb Package-Type)"
2955 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2956 at_status=$? at_failed=false
2958 at_fn_diff_devnull "$at_stderr" || at_failed=:
2959 echo stdout:; cat "$at_stdout"
2960 at_fn_check_status 0 $at_status "$at_srcdir/deb-fields.at:7"
2961 $at_failed && at_fn_log_failure
2966 mkdir -p 'pkg-package-type-use/DEBIAN'
2968 cat >'pkg-package-type-use/DEBIAN/control' <<CTRL_TEMPL
2969 Package: pkg-package-type-use
2973 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2975 Description: test package
2979 sed -i -e '/^Package:/aPackage-Type: udeb' 'pkg-package-type-use/DEBIAN/control'
2982 $as_echo "$at_srcdir/deb-fields.at:15:
2983 dpkg-deb -b pkg-package-type-use
2984 # Test presence of Package-Type field.
2985 test -n \"\$(dpkg-deb -f pkg-package-type-use.deb Package-Type)\"
2987 at_fn_check_prepare_notrace 'a $(...) command substitution' "deb-fields.at:15"
2989 dpkg-deb -b pkg-package-type-use
2990 # Test presence of Package-Type field.
2991 test -n "$(dpkg-deb -f pkg-package-type-use.deb Package-Type)"
2993 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2994 at_status=$? at_failed=false
2996 at_fn_diff_devnull "$at_stderr" || at_failed=:
2997 echo stdout:; cat "$at_stdout"
2998 at_fn_check_status 0 $at_status "$at_srcdir/deb-fields.at:15"
2999 $at_failed && at_fn_log_failure
3004 $at_times_p && times >"$at_times_file"
3005 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3006 read at_status <"$at_status_file"
3009 at_fn_group_banner 5 'deb-split.at:3' \
3010 "dpkg-split options" " " 2
3013 $as_echo "5. $at_setup_line: testing $at_desc ..."
3018 $as_echo "$at_srcdir/deb-split.at:5: dpkg-split --help"
3019 at_fn_check_prepare_trace "deb-split.at:5"
3020 ( $at_check_trace; dpkg-split --help
3021 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3022 at_status=$? at_failed=false
3024 at_fn_diff_devnull "$at_stderr" || at_failed=:
3025 echo stdout:; cat "$at_stdout"
3026 at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:5"
3027 $at_failed && at_fn_log_failure
3031 $at_times_p && times >"$at_times_file"
3032 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3033 read at_status <"$at_status_file"
3036 at_fn_group_banner 6 'deb-split.at:8' \
3037 "dpkg-split .deb format" " " 2
3040 $as_echo "6. $at_setup_line: testing $at_desc ..."
3046 mkdir -p 'pkg-split/DEBIAN'
3048 cat >'pkg-split/DEBIAN/control' <<CTRL_TEMPL
3053 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
3055 Description: test package
3059 sed -i -e 's/^Description:.*$/& - normal package to be split/' 'pkg-split/DEBIAN/control'
3062 $as_echo "$at_srcdir/deb-split.at:14:
3063 # Initialize the template package
3064 chmod -R u+w pkg-split
3065 # XXX: Some environments set SIGPIPE to ignore which we cannot reset, and yes
3066 # does check print error conditions, so we ignore its error message here.
3067 yes 2>/dev/null | dd of=pkg-split/data-file bs=1024 count=1024 status=none
3068 find pkg-split | xargs touch -t 197001010100.00
3069 \$ASROOT dpkg-deb -b -Znone pkg-split >/dev/null
3071 at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:14"
3073 # Initialize the template package
3074 chmod -R u+w pkg-split
3075 # XXX: Some environments set SIGPIPE to ignore which we cannot reset, and yes
3076 # does check print error conditions, so we ignore its error message here.
3077 yes 2>/dev/null | dd of=pkg-split/data-file bs=1024 count=1024 status=none
3078 find pkg-split | xargs touch -t 197001010100.00
3079 $ASROOT dpkg-deb -b -Znone pkg-split >/dev/null
3081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3082 at_status=$? at_failed=false
3084 at_fn_diff_devnull "$at_stderr" || at_failed=:
3085 at_fn_diff_devnull "$at_stdout" || at_failed=:
3086 at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:14"
3087 $at_failed && at_fn_log_failure
3092 $as_echo "$at_srcdir/deb-split.at:24:
3093 # Test splitting a package (in 3 parts: 400 KiB + 400 KiB + 224 KiB)
3094 dpkg-split -S 400 -s pkg-split.deb pkg-split-part
3095 test -f pkg-split-part.1of3.deb
3096 test -f pkg-split-part.2of3.deb
3097 test -f pkg-split-part.3of3.deb
3099 at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:24"
3101 # Test splitting a package (in 3 parts: 400 KiB + 400 KiB + 224 KiB)
3102 dpkg-split -S 400 -s pkg-split.deb pkg-split-part
3103 test -f pkg-split-part.1of3.deb
3104 test -f pkg-split-part.2of3.deb
3105 test -f pkg-split-part.3of3.deb
3107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3108 at_status=$? at_failed=false
3110 at_fn_diff_devnull "$at_stderr" || at_failed=:
3111 echo >>"$at_stdout"; $as_echo "Splitting package pkg-split into 3 parts: 1 2 3 done
3113 $at_diff - "$at_stdout" || at_failed=:
3114 at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:24"
3115 $at_failed && at_fn_log_failure
3119 DEB_SPLIT_MD5SUM=a4042d88f6da3da8ab2ab191a290ab66
3122 $as_echo "$at_srcdir/deb-split.at:35:
3123 # Test getting information about the split parts (parsing verification)
3124 dpkg-split -I pkg-split-part.1of3.deb
3125 dpkg-split -I pkg-split-part.2of3.deb
3126 dpkg-split -I pkg-split-part.3of3.deb
3128 at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:35"
3130 # Test getting information about the split parts (parsing verification)
3131 dpkg-split -I pkg-split-part.1of3.deb
3132 dpkg-split -I pkg-split-part.2of3.deb
3133 dpkg-split -I pkg-split-part.3of3.deb
3135 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3136 at_status=$? at_failed=false
3138 at_fn_diff_devnull "$at_stderr" || at_failed=:
3139 echo >>"$at_stdout"; $as_echo "pkg-split-part.1of3.deb:
3140 Part format version: 2.1
3141 Part of package: pkg-split
3143 ... architecture: all
3144 ... MD5 checksum: $DEB_SPLIT_MD5SUM
3145 ... length: 1055178 bytes
3146 ... split every: 408576 bytes
3148 Part length: 408576 bytes
3149 Part offset: 0 bytes
3150 Part file size (used portion): 408780 bytes
3152 pkg-split-part.2of3.deb:
3153 Part format version: 2.1
3154 Part of package: pkg-split
3156 ... architecture: all
3157 ... MD5 checksum: $DEB_SPLIT_MD5SUM
3158 ... length: 1055178 bytes
3159 ... split every: 408576 bytes
3161 Part length: 408576 bytes
3162 Part offset: 408576 bytes
3163 Part file size (used portion): 408780 bytes
3165 pkg-split-part.3of3.deb:
3166 Part format version: 2.1
3167 Part of package: pkg-split
3169 ... architecture: all
3170 ... MD5 checksum: $DEB_SPLIT_MD5SUM
3171 ... length: 1055178 bytes
3172 ... split every: 408576 bytes
3174 Part length: 238026 bytes
3175 Part offset: 817152 bytes
3176 Part file size (used portion): 238230 bytes
3179 $at_diff - "$at_stdout" || at_failed=:
3180 at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:35"
3181 $at_failed && at_fn_log_failure
3186 $as_echo "$at_srcdir/deb-split.at:81:
3187 # Test joining the split parts back together
3188 dpkg-split -o pkg-joined.deb -j pkg-split-part.*.deb
3189 cmp pkg-split.deb pkg-joined.deb
3191 at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:81"
3193 # Test joining the split parts back together
3194 dpkg-split -o pkg-joined.deb -j pkg-split-part.*.deb
3195 cmp pkg-split.deb pkg-joined.deb
3197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3198 at_status=$? at_failed=false
3200 at_fn_diff_devnull "$at_stderr" || at_failed=:
3201 echo >>"$at_stdout"; $as_echo "Putting package pkg-split together from 3 parts: 1 2 3 done
3203 $at_diff - "$at_stdout" || at_failed=:
3204 at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:81"
3205 $at_failed && at_fn_log_failure
3210 $at_times_p && times >"$at_times_file"
3211 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3212 read at_status <"$at_status_file"