dpkg (1.18.25) stretch; urgency=medium
[dpkg] / t-func / testsuite
CommitLineData
1479465f
GJ
1#! /bin/sh
2# Generated from testsuite.at by GNU Autoconf 2.69.
3#
4# Copyright (C) 2009-2012 Free Software Foundation, Inc.
5#
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## -------------------- ##
11
12# Be more Bourne compatible
13DUALCASE=1; export DUALCASE # for MKS sh
14if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
15 emulate sh
16 NULLCMD=:
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+"$@"}'='"$@"'
20 setopt NO_GLOB_SUBST
21else
22 case `(set -o) 2>/dev/null` in #(
23 *posix*) :
24 set -o posix ;; #(
25 *) :
26 ;;
27esac
28fi
29
30
31as_nl='
32'
33export as_nl
34# Printing a long string crashes Solaris 7 /usr/bin/printf.
35as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
36as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
37as_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.
40if test -z "$BASH_VERSION$ZSH_VERSION" \
41 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
42 as_echo='print -r --'
43 as_echo_n='print -rn --'
44elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
45 as_echo='printf %s\n'
46 as_echo_n='printf %s'
47else
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'
51 else
52 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
53 as_echo_n_body='eval
54 arg=$1;
55 case $arg in #(
56 *"$as_nl"*)
57 expr "X$arg" : "X\\(.*\\)$as_nl";
58 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
59 esac;
60 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
61 '
62 export as_echo_n_body
63 as_echo_n='sh -c $as_echo_n_body as_echo'
64 fi
65 export as_echo_body
66 as_echo='sh -c $as_echo_body as_echo'
67fi
68
69# The user is always right.
70if test "${PATH_SEPARATOR+set}" != set; then
71 PATH_SEPARATOR=:
72 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
73 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
74 PATH_SEPARATOR=';'
75 }
76fi
77
78
79# IFS
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.)
84IFS=" "" $as_nl"
85
86# Find who we are. Look in the path if we contain no directory separator.
87as_myself=
88case $0 in #((
89 *[\\/]* ) as_myself=$0 ;;
90 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
91for as_dir in $PATH
92do
93 IFS=$as_save_IFS
94 test -z "$as_dir" && as_dir=.
95 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
96 done
97IFS=$as_save_IFS
98
99 ;;
100esac
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.
103if test "x$as_myself" = x; then
104 as_myself=$0
105fi
106if test ! -f "$as_myself"; then
107 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
108 exit 1
109fi
110
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.
115for as_var in BASH_ENV ENV MAIL MAILPATH
116do eval test x\${$as_var+set} = xset \
117 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
118done
119PS1='$ '
120PS2='> '
121PS4='+ '
122
123# NLS nuisances.
124LC_ALL=C
125export LC_ALL
126LANGUAGE=C
127export LANGUAGE
128
129# CDPATH.
130(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
131
132if test "x$CONFIG_SHELL" = x; then
133 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
134 emulate sh
135 NULLCMD=:
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+\"\$@\"}'='\"\$@\"'
139 setopt NO_GLOB_SUBST
140else
141 case \`(set -o) 2>/dev/null\` in #(
142 *posix*) :
143 set -o posix ;; #(
144 *) :
145 ;;
146esac
147fi
148"
149 as_required="as_fn_return () { (exit \$1); }
150as_fn_success () { as_fn_return 0; }
151as_fn_failure () { as_fn_return 1; }
152as_fn_ret_success () { return 0; }
153as_fn_ret_failure () { return 1; }
154
155exitcode=0
156as_fn_success || { exitcode=1; echo as_fn_success failed.; }
157as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
158as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
159as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
160if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
161
162else
163 exitcode=1; echo positional parameters were not saved.
164fi
165test x\$exitcode = x0 || exit 1
166test -x / || 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
171test \$(( 1 + 1 )) = 2 || exit 1"
172 if (eval "$as_required") 2>/dev/null; then :
173 as_have_required=yes
174else
175 as_have_required=no
176fi
177 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
178
179else
180 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
181as_found=false
182for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
183do
184 IFS=$as_save_IFS
185 test -z "$as_dir" && as_dir=.
186 as_found=:
187 case $as_dir in #(
188 /*)
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 :
196 break 2
197fi
198fi
199 done;;
200 esac
201 as_found=false
202done
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
206fi; }
207IFS=$as_save_IFS
208
209
210 if test "x$CONFIG_SHELL" != x; then :
211 export CONFIG_SHELL
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.
216BASH_ENV=/dev/null
217ENV=/dev/null
218(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
219case $- in # ((((
220 *v*x* | *x*v* ) as_opts=-vx ;;
221 *v* ) as_opts=-v ;;
222 *x* ) as_opts=-x ;;
223 * ) as_opts= ;;
224esac
225exec $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
229exit 255
230fi
231
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."
238 else
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."
243 fi
244 exit 1
245fi
246fi
247fi
248SHELL=${CONFIG_SHELL-/bin/sh}
249export SHELL
250# Unset more variables known to interfere with behavior of common tools.
251CLICOLOR_FORCE= GREP_OPTIONS=
252unset CLICOLOR_FORCE GREP_OPTIONS
253
254## --------------------- ##
255## M4sh Shell Functions. ##
256## --------------------- ##
257# as_fn_unset VAR
258# ---------------
259# Portably unset VAR.
260as_fn_unset ()
261{
262 { eval $1=; unset $1;}
263}
264as_unset=as_fn_unset
265
266# as_fn_set_status STATUS
267# -----------------------
268# Set $? to STATUS, without forking.
269as_fn_set_status ()
270{
271 return $1
272} # as_fn_set_status
273
274# as_fn_exit STATUS
275# -----------------
276# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
277as_fn_exit ()
278{
279 set +e
280 as_fn_set_status $1
281 exit $1
282} # as_fn_exit
283
284# as_fn_mkdir_p
285# -------------
286# Create "$as_dir" as a directory, including parents if necessary.
287as_fn_mkdir_p ()
288{
289
290 case $as_dir in #(
291 -*) as_dir=./$as_dir;;
292 esac
293 test -d "$as_dir" || eval $as_mkdir_p || {
294 as_dirs=
295 while :; do
296 case $as_dir in #(
297 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
298 *) as_qdir=$as_dir;;
299 esac
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\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
308 s//\1/
309 q
310 }
311 /^X\(\/\/\)[^/].*/{
312 s//\1/
313 q
314 }
315 /^X\(\/\/\)$/{
316 s//\1/
317 q
318 }
319 /^X\(\/\).*/{
320 s//\1/
321 q
322 }
323 s/.*/./; q'`
324 test -d "$as_dir" && break
325 done
326 test -z "$as_dirs" || eval "mkdir $as_dirs"
327 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
328
329
330} # as_fn_mkdir_p
331
332# as_fn_executable_p FILE
333# -----------------------
334# Test if FILE is an executable regular file.
335as_fn_executable_p ()
336{
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
344# implementations.
345if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
346 eval 'as_fn_append ()
347 {
348 eval $1+=\$2
349 }'
350else
351 as_fn_append ()
352 {
353 eval $1=\$$1\$2
354 }
355fi # as_fn_append
356
357# as_fn_arith ARG...
358# ------------------
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.
362if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
363 eval 'as_fn_arith ()
364 {
365 as_val=$(( $* ))
366 }'
367else
368 as_fn_arith ()
369 {
370 as_val=`expr "$@" || test $? -eq 1`
371 }
372fi # as_fn_arith
373
374
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.
380as_fn_error ()
381{
382 as_status=$1; test $as_status -eq 0 && as_status=1
383 if test "$4"; then
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
386 fi
387 $as_echo "$as_me: error: $2" >&2
388 as_fn_exit $as_status
389} # as_fn_error
390
391if expr a : '\(a\)' >/dev/null 2>&1 &&
392 test "X`expr 00001 : '.*\(...\)'`" = X001; then
393 as_expr=expr
394else
395 as_expr=false
396fi
397
398if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
399 as_basename=basename
400else
401 as_basename=false
402fi
403
404as_me=`$as_basename -- "$0" ||
405$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
406 X"$0" : 'X\(//\)$' \| \
407 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
408$as_echo X/"$0" |
409 sed '/^.*\/\([^/][^/]*\)\/*$/{
410 s//\1/
411 q
412 }
413 /^X\/\(\/\/\)$/{
414 s//\1/
415 q
416 }
417 /^X\/\(\/\).*/{
418 s//\1/
419 q
420 }
421 s/.*/./; q'`
422
423if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
424 as_dirname=dirname
425else
426 as_dirname=false
427fi
428
429# Avoid depending upon Character Ranges.
430as_cr_letters='abcdefghijklmnopqrstuvwxyz'
431as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
432as_cr_Letters=$as_cr_letters$as_cr_LETTERS
433as_cr_digits='0123456789'
434as_cr_alnum=$as_cr_Letters$as_cr_digits
435
436
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. :-)
442 sed -n '
443 p
444 /[$]LINENO/=
445 ' <$as_myself |
446 sed '
447 s/[$]LINENO.*/&-/
448 t lineno
449 b
450 :lineno
451 N
452 :loop
453 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
454 t loop
455 s/-\n.*//
456 ' >$as_me.lineno &&
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; }
459
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).
467 . "./$as_me.lineno"
468 # Exit status is that of the last command.
469 exit
470}
471
472ECHO_C= ECHO_N= ECHO_T=
473case `echo -n x` in #(((((
474-n*)
475 case `echo 'xy\c'` in
476 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
477 xy) ECHO_C='\c';;
478 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
479 ECHO_T=' ';;
480 esac;;
481*)
482 ECHO_N='-n';;
483esac
484
485rm -f conf$$ conf$$.exe conf$$.file
486if test -d conf$$.dir; then
487 rm -f conf$$.dir/conf$$.file
488else
489 rm -f conf$$.dir
490 mkdir conf$$.dir 2>/dev/null
491fi
492if (echo >conf$$.file) 2>/dev/null; then
493 if ln -s conf$$.file conf$$ 2>/dev/null; then
494 as_ln_s='ln -s'
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 ||
500 as_ln_s='cp -pR'
501 elif ln conf$$.file conf$$ 2>/dev/null; then
502 as_ln_s=ln
503 else
504 as_ln_s='cp -pR'
505 fi
506else
507 as_ln_s='cp -pR'
508fi
509rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
510rmdir conf$$.dir 2>/dev/null
511
512if mkdir -p . 2>/dev/null; then
513 as_mkdir_p='mkdir -p "$as_dir"'
514else
515 test -d ./-p && rmdir ./-p
516 as_mkdir_p=false
517fi
518
519as_test_x='test -x'
520as_executable_p=as_fn_executable_p
521
522# Sed expression to map a string onto a valid CPP name.
523as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
524
525# Sed expression to map a string onto a valid variable name.
526as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
527
528
529
530
531
532SHELL=${CONFIG_SHELL-/bin/sh}
533
534# How were we run?
535at_cli_args="$@"
536
537
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.
540at_times_p=false
541(times) >/dev/null 2>&1 && at_times_p=:
542
543# CLI Arguments to pass to the debugging scripts.
544at_debug_args=
545# -e sets to true
546at_errexit_p=false
547# Shall we be verbose? ':' means no, empty means yes.
548at_verbose=:
549at_quiet=
550# Running several jobs in parallel, 0 means as many as test groups.
551at_jobs=1
552at_traceon=:
553at_trace_echo=:
554at_check_filter_trace=:
555
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.
558at_debug_p=false
559# Display help message?
560at_help_p=false
561# Display the version message?
562at_version_p=false
563# List test groups?
564at_list_p=false
565# --clean
566at_clean=false
567# Test groups to run
568at_groups=
569# Whether to rerun failed tests.
570at_recheck=
571# Whether a write failure occurred
572at_write_fail=0
573
574# The directory we run the suite in. Default to . if no -C option.
575at_dir=`pwd`
576# An absolute reference to this testsuite script.
577case $as_myself in
578 [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
579 * ) at_myself=$at_dir/$as_myself ;;
580esac
581# Whether -C is in effect.
582at_change_dir=false
583
584# Whether to enable colored test results.
585at_color=auto
586# List of the tested programs.
587at_tested='dpkg-deb
588dpkg-split'
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
591# numerical order.
592at_format='?'
593# Description of all the test groups.
594at_help_all="1;deb-format.at:3;dpkg-deb options;dpkg-deb command-line;
5952;deb-format.at:8;dpkg-deb .deb format;dpkg-deb deb;
5963;deb-content.at:3;dpkg-deb .deb conffiles;dpkg-deb deb conffiles;
5974;deb-fields.at:3;dpkg-deb .deb fields;dpkg-deb deb fields;
5985;deb-split.at:3;dpkg-split options;dpkg-split command-line;
5996;deb-split.at:8;dpkg-split .deb format;dpkg-split deb-split;
600"
601# List of the all the test groups.
602at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
603
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.
608at_fn_validate_ranges ()
609{
610 for at_grp
611 do
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
615 exit 1
616 fi
617 case $at_value in
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`' ;;
624 esac
625 done
626}
627
628at_prev=
629for at_option
630do
631 # If the previous option needs an argument, assign it.
632 if test -n "$at_prev"; then
633 at_option=$at_prev=$at_option
634 at_prev=
635 fi
636
637 case $at_option in
638 *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
639 *) at_optarg= ;;
640 esac
641
642 # Accept the important Cygnus configure options, so we can diagnose typos.
643
644 case $at_option in
645 --help | -h )
646 at_help_p=:
647 ;;
648
649 --list | -l )
650 at_list_p=:
651 ;;
652
653 --version | -V )
654 at_version_p=:
655 ;;
656
657 --clean | -c )
658 at_clean=:
659 ;;
660
661 --color )
662 at_color=always
663 ;;
664 --color=* )
665 case $at_optarg in
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" ;;
671 esac
672 ;;
673
674 --debug | -d )
675 at_debug_p=:
676 ;;
677
678 --errexit | -e )
679 at_debug_p=:
680 at_errexit_p=:
681 ;;
682
683 --verbose | -v )
684 at_verbose=; at_quiet=:
685 ;;
686
687 --trace | -x )
688 at_traceon='set -x'
689 at_trace_echo=echo
690 at_check_filter_trace=at_fn_filter_trace
691 ;;
692
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"
696 ;;
697
698 # Ranges
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"
705 ;;
706
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"
713 ;;
714
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
724 at_tmp=$at_range_end
725 at_range_end=$at_range_start
726 at_range_start=$at_tmp
727 fi
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"
732 ;;
733
734 # Directory selection.
735 --directory | -C )
736 at_prev=--directory
737 ;;
738 --directory=* )
739 at_change_dir=:
740 at_dir=$at_optarg
741 if test x- = "x$at_dir" ; then
742 at_dir=./-
743 fi
744 ;;
745
746 # Parallel execution.
747 --jobs | -j )
748 at_jobs=0
749 ;;
750 --jobs=* | -j[0-9]* )
751 if test -n "$at_optarg"; then
752 at_jobs=$at_optarg
753 else
754 at_jobs=`expr X$at_option : 'X-j\(.*\)'`
755 fi
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" ;;
759 esac
760 ;;
761
762 # Keywords.
763 --keywords | -k )
764 at_prev=--keywords
765 ;;
766 --keywords=* )
767 at_groups_selected=$at_help_all
768 at_save_IFS=$IFS
769 IFS=,
770 set X $at_optarg
771 shift
772 IFS=$at_save_IFS
773 for at_keyword
774 do
775 at_invert=
776 case $at_keyword in
777 '!'*)
778 at_invert="-v"
779 at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
780 ;;
781 esac
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[ ;]"`
785 done
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"
789 ;;
790 --recheck)
791 at_recheck=:
792 ;;
793
794 *=*)
795 at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
796 # Reject names that are not valid shell variable names.
797 case $at_envvar in
798 '' | [0-9]* | *[!_$as_cr_alnum]* )
799 as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
800 esac
801 at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
802 # Export now, but save eval for later and for debug scripts.
803 export $at_envvar
804 as_fn_append at_debug_args " $at_envvar='$at_value'"
805 ;;
806
807 *) $as_echo "$as_me: invalid option: $at_option" >&2
808 $as_echo "Try \`$0 --help' for more information." >&2
809 exit 1
810 ;;
811 esac
812done
813
814# Verify our last option didn't require an argument
815if test -n "$at_prev"; then :
816 as_fn_error $? "\`$at_prev' requires an argument"
817fi
818
819# The file containing the suite.
820at_suite_log=$at_dir/$as_me.log
821
822# Selected test groups.
823if test -z "$at_groups$at_recheck"; then
824 at_groups=$at_groups_all
825else
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
830 }
831 /^Unexpected passes:$/,/^## Detailed failed tests/{
832 s/^[ ]*\([1-9][0-9]*\):.*/\1/p
833 }
834 /^## Detailed failed tests/q
835 ' "$at_suite_log"`
836 as_fn_append at_groups "$at_oldfails$as_nl"
837 fi
838 # Sort the tests, removing duplicates.
839 at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
840fi
841
842if 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'`
849else
850 at_red= at_grn= at_lgn= at_blu= at_std=
851fi
852
853# Help message.
854if $at_help_p; then
855 cat <<_ATEOF || at_write_fail=1
856Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
857
858Run all the tests, or the selected TESTS, given by numeric ranges, and
859save a detailed log file. Upon failure, create debugging scripts.
860
861Do not change environment variables directly. Instead, set them via
862command line arguments. Set \`AUTOTEST_PATH' to select the executables
863to exercise. Each relative directory is expanded as build and source
864directories relative to the top level of this distribution.
865E.g., from within the build directory /tmp/foo-1.0, invoking this:
866
867 $ $0 AUTOTEST_PATH=bin
868
869is equivalent to the following, assuming the source directory is /src/foo-1.0:
870
871 PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
872_ATEOF
873cat <<_ATEOF || at_write_fail=1
874
875Operation modes:
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
880_ATEOF
881cat <<_ATEOF || at_write_fail=1
882
883Execution tuning:
884 -C, --directory=DIR
885 change to directory DIR before starting
886 --color[=never|auto|always]
887 disable colored test results, or enable even without terminal
888 -j, --jobs[=N]
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
900_ATEOF
901cat <<_ATEOF || at_write_fail=1
902
903Report bugs to <debian-dpkg@lists.debian.org>.
904_ATEOF
905 exit $at_write_fail
906fi
907
908# List of tests.
909if $at_list_p; then
910 cat <<_ATEOF || at_write_fail=1
911dpkg 1.18.25 test suite: dpkg tools functional test suite test groups:
912
913 NUM: FILE-NAME:LINE TEST-GROUP-NAME
914 KEYWORDS
915
916_ATEOF
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 != ";" {
920 selected[$ 1] = 1
921 next
922 }
923 /^$/ { FS = ";" }
924 NF > 0 {
925 if (selected[$ 1]) {
926 printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
927 if ($ 4) {
928 lmax = 79
929 indent = " "
930 line = indent
931 len = length (line)
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) {
936 print line
937 line = indent " " a[i]
938 len = length (line)
939 } else {
940 line = line " " a[i]
941 len += l
942 }
943 }
944 if (n)
945 print line
946 }
947 }
948 }' || at_write_fail=1
949 exit $at_write_fail
950fi
951if $at_version_p; then
952 $as_echo "$as_me (dpkg 1.18.25)" &&
953 cat <<\_ATEOF || at_write_fail=1
954
955Copyright (C) 2012 Free Software Foundation, Inc.
956This test suite is free software; the Free Software Foundation gives
957unlimited permission to copy, distribute and modify it.
958_ATEOF
959 exit $at_write_fail
960fi
961
962# Should we print banners? Yes if more than one test is run.
963case $at_groups in #(
964 *$as_nl* )
965 at_print_banners=: ;; #(
966 * ) at_print_banners=false ;;
967esac
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.
971at_banner_text_1="Binary .deb packages"
972# Banner 2. testsuite.at:9
973# Category starts at test group 5.
974at_banner_text_2="Split .deb packages"
975
976# Take any -C into account.
977if $at_change_dir ; then
978 test x != "x$at_dir" && cd "$at_dir" \
979 || as_fn_error $? "unable to change directory"
980 at_dir=`pwd`
981fi
982
983# Load the config files for any default variable assignments.
984for at_file in atconfig atlocal
985do
986 test -r $at_file || continue
987 . ./$at_file || as_fn_error $? "invalid content: $at_file"
988done
989
990# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
991: "${at_top_build_prefix=$at_top_builddir}"
992
993# Perform any assignments requested during argument parsing.
994eval "$at_debug_args"
995
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.
998if test -n "$at_top_srcdir"; then
999 builddir=../..
1000 for at_dir_var in srcdir top_srcdir top_build_prefix
1001 do
1002 eval at_val=\$at_$at_dir_var
1003 case $at_val in
1004 [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1005 *) at_prefix=../../ ;;
1006 esac
1007 eval "$at_dir_var=\$at_prefix\$at_val"
1008 done
1009fi
1010
1011## -------------------- ##
1012## Directory structure. ##
1013## -------------------- ##
1014
1015# This is the set of directories and files used by this script
1016# (non-literals are capitalized):
1017#
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
1040
1041# The directory the whole suite works in.
1042# Should be absolute to let the user `cd' at will.
1043at_suite_dir=$at_dir/$as_me.dir
1044# The file containing the suite ($at_dir might have changed since earlier).
1045at_suite_log=$at_dir/$as_me.log
1046# The directory containing helper files per test group.
1047at_helper_dir=$at_suite_dir/at-groups
1048# Stop file: if it exists, do not start new jobs.
1049at_stop_file=$at_suite_dir/at-stop
1050# The fifo used for the job dispatcher.
1051at_job_fifo=$at_suite_dir/at-job-fifo
1052
1053if $at_clean; then
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"
1057 exit $?
1058fi
1059
1060# Don't take risks: use only absolute directories in PATH.
1061#
1062# For stand-alone test suites (ie. atconfig was not found),
1063# AUTOTEST_PATH is relative to `.'.
1064#
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.
1068AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1069at_path=
1070as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1071for as_dir in $AUTOTEST_PATH $PATH
1072do
1073 IFS=$as_save_IFS
1074 test -z "$as_dir" && as_dir=.
1075 test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1076case $as_dir in
1077 [\\/]* | ?:[\\/]* )
1078 as_fn_append at_path "$as_dir"
1079 ;;
1080 * )
1081 if test -z "$at_top_build_prefix"; then
1082 # Stand-alone test suite.
1083 as_fn_append at_path "$as_dir"
1084 else
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"
1088 fi
1089 ;;
1090esac
1091 done
1092IFS=$as_save_IFS
1093
1094
1095# Now build and simplify PATH.
1096#
1097# There might be directories that don't exist, but don't redirect
1098# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1099at_new_path=
1100as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1101for as_dir in $at_path
1102do
1103 IFS=$as_save_IFS
1104 test -z "$as_dir" && as_dir=.
1105 test -d "$as_dir" || continue
1106case $as_dir in
1107 [\\/]* | ?:[\\/]* ) ;;
1108 * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1109esac
1110case $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" ;;
1114esac
1115 done
1116IFS=$as_save_IFS
1117
1118PATH=$at_new_path
1119export PATH
1120
1121# Setting up the FDs.
1122
1123
1124
1125# 5 is the log file. Not to be overwritten if `-d'.
1126if $at_debug_p; then
1127 at_suite_log=/dev/null
1128else
1129 : >"$at_suite_log"
1130fi
1131exec 5>>"$at_suite_log"
1132
1133# Banners and logs.
1134$as_echo "## ---------------------------------------------------------- ##
1135## dpkg 1.18.25 test suite: dpkg tools functional test suite. ##
1136## ---------------------------------------------------------- ##"
1137{
1138 $as_echo "## ---------------------------------------------------------- ##
1139## dpkg 1.18.25 test suite: dpkg tools functional test suite. ##
1140## ---------------------------------------------------------- ##"
1141 echo
1142
1143 $as_echo "$as_me: command line was:"
1144 $as_echo " \$ $0 $at_cli_args"
1145 echo
1146
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 "## ---------- ##
1151## ChangeLog. ##
1152## ---------- ##"
1153 echo
1154 sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1155 echo
1156 fi
1157
1158 {
1159cat <<_ASUNAME
1160## --------- ##
1161## Platform. ##
1162## --------- ##
1163
1164hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1165uname -m = `(uname -m) 2>/dev/null || echo unknown`
1166uname -r = `(uname -r) 2>/dev/null || echo unknown`
1167uname -s = `(uname -s) 2>/dev/null || echo unknown`
1168uname -v = `(uname -v) 2>/dev/null || echo unknown`
1169
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`
1172
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`
1180
1181_ASUNAME
1182
1183as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1184for as_dir in $PATH
1185do
1186 IFS=$as_save_IFS
1187 test -z "$as_dir" && as_dir=.
1188 $as_echo "PATH: $as_dir"
1189 done
1190IFS=$as_save_IFS
1191
1192}
1193 echo
1194
1195 # Contents of the config files.
1196 for at_file in atconfig atlocal
1197 do
1198 test -r $at_file || continue
1199 $as_echo "$as_me: $at_file:"
1200 sed 's/^/| /' $at_file
1201 echo
1202 done
1203} >&5
1204
1205
1206## ------------------------- ##
1207## Autotest shell functions. ##
1208## ------------------------- ##
1209
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.
1214at_fn_banner ()
1215{
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
1221 $at_first || echo
1222 else
1223 $as_echo "$as_nl$at_banner_text$as_nl"
1224 fi
1225} # at_fn_banner
1226
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.
1231at_fn_check_prepare_notrace ()
1232{
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"
1237}
1238
1239# at_fn_check_prepare_trace LINE
1240# ------------------------------
1241# Perform AT_CHECK preparations for the command at LINE for a traceable
1242# command.
1243at_fn_check_prepare_trace ()
1244{
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"
1248}
1249
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.
1254at_fn_check_prepare_dynamic ()
1255{
1256 case $1 in
1257 *$as_nl*)
1258 at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1259 *)
1260 at_fn_check_prepare_trace "$2" ;;
1261 esac
1262}
1263
1264# at_fn_filter_trace
1265# ------------------
1266# Remove the lines in the file "$at_stderr" generated by "set -x" and print
1267# them to stderr.
1268at_fn_filter_trace ()
1269{
1270 mv "$at_stderr" "$at_stder1"
1271 grep '^ *+' "$at_stder1" >&2
1272 grep -v '^ *+' "$at_stder1" >"$at_stderr"
1273}
1274
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.
1279at_fn_log_failure ()
1280{
1281 for file
1282 do $as_echo "$file:"; sed 's/^/> /' "$file"; done
1283 echo 1 > "$at_status_file"
1284 exit 1
1285}
1286
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.
1292at_fn_check_skip ()
1293{
1294 case $1 in
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;;
1298 esac
1299}
1300
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.
1307at_fn_check_status ()
1308{
1309 case $2 in
1310 $1 ) ;;
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"
1315 at_failed=:;;
1316 esac
1317}
1318
1319# at_fn_diff_devnull FILE
1320# -----------------------
1321# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1322# invocations.
1323at_fn_diff_devnull ()
1324{
1325 test -s "$1" || return 0
1326 $at_diff "$at_devnull" "$1"
1327}
1328
1329# at_fn_test NUMBER
1330# -----------------
1331# Parse out test NUMBER from the tail of this file.
1332at_fn_test ()
1333{
1334 eval at_sed=\$at_sed$1
1335 sed "$at_sed" "$at_myself" > "$at_test_source"
1336}
1337
1338# at_fn_create_debugging_script
1339# -----------------------------
1340# Create the debugging script $at_group_dir/run which will reproduce the
1341# current test group.
1342at_fn_create_debugging_script ()
1343{
1344 {
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+\"\$@\"}" &&
1349 echo 'exit 1'
1350 } >"$at_group_dir/run" &&
1351 chmod +x "$at_group_dir/run"
1352}
1353
1354## -------------------------------- ##
1355## End of autotest shell functions. ##
1356## -------------------------------- ##
1357{
1358 $as_echo "## ---------------- ##
1359## Tested programs. ##
1360## ---------------- ##"
1361 echo
1362} >&5
1363
1364# Report what programs are being tested.
1365for at_program in : $at_tested
1366do
1367 test "$at_program" = : && continue
1368 case $at_program in
1369 [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1370 * )
1371 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1372for as_dir in $PATH
1373do
1374 IFS=$as_save_IFS
1375 test -z "$as_dir" && as_dir=.
1376 test -f "$as_dir/$at_program" && break
1377 done
1378IFS=$as_save_IFS
1379
1380 at_program_=$as_dir/$at_program ;;
1381 esac
1382 if test -f "$at_program_"; then
1383 {
1384 $as_echo "$at_srcdir/testsuite.at:1: $at_program_ --version"
1385 "$at_program_" --version </dev/null
1386 echo
1387 } >&5 2>&1
1388 else
1389 as_fn_error $? "cannot find $at_program" "$LINENO" 5
1390 fi
1391done
1392
1393{
1394 $as_echo "## ------------------ ##
1395## Running the tests. ##
1396## ------------------ ##"
1397} >&5
1398
1399at_start_date=`date`
1400at_start_time=`date +%s 2>/dev/null`
1401$as_echo "$as_me: starting at: $at_start_date" >&5
1402
1403# Create the master directory if it doesn't already exist.
1404as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1405 as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1406
1407# Can we diff with `/dev/null'? DU 5.0 refuses.
1408if diff /dev/null /dev/null >/dev/null 2>&1; then
1409 at_devnull=/dev/null
1410else
1411 at_devnull=$at_suite_dir/devnull
1412 >"$at_devnull"
1413fi
1414
1415# Use `diff -u' when possible.
1416if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1417then
1418 at_diff='diff -u'
1419else
1420 at_diff=diff
1421fi
1422
1423# Get the last needed group.
1424for at_group in : $at_groups; do :; done
1425
1426# Extract the start and end lines of each test group at the tail
1427# of this file
1428awk '
1429BEGIN { FS="\a" }
1430/^#AT_START_/ {
1431 start = NR
1432}
1433/^#AT_STOP_/ {
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
1440rm -f "$at_suite_dir/at-source-lines"
1441
1442# Set number of jobs for `-j'; avoid more jobs than test groups.
1443set X $at_groups; shift; at_max_jobs=$#
1444if test $at_max_jobs -eq 0; then
1445 at_jobs=1
1446fi
1447if 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
1450fi
1451
1452# If parallel mode, don't output banners, don't split summary lines.
1453if test $at_jobs -ne 1; then
1454 at_print_banners=false
1455 at_quiet=:
1456fi
1457
1458# Set up helper dirs.
1459rm -rf "$at_helper_dir" &&
1460mkdir "$at_helper_dir" &&
1461cd "$at_helper_dir" &&
1462{ test -z "$at_groups" || mkdir $at_groups; } ||
1463as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1464
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.
1468
1469# at_fn_group_prepare
1470# -------------------
1471# Prepare for running a test group.
1472at_fn_group_prepare ()
1473{
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
1488
1489 # Be sure to come back to the top test directory.
1490 cd "$at_suite_dir"
1491
1492 # Clearly separate the test groups when verbose.
1493 $at_first || $at_verbose echo
1494
1495 at_group_normalized=$at_group
1496
1497 eval 'while :; do
1498 case $at_group_normalized in #(
1499 '"$at_format"'*) break;;
1500 esac
1501 at_group_normalized=0$at_group_normalized
1502 done'
1503
1504
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"/.??*
1515fi ||
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
1520
1521 echo 0 > "$at_status_file"
1522
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"'
1527 else
1528 at_tee_pipe='cat >> "$at_group_log"'
1529 fi
1530}
1531
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.
1536at_fn_group_banner ()
1537{
1538 at_setup_line="$2"
1539 test -n "$5" && at_fn_banner $5
1540 at_desc="$3"
1541 case $1 in
1542 [0-9]) at_desc_line=" $1: ";;
1543 [0-9][0-9]) at_desc_line=" $1: " ;;
1544 *) at_desc_line="$1: " ;;
1545 esac
1546 as_fn_append at_desc_line "$3$4"
1547 $at_quiet $as_echo_n "$at_desc_line"
1548 echo "# -*- compilation -*-" >> "$at_group_log"
1549}
1550
1551# at_fn_group_postprocess
1552# -----------------------
1553# Perform cleanup after running a test group.
1554at_fn_group_postprocess ()
1555{
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.
1558 cd "$at_suite_dir"
1559
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>.
1565_ATEOF
1566 $as_echo "$at_setup_line" >"$at_check_line_file"
1567 at_status=99
1568 fi
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
1572 yes:0)
1573 at_msg="UNEXPECTED PASS"
1574 at_res=xpass
1575 at_errexit=$at_errexit_p
1576 at_color=$at_red
1577 ;;
1578 no:0)
1579 at_msg="ok"
1580 at_res=pass
1581 at_errexit=false
1582 at_color=$at_grn
1583 ;;
1584 *:77)
1585 at_msg='skipped ('`cat "$at_check_line_file"`')'
1586 at_res=skip
1587 at_errexit=false
1588 at_color=$at_blu
1589 ;;
1590 no:* | *:99)
1591 at_msg='FAILED ('`cat "$at_check_line_file"`')'
1592 at_res=fail
1593 at_errexit=$at_errexit_p
1594 at_color=$at_red
1595 ;;
1596 yes:*)
1597 at_msg='expected failure ('`cat "$at_check_line_file"`')'
1598 at_res=xfail
1599 at_errexit=false
1600 at_color=$at_lgn
1601 ;;
1602 esac
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"
1607 else
1608 # Make sure there is a separator even with long titles.
1609 $as_echo " $at_color$at_msg$at_std"
1610 fi
1611 at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1612 case $at_status in
1613 0|77)
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"
1621 fi
1622 $as_echo "$at_log_msg" >> "$at_group_log"
1623 $as_echo "$at_log_msg" >&5
1624
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"
1631 fi
1632 else
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"
1636 fi
1637 rm -f "$at_test_source"
1638 fi
1639 ;;
1640 *)
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"
1645
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"
1651 fi
1652 ;;
1653 esac
1654}
1655
1656
1657## ------------ ##
1658## Driver loop. ##
1659## ------------ ##
1660
1661
1662if (set -m && set +m && set +b) >/dev/null 2>&1; then
1663 set +b
1664 at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1665else
1666 at_job_control_on=: at_job_control_off=: at_job_group=
1667fi
1668
1669for at_signal in 1 2 15; do
1670 trap 'set +x; set +e
1671 $at_job_control_off
1672 at_signal='"$at_signal"'
1673 echo stop > "$at_stop_file"
1674 trap "" $at_signal
1675 at_pgids=
1676 for at_pgid in `jobs -p 2>/dev/null`; do
1677 at_pgids="$at_pgids $at_job_group$at_pgid"
1678 done
1679 test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1680 wait
1681 if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1682 echo >&2
1683 fi
1684 at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1685 set x $at_signame
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
1691done
1692
1693rm -f "$at_stop_file"
1694at_first=:
1695
1696if 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
1700then
1701 # FIFO job dispatcher.
1702
1703 trap 'at_pids=
1704 for at_pid in `jobs -p`; do
1705 at_pids="$at_pids $at_job_group$at_pid"
1706 done
1707 if test -n "$at_pids"; then
1708 at_sig=TSTP
1709 test "${TMOUT+set}" = set && at_sig=STOP
1710 kill -$at_sig $at_pids 2>/dev/null
1711 fi
1712 kill -STOP $$
1713 test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1714
1715 echo
1716 # Turn jobs into a list of numbers, starting from 1.
1717 at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
1718
1719 set X $at_joblist
1720 shift
1721 for at_group in $at_groups; do
1722 $at_job_control_on 2>/dev/null
1723 (
1724 # Start one test group.
1725 $at_job_control_off
1726 if $at_first; then
1727 exec 7>"$at_job_fifo"
1728 else
1729 exec 6<&-
1730 fi
1731 trap 'set +x; set +e
1732 trap "" PIPE
1733 echo stop > "$at_stop_file"
1734 echo >&7
1735 as_fn_exit 141' PIPE
1736 at_fn_group_prepare
1737 if cd "$at_group_dir" &&
1738 at_fn_test $at_group &&
1739 . "$at_test_source"
1740 then :; else
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;}
1743 at_failed=:
1744 fi
1745 at_fn_group_postprocess
1746 echo >&7
1747 ) &
1748 $at_job_control_off
1749 if $at_first; then
1750 at_first=false
1751 exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1752 fi
1753 shift # Consume one token.
1754 if test $# -gt 0; then :; else
1755 read at_token <&6 || break
1756 set x $*
1757 fi
1758 test -f "$at_stop_file" && break
1759 done
1760 exec 7>&-
1761 # Read back the remaining ($at_jobs - 1) tokens.
1762 set X $at_joblist
1763 shift
1764 if test $# -gt 0; then
1765 shift
1766 for at_job
1767 do
1768 read at_token
1769 done <&6
1770 fi
1771 exec 6<&-
1772 wait
1773else
1774 # Run serially, avoid forks and other potential surprises.
1775 for at_group in $at_groups; do
1776 at_fn_group_prepare
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;}
1782 at_failed=:
1783 fi
1784 at_fn_group_postprocess
1785 test -f "$at_stop_file" && break
1786 at_first=false
1787 done
1788fi
1789
1790# Wrap up the test suite with summary statistics.
1791cd "$at_helper_dir"
1792
1793# Use ?..???? when the list must remain sorted, the faster * otherwise.
1794at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1795at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1796at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1797at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1798 echo $f; done | sed '/?/d; s,/xpass,,'`
1799at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1800 echo $f; done | sed '/?/d; s,/fail,,'`
1801
1802set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1803shift; at_group_count=$#
1804set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1805set X $at_xfail_list; shift; at_xfail_count=$#
1806set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1807set X $at_skip_list; shift; at_skip_count=$#
1808
1809as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1810as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1811as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1812
1813# Back to the top directory.
1814cd "$at_dir"
1815rm -rf "$at_helper_dir"
1816
1817# Compute the duration of the suite.
1818at_stop_date=`date`
1819at_stop_time=`date +%s 2>/dev/null`
1820$as_echo "$as_me: ending at: $at_stop_date" >&5
1821case $at_start_time,$at_stop_time in
1822 [0-9]*,[0-9]*)
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
1830 ;;
1831esac
1832
1833echo
1834$as_echo "## ------------- ##
1835## Test results. ##
1836## ------------- ##"
1837echo
1838{
1839 echo
1840 $as_echo "## ------------- ##
1841## Test results. ##
1842## ------------- ##"
1843 echo
1844} >&5
1845
1846if test $at_run_count = 1; then
1847 at_result="1 test"
1848 at_were=was
1849else
1850 at_result="$at_run_count tests"
1851 at_were=were
1852fi
1853if $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"
1856 else
1857 at_result="$at_result $at_were run, one failed"
1858 fi
1859 at_result="$at_result unexpectedly and inhibited subsequent tests."
1860 at_color=$at_red
1861else
1862 # Don't you just love exponential explosion of the number of cases?
1863 at_color=$at_red
1864 case $at_xpass_count:$at_fail_count:$at_xfail_count in
1865 # So far, so good.
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 ;;
1868
1869 # Some unexpected failures
1870 0:*:0) at_result="$at_result $at_were run,
1871$at_fail_count failed unexpectedly." ;;
1872
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)." ;;
1878
1879 # No unexpected failures, but some xpasses
1880 *:0:*) at_result="$at_result $at_were run,
1881$at_xpass_count passed unexpectedly." ;;
1882
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)." ;;
1888
1889 # All of them.
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)." ;;
1896 esac
1897
1898 if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1899 at_result="All $at_result"
1900 fi
1901fi
1902
1903# Now put skips in the mix.
1904case $at_skip_count in
1905 0) ;;
1906 1) at_result="$at_result
19071 test was skipped." ;;
1908 *) at_result="$at_result
1909$at_skip_count tests were skipped." ;;
1910esac
1911
1912if test $at_unexpected_count = 0; then
1913 echo "$at_color$at_result$at_std"
1914 echo "$at_result" >&5
1915else
1916 echo "${at_color}ERROR: $at_result$at_std" >&2
1917 echo "ERROR: $at_result" >&5
1918 {
1919 echo
1920 $as_echo "## ------------------------ ##
1921## Summary of the failures. ##
1922## ------------------------ ##"
1923
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
1928 echo
1929 fi
1930 if test $at_skip_count != 0; then
1931 echo "Skipped tests:"
1932 $SHELL "$at_myself" $at_skip_list --list
1933 echo
1934 fi
1935 if test $at_xpass_count != 0; then
1936 echo "Unexpected passes:"
1937 $SHELL "$at_myself" $at_xpass_list --list
1938 echo
1939 fi
1940 if test $at_fail_count != 0; then
1941 $as_echo "## ---------------------- ##
1942## Detailed failed tests. ##
1943## ---------------------- ##"
1944 echo
1945 for at_group in $at_fail_list
1946 do
1947 at_group_normalized=$at_group
1948
1949 eval 'while :; do
1950 case $at_group_normalized in #(
1951 '"$at_format"'*) break;;
1952 esac
1953 at_group_normalized=0$at_group_normalized
1954 done'
1955
1956 cat "$at_suite_dir/$at_group_normalized/$as_me.log"
1957 echo
1958 done
1959 echo
1960 fi
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 ##
1964_ASBOX
1965 sed 's/^/| /' ${at_top_build_prefix}config.log
1966 echo
1967 fi
1968 } >&5
1969
1970 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
1971## $as_me.log was created. ##
1972_ASBOX
1973
1974 echo
1975 if $at_debug_p; then
1976 at_msg='per-test log files'
1977 else
1978 at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
1979 fi
1980 $as_echo "Please send $at_msg and all information you think might help:
1981
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}
1984
1985You may investigate any problem if you feel able to do so, in which
1986case the test suite provides a good starting point. Its output may
1987be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
1988"
1989 exit 1
1990fi
1991
1992exit 0
1993
1994## ------------- ##
1995## Actual tests. ##
1996## ------------- ##
1997#AT_START_1
1998at_fn_group_banner 1 'deb-format.at:3' \
1999 "dpkg-deb options" " " 1
2000at_xfail=no
2001(
2002 $as_echo "1. $at_setup_line: testing $at_desc ..."
2003 $at_traceon
2004
2005
2006{ set +x
2007$as_echo "$at_srcdir/deb-format.at:5: dpkg-deb --help"
2008at_fn_check_prepare_trace "deb-format.at:5"
2009( $at_check_trace; dpkg-deb --help
2010) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2011at_status=$? at_failed=false
2012$at_check_filter
2013at_fn_diff_devnull "$at_stderr" || at_failed=:
2014echo stdout:; cat "$at_stdout"
2015at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:5"
2016$at_failed && at_fn_log_failure
2017$at_traceon; }
2018
2019 set +x
2020 $at_times_p && times >"$at_times_file"
2021) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2022read at_status <"$at_status_file"
2023#AT_STOP_1
2024#AT_START_2
2025at_fn_group_banner 2 'deb-format.at:8' \
2026 "dpkg-deb .deb format" " " 1
2027at_xfail=no
2028(
2029 $as_echo "2. $at_setup_line: testing $at_desc ..."
2030 $at_traceon
2031
2032
2033
2034
2035 mkdir -p 'pkg-deb-format/DEBIAN'
2036
2037 cat >'pkg-deb-format/DEBIAN/control' <<CTRL_TEMPL
2038Package: pkg-deb-format
2039Version: 0.0-1
2040Section: test
2041Priority: extra
2042Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2043Architecture: all
2044Description: test package
2045CTRL_TEMPL
2046
2047
2048 sed -i -e 's/^Description:.*$/& - deb format support/' 'pkg-deb-format/DEBIAN/control'
2049
2050cat >pkg-deb-format/file-templ <<'_ATEOF'
2051test
2052_ATEOF
2053
2054{ set +x
2055$as_echo "$at_srcdir/deb-format.at:16:
2056# Initialize the template package
2057mv pkg-deb-format pkg-templ
2058chmod -R u+w pkg-templ
2059find pkg-templ | xargs touch -t 197001010100.00
2060\$ASROOT dpkg-deb --uniform-compression -Znone -b pkg-templ >/dev/null
2061
2062# Extract the base members
2063ar x pkg-templ.deb
2064gzip -c control.tar >control.tar.gz
2065gzip -c data.tar >data.tar.gz
2066xz -c control.tar >control.tar.xz
2067xz -c data.tar >data.tar.xz
2068bzip2 -c data.tar >data.tar.bz2
2069lzma -c data.tar >data.tar.lzma
2070touch _ignore
2071touch unknown
2072"
2073at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:16"
2074( $at_check_trace;
2075# Initialize the template package
2076mv pkg-deb-format pkg-templ
2077chmod -R u+w pkg-templ
2078find pkg-templ | xargs touch -t 197001010100.00
2079$ASROOT dpkg-deb --uniform-compression -Znone -b pkg-templ >/dev/null
2080
2081# Extract the base members
2082ar x pkg-templ.deb
2083gzip -c control.tar >control.tar.gz
2084gzip -c data.tar >data.tar.gz
2085xz -c control.tar >control.tar.xz
2086xz -c data.tar >data.tar.xz
2087bzip2 -c data.tar >data.tar.bz2
2088lzma -c data.tar >data.tar.lzma
2089touch _ignore
2090touch unknown
2091
2092) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2093at_status=$? at_failed=false
2094$at_check_filter
2095at_fn_diff_devnull "$at_stderr" || at_failed=:
2096at_fn_diff_devnull "$at_stdout" || at_failed=:
2097at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:16"
2098$at_failed && at_fn_log_failure
2099$at_traceon; }
2100
2101
2102{ set +x
2103$as_echo "$at_srcdir/deb-format.at:35:
2104# Test debian-binary with 2.x versions
2105cp pkg-templ.deb pkg-version-2x.deb
2106echo 2.999 >debian-binary
2107ar rc pkg-version-2x.deb debian-binary
2108ar t pkg-version-2x.deb
2109ar x pkg-templ.deb debian-binary
2110# XXX: Ideally we would have no need to strip trailing spaces.
2111dpkg-deb -I pkg-version-2x.deb | sed -e 's/ *\$//'
2112"
2113at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:35"
2114( $at_check_trace;
2115# Test debian-binary with 2.x versions
2116cp pkg-templ.deb pkg-version-2x.deb
2117echo 2.999 >debian-binary
2118ar rc pkg-version-2x.deb debian-binary
2119ar t pkg-version-2x.deb
2120ar x pkg-templ.deb debian-binary
2121# XXX: Ideally we would have no need to strip trailing spaces.
2122dpkg-deb -I pkg-version-2x.deb | sed -e 's/ *$//'
2123
2124) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2125at_status=$? at_failed=false
2126$at_check_filter
2127at_fn_diff_devnull "$at_stderr" || at_failed=:
2128echo >>"$at_stdout"; $as_echo "debian-binary
2129control.tar
2130data.tar
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
2135 Version: 0.0-1
2136 Section: test
2137 Priority: extra
2138 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2139 Architecture: all
2140 Description: test package - deb format support
2141" | \
2142 $at_diff - "$at_stdout" || at_failed=:
2143at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:35"
2144$at_failed && at_fn_log_failure
2145$at_traceon; }
2146
2147
2148{ set +x
2149$as_echo "$at_srcdir/deb-format.at:59:
2150# Test debian-binary with extra lines
2151cp pkg-templ.deb pkg-magic-extra.deb
2152echo \"extra line\" >>debian-binary
2153ar rc pkg-magic-extra.deb debian-binary
2154ar t pkg-magic-extra.deb
2155ar x pkg-templ.deb debian-binary
2156# XXX: Ideally we would have no need to strip trailing spaces.
2157dpkg-deb -I pkg-magic-extra.deb | sed -e 's/ *\$//'
2158"
2159at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:59"
2160( $at_check_trace;
2161# Test debian-binary with extra lines
2162cp pkg-templ.deb pkg-magic-extra.deb
2163echo "extra line" >>debian-binary
2164ar rc pkg-magic-extra.deb debian-binary
2165ar t pkg-magic-extra.deb
2166ar x pkg-templ.deb debian-binary
2167# XXX: Ideally we would have no need to strip trailing spaces.
2168dpkg-deb -I pkg-magic-extra.deb | sed -e 's/ *$//'
2169
2170) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2171at_status=$? at_failed=false
2172$at_check_filter
2173at_fn_diff_devnull "$at_stderr" || at_failed=:
2174echo >>"$at_stdout"; $as_echo "debian-binary
2175control.tar
2176data.tar
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
2181 Version: 0.0-1
2182 Section: test
2183 Priority: extra
2184 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2185 Architecture: all
2186 Description: test package - deb format support
2187" | \
2188 $at_diff - "$at_stdout" || at_failed=:
2189at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:59"
2190$at_failed && at_fn_log_failure
2191$at_traceon; }
2192
2193
2194{ set +x
2195$as_echo "$at_srcdir/deb-format.at:83:
2196# Test missing debian-binary member
2197cp pkg-templ.deb pkg-missing-magic.deb
2198ar d pkg-missing-magic.deb debian-binary
2199ar t pkg-missing-magic.deb
2200dpkg-deb -I pkg-missing-magic.deb
2201"
2202at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:83"
2203( $at_check_trace;
2204# Test missing debian-binary member
2205cp pkg-templ.deb pkg-missing-magic.deb
2206ar d pkg-missing-magic.deb debian-binary
2207ar t pkg-missing-magic.deb
2208dpkg-deb -I pkg-missing-magic.deb
2209
2210) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2211at_status=$? at_failed=false
2212$at_check_filter
2213echo >>"$at_stderr"; $as_echo "dpkg-deb: error: file 'pkg-missing-magic.deb' is not a debian binary archive (try dpkg-split?)
2214" | \
2215 $at_diff - "$at_stderr" || at_failed=:
2216echo >>"$at_stdout"; $as_echo "control.tar
2217data.tar
2218" | \
2219 $at_diff - "$at_stdout" || at_failed=:
2220at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:83"
2221$at_failed && at_fn_log_failure
2222$at_traceon; }
2223
2224
2225{ set +x
2226$as_echo "$at_srcdir/deb-format.at:94:
2227# Test missing control member
2228cp pkg-templ.deb pkg-missing-control.deb
2229ar d pkg-missing-control.deb control.tar
2230ar t pkg-missing-control.deb
2231dpkg-deb -I pkg-missing-control.deb
2232"
2233at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:94"
2234( $at_check_trace;
2235# Test missing control member
2236cp pkg-templ.deb pkg-missing-control.deb
2237ar d pkg-missing-control.deb control.tar
2238ar t pkg-missing-control.deb
2239dpkg-deb -I pkg-missing-control.deb
2240
2241) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2242at_status=$? at_failed=false
2243$at_check_filter
2244echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-missing-control.deb' has premature member 'data.tar' before 'control.tar', giving up
2245" | \
2246 $at_diff - "$at_stderr" || at_failed=:
2247echo >>"$at_stdout"; $as_echo "debian-binary
2248data.tar
2249" | \
2250 $at_diff - "$at_stdout" || at_failed=:
2251at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:94"
2252$at_failed && at_fn_log_failure
2253$at_traceon; }
2254
2255
2256{ set +x
2257$as_echo "$at_srcdir/deb-format.at:105:
2258# Test missing data member
2259cp pkg-templ.deb pkg-missing-data.deb
2260ar d pkg-missing-data.deb data.tar
2261ar t pkg-missing-data.deb
2262dpkg-deb -c pkg-missing-data.deb
2263"
2264at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:105"
2265( $at_check_trace;
2266# Test missing data member
2267cp pkg-templ.deb pkg-missing-data.deb
2268ar d pkg-missing-data.deb data.tar
2269ar t pkg-missing-data.deb
2270dpkg-deb -c pkg-missing-data.deb
2271
2272) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2273at_status=$? at_failed=false
2274$at_check_filter
2275echo >>"$at_stderr"; $as_echo "dpkg-deb: error: unexpected end of file in archive member header in pkg-missing-data.deb
2276" | \
2277 $at_diff - "$at_stderr" || at_failed=:
2278echo >>"$at_stdout"; $as_echo "debian-binary
2279control.tar
2280" | \
2281 $at_diff - "$at_stdout" || at_failed=:
2282at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:105"
2283$at_failed && at_fn_log_failure
2284$at_traceon; }
2285
2286
2287{ set +x
2288$as_echo "$at_srcdir/deb-format.at:116:
2289# Test mixed member (index 1)
2290cp pkg-templ.deb pkg-mixed-1-member.deb
2291ar ra debian-binary pkg-mixed-1-member.deb unknown
2292ar t pkg-mixed-1-member.deb
2293dpkg-deb -I pkg-mixed-1-member.deb
2294"
2295at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:116"
2296( $at_check_trace;
2297# Test mixed member (index 1)
2298cp pkg-templ.deb pkg-mixed-1-member.deb
2299ar ra debian-binary pkg-mixed-1-member.deb unknown
2300ar t pkg-mixed-1-member.deb
2301dpkg-deb -I pkg-mixed-1-member.deb
2302
2303) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2304at_status=$? at_failed=false
2305$at_check_filter
2306echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-mixed-1-member.deb' has premature member 'unknown' before 'control.tar', giving up
2307" | \
2308 $at_diff - "$at_stderr" || at_failed=:
2309echo >>"$at_stdout"; $as_echo "debian-binary
2310unknown
2311control.tar
2312data.tar
2313" | \
2314 $at_diff - "$at_stdout" || at_failed=:
2315at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:116"
2316$at_failed && at_fn_log_failure
2317$at_traceon; }
2318
2319
2320{ set +x
2321$as_echo "$at_srcdir/deb-format.at:129:
2322# Test mixed member (index 2)
2323cp pkg-templ.deb pkg-mixed-2-member.deb
2324ar ra control.tar pkg-mixed-2-member.deb unknown
2325ar t pkg-mixed-2-member.deb
2326dpkg-deb -c pkg-mixed-2-member.deb
2327"
2328at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:129"
2329( $at_check_trace;
2330# Test mixed member (index 2)
2331cp pkg-templ.deb pkg-mixed-2-member.deb
2332ar ra control.tar pkg-mixed-2-member.deb unknown
2333ar t pkg-mixed-2-member.deb
2334dpkg-deb -c pkg-mixed-2-member.deb
2335
2336) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2337at_status=$? at_failed=false
2338$at_check_filter
2339echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-mixed-2-member.deb' has premature member 'unknown' before 'data.tar', giving up
2340" | \
2341 $at_diff - "$at_stderr" || at_failed=:
2342echo >>"$at_stdout"; $as_echo "debian-binary
2343control.tar
2344unknown
2345data.tar
2346" | \
2347 $at_diff - "$at_stdout" || at_failed=:
2348at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:129"
2349$at_failed && at_fn_log_failure
2350$at_traceon; }
2351
2352
2353{ set +x
2354$as_echo "$at_srcdir/deb-format.at:142:
2355# Test swapped control and data members
2356cp pkg-templ.deb pkg-swap-members.deb
2357ar ma data.tar pkg-swap-members.deb control.tar
2358ar t pkg-swap-members.deb
2359dpkg-deb -I pkg-swap-members.deb
2360"
2361at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:142"
2362( $at_check_trace;
2363# Test swapped control and data members
2364cp pkg-templ.deb pkg-swap-members.deb
2365ar ma data.tar pkg-swap-members.deb control.tar
2366ar t pkg-swap-members.deb
2367dpkg-deb -I pkg-swap-members.deb
2368
2369) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2370at_status=$? at_failed=false
2371$at_check_filter
2372echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-swap-members.deb' has premature member 'data.tar' before 'control.tar', giving up
2373" | \
2374 $at_diff - "$at_stderr" || at_failed=:
2375echo >>"$at_stdout"; $as_echo "debian-binary
2376data.tar
2377control.tar
2378" | \
2379 $at_diff - "$at_stdout" || at_failed=:
2380at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:142"
2381$at_failed && at_fn_log_failure
2382$at_traceon; }
2383
2384
2385{ set +x
2386$as_echo "$at_srcdir/deb-format.at:154:
2387# Test extra member
2388cp pkg-templ.deb pkg-extra-member.deb
2389ar q pkg-extra-member.deb unknown
2390ar t pkg-extra-member.deb
2391# XXX: Ideally we would have no need to strip trailing spaces.
2392dpkg-deb -I pkg-extra-member.deb | sed -e 's/ *\$//'
2393"
2394at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:154"
2395( $at_check_trace;
2396# Test extra member
2397cp pkg-templ.deb pkg-extra-member.deb
2398ar q pkg-extra-member.deb unknown
2399ar t pkg-extra-member.deb
2400# XXX: Ideally we would have no need to strip trailing spaces.
2401dpkg-deb -I pkg-extra-member.deb | sed -e 's/ *$//'
2402
2403) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2404at_status=$? at_failed=false
2405$at_check_filter
2406at_fn_diff_devnull "$at_stderr" || at_failed=:
2407echo >>"$at_stdout"; $as_echo "debian-binary
2408control.tar
2409data.tar
2410unknown
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
2415 Version: 0.0-1
2416 Section: test
2417 Priority: extra
2418 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2419 Architecture: all
2420 Description: test package - deb format support
2421" | \
2422 $at_diff - "$at_stdout" || at_failed=:
2423at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:154"
2424$at_failed && at_fn_log_failure
2425$at_traceon; }
2426
2427
2428{ set +x
2429$as_echo "$at_srcdir/deb-format.at:177:
2430# Test _ member
2431cp pkg-templ.deb pkg-under-member.deb
2432ar ra debian-binary pkg-under-member.deb _ignore
2433ar t pkg-under-member.deb
2434# XXX: Ideally we would have no need to strip trailing spaces.
2435dpkg-deb -I pkg-under-member.deb | sed -e 's/ *\$//'
2436"
2437at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:177"
2438( $at_check_trace;
2439# Test _ member
2440cp pkg-templ.deb pkg-under-member.deb
2441ar ra debian-binary pkg-under-member.deb _ignore
2442ar t pkg-under-member.deb
2443# XXX: Ideally we would have no need to strip trailing spaces.
2444dpkg-deb -I pkg-under-member.deb | sed -e 's/ *$//'
2445
2446) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2447at_status=$? at_failed=false
2448$at_check_filter
2449at_fn_diff_devnull "$at_stderr" || at_failed=:
2450echo >>"$at_stdout"; $as_echo "debian-binary
2451_ignore
2452control.tar
2453data.tar
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
2458 Version: 0.0-1
2459 Section: test
2460 Priority: extra
2461 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2462 Architecture: all
2463 Description: test package - deb format support
2464" | \
2465 $at_diff - "$at_stdout" || at_failed=:
2466at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:177"
2467$at_failed && at_fn_log_failure
2468$at_traceon; }
2469
2470
2471{ set +x
2472$as_echo "$at_srcdir/deb-format.at:200:
2473# Test data.tar.bad member
2474dd if=/dev/zero of=data.tar.bad bs=1K count=4 status=none
2475ar rc pkg-data-bad.deb debian-binary control.tar.gz data.tar.bad
2476ar t pkg-data-bad.deb
2477dpkg-deb -c pkg-data-bad.deb
2478"
2479at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:200"
2480( $at_check_trace;
2481# Test data.tar.bad member
2482dd if=/dev/zero of=data.tar.bad bs=1K count=4 status=none
2483ar rc pkg-data-bad.deb debian-binary control.tar.gz data.tar.bad
2484ar t pkg-data-bad.deb
2485dpkg-deb -c pkg-data-bad.deb
2486
2487) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2488at_status=$? at_failed=false
2489$at_check_filter
2490echo >>"$at_stderr"; $as_echo "dpkg-deb: error: archive 'pkg-data-bad.deb' uses unknown compression for member 'data.tar.bad', giving up
2491" | \
2492 $at_diff - "$at_stderr" || at_failed=:
2493echo >>"$at_stdout"; $as_echo "debian-binary
2494control.tar.gz
2495data.tar.bad
2496" | \
2497 $at_diff - "$at_stdout" || at_failed=:
2498at_fn_check_status 2 $at_status "$at_srcdir/deb-format.at:200"
2499$at_failed && at_fn_log_failure
2500$at_traceon; }
2501
2502
2503{ set +x
2504$as_echo "$at_srcdir/deb-format.at:212:
2505# Test control.tar member
2506ar rc pkg-control-none.deb debian-binary control.tar data.tar
2507ar t pkg-control-none.deb
2508# XXX: Ideally we would have no need to strip trailing spaces.
2509dpkg-deb -I pkg-control-none.deb | sed -e 's/ *\$//'
2510"
2511at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:212"
2512( $at_check_trace;
2513# Test control.tar member
2514ar rc pkg-control-none.deb debian-binary control.tar data.tar
2515ar t pkg-control-none.deb
2516# XXX: Ideally we would have no need to strip trailing spaces.
2517dpkg-deb -I pkg-control-none.deb | sed -e 's/ *$//'
2518
2519) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2520at_status=$? at_failed=false
2521$at_check_filter
2522at_fn_diff_devnull "$at_stderr" || at_failed=:
2523echo >>"$at_stdout"; $as_echo "debian-binary
2524control.tar
2525data.tar
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
2530 Version: 0.0-1
2531 Section: test
2532 Priority: extra
2533 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2534 Architecture: all
2535 Description: test package - deb format support
2536" | \
2537 $at_diff - "$at_stdout" || at_failed=:
2538at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:212"
2539$at_failed && at_fn_log_failure
2540$at_traceon; }
2541
2542
2543{ set +x
2544$as_echo "$at_srcdir/deb-format.at:233:
2545# Test control.tar.xz member
2546ar rc pkg-control-xz.deb debian-binary control.tar.xz data.tar.xz
2547ar t pkg-control-xz.deb
2548dpkg-deb -c pkg-control-xz.deb
2549"
2550at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:233"
2551( $at_check_trace;
2552# Test control.tar.xz member
2553ar rc pkg-control-xz.deb debian-binary control.tar.xz data.tar.xz
2554ar t pkg-control-xz.deb
2555dpkg-deb -c pkg-control-xz.deb
2556
2557) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2558at_status=$? at_failed=false
2559$at_check_filter
2560at_fn_diff_devnull "$at_stderr" || at_failed=:
2561echo >>"$at_stdout"; $as_echo "debian-binary
2562control.tar.xz
2563data.tar.xz
2564drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2565-rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2566" | \
2567 $at_diff - "$at_stdout" || at_failed=:
2568at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:233"
2569$at_failed && at_fn_log_failure
2570$at_traceon; }
2571
2572
2573{ set +x
2574$as_echo "$at_srcdir/deb-format.at:245:
2575# Test data.tar member
2576ar rc pkg-data-none.deb debian-binary control.tar.gz data.tar
2577ar t pkg-data-none.deb
2578dpkg-deb -c pkg-data-none.deb
2579"
2580at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:245"
2581( $at_check_trace;
2582# Test data.tar member
2583ar rc pkg-data-none.deb debian-binary control.tar.gz data.tar
2584ar t pkg-data-none.deb
2585dpkg-deb -c pkg-data-none.deb
2586
2587) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2588at_status=$? at_failed=false
2589$at_check_filter
2590at_fn_diff_devnull "$at_stderr" || at_failed=:
2591echo >>"$at_stdout"; $as_echo "debian-binary
2592control.tar.gz
2593data.tar
2594drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2595-rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2596" | \
2597 $at_diff - "$at_stdout" || at_failed=:
2598at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:245"
2599$at_failed && at_fn_log_failure
2600$at_traceon; }
2601
2602
2603{ set +x
2604$as_echo "$at_srcdir/deb-format.at:257:
2605# Test data.tar.gz member
2606ar rc pkg-data-gz.deb debian-binary control.tar.gz data.tar.gz
2607ar t pkg-data-gz.deb
2608dpkg-deb -c pkg-data-gz.deb
2609"
2610at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:257"
2611( $at_check_trace;
2612# Test data.tar.gz member
2613ar rc pkg-data-gz.deb debian-binary control.tar.gz data.tar.gz
2614ar t pkg-data-gz.deb
2615dpkg-deb -c pkg-data-gz.deb
2616
2617) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2618at_status=$? at_failed=false
2619$at_check_filter
2620at_fn_diff_devnull "$at_stderr" || at_failed=:
2621echo >>"$at_stdout"; $as_echo "debian-binary
2622control.tar.gz
2623data.tar.gz
2624drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2625-rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2626" | \
2627 $at_diff - "$at_stdout" || at_failed=:
2628at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:257"
2629$at_failed && at_fn_log_failure
2630$at_traceon; }
2631
2632
2633{ set +x
2634$as_echo "$at_srcdir/deb-format.at:269:
2635# Test data.tar.xz member
2636ar rc pkg-data-xz.deb debian-binary control.tar.gz data.tar.xz
2637ar t pkg-data-xz.deb
2638dpkg-deb -c pkg-data-xz.deb
2639"
2640at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:269"
2641( $at_check_trace;
2642# Test data.tar.xz member
2643ar rc pkg-data-xz.deb debian-binary control.tar.gz data.tar.xz
2644ar t pkg-data-xz.deb
2645dpkg-deb -c pkg-data-xz.deb
2646
2647) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2648at_status=$? at_failed=false
2649$at_check_filter
2650at_fn_diff_devnull "$at_stderr" || at_failed=:
2651echo >>"$at_stdout"; $as_echo "debian-binary
2652control.tar.gz
2653data.tar.xz
2654drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2655-rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2656" | \
2657 $at_diff - "$at_stdout" || at_failed=:
2658at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:269"
2659$at_failed && at_fn_log_failure
2660$at_traceon; }
2661
2662
2663{ set +x
2664$as_echo "$at_srcdir/deb-format.at:281:
2665# Test data.tar.bz2 member
2666ar rc pkg-data-bz2.deb debian-binary control.tar.gz data.tar.bz2
2667ar t pkg-data-bz2.deb
2668dpkg-deb -c pkg-data-bz2.deb
2669"
2670at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:281"
2671( $at_check_trace;
2672# Test data.tar.bz2 member
2673ar rc pkg-data-bz2.deb debian-binary control.tar.gz data.tar.bz2
2674ar t pkg-data-bz2.deb
2675dpkg-deb -c pkg-data-bz2.deb
2676
2677) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2678at_status=$? at_failed=false
2679$at_check_filter
2680at_fn_diff_devnull "$at_stderr" || at_failed=:
2681echo >>"$at_stdout"; $as_echo "debian-binary
2682control.tar.gz
2683data.tar.bz2
2684drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2685-rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2686" | \
2687 $at_diff - "$at_stdout" || at_failed=:
2688at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:281"
2689$at_failed && at_fn_log_failure
2690$at_traceon; }
2691
2692
2693{ set +x
2694$as_echo "$at_srcdir/deb-format.at:293:
2695# Test data.tar.lzma member
2696ar rc pkg-data-lzma.deb debian-binary control.tar.gz data.tar.lzma
2697ar t pkg-data-lzma.deb
2698dpkg-deb -c pkg-data-lzma.deb
2699"
2700at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:293"
2701( $at_check_trace;
2702# Test data.tar.lzma member
2703ar rc pkg-data-lzma.deb debian-binary control.tar.gz data.tar.lzma
2704ar t pkg-data-lzma.deb
2705dpkg-deb -c pkg-data-lzma.deb
2706
2707) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2708at_status=$? at_failed=false
2709$at_check_filter
2710at_fn_diff_devnull "$at_stderr" || at_failed=:
2711echo >>"$at_stdout"; $as_echo "debian-binary
2712control.tar.gz
2713data.tar.lzma
2714drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2715-rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2716" | \
2717 $at_diff - "$at_stdout" || at_failed=:
2718at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:293"
2719$at_failed && at_fn_log_failure
2720$at_traceon; }
2721
2722
2723{ set +x
2724$as_echo "$at_srcdir/deb-format.at:305:
2725# Test non-uniform data.tar/control.tar member compression
2726ar rc pkg-mixed-comp.deb debian-binary control.tar.xz data.tar.gz
2727ar t pkg-mixed-comp.deb
2728# XXX: Ideally we would have no need to strip trailing spaces.
2729dpkg-deb -I pkg-mixed-comp.deb | sed -e 's/ *\$//'
2730dpkg-deb -c pkg-mixed-comp.deb
2731"
2732at_fn_check_prepare_notrace 'an embedded newline' "deb-format.at:305"
2733( $at_check_trace;
2734# Test non-uniform data.tar/control.tar member compression
2735ar rc pkg-mixed-comp.deb debian-binary control.tar.xz data.tar.gz
2736ar t pkg-mixed-comp.deb
2737# XXX: Ideally we would have no need to strip trailing spaces.
2738dpkg-deb -I pkg-mixed-comp.deb | sed -e 's/ *$//'
2739dpkg-deb -c pkg-mixed-comp.deb
2740
2741) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2742at_status=$? at_failed=false
2743$at_check_filter
2744at_fn_diff_devnull "$at_stderr" || at_failed=:
2745echo >>"$at_stdout"; $as_echo "debian-binary
2746control.tar.xz
2747data.tar.gz
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
2752 Version: 0.0-1
2753 Section: test
2754 Priority: extra
2755 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2756 Architecture: all
2757 Description: test package - deb format support
2758drwxr-xr-x root/root 0 1970-01-01 00:00 ./
2759-rw-r--r-- root/root 5 1970-01-01 00:00 ./file-templ
2760" | \
2761 $at_diff - "$at_stdout" || at_failed=:
2762at_fn_check_status 0 $at_status "$at_srcdir/deb-format.at:305"
2763$at_failed && at_fn_log_failure
2764$at_traceon; }
2765
2766
2767 set +x
2768 $at_times_p && times >"$at_times_file"
2769) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2770read at_status <"$at_status_file"
2771#AT_STOP_2
2772#AT_START_3
2773at_fn_group_banner 3 'deb-content.at:3' \
2774 "dpkg-deb .deb conffiles" " " 1
2775at_xfail=no
2776(
2777 $as_echo "3. $at_setup_line: testing $at_desc ..."
2778 $at_traceon
2779
2780
2781
2782
2783 mkdir -p 'pkg-conff-dupe/DEBIAN'
2784
2785 cat >'pkg-conff-dupe/DEBIAN/control' <<CTRL_TEMPL
2786Package: pkg-conff-dupe
2787Version: 0.0-1
2788Section: test
2789Priority: extra
2790Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2791Architecture: all
2792Description: test package
2793CTRL_TEMPL
2794
2795
2796 mkdir -p 'pkg-conff-dupe/DEBIAN'
2797
2798 cat >'pkg-conff-dupe/DEBIAN/conffiles' <<CTRL_TEMPL
2799/test-conffile-1
2800/test-conffile-2
2801/test-conffile-1
2802CTRL_TEMPL
2803
2804cat >pkg-conff-dupe/test-conffile-1 <<'_ATEOF'
2805test init
2806_ATEOF
2807
2808cat >pkg-conff-dupe/test-conffile-2 <<'_ATEOF'
2809test init
2810_ATEOF
2811
2812{ set +x
2813$as_echo "$at_srcdir/deb-content.at:14:
2814# Duplicate conffile entries should produce a warning.
2815dpkg-deb -b pkg-conff-dupe
2816"
2817at_fn_check_prepare_notrace 'an embedded newline' "deb-content.at:14"
2818( $at_check_trace;
2819# Duplicate conffile entries should produce a warning.
2820dpkg-deb -b pkg-conff-dupe
2821
2822) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2823at_status=$? at_failed=false
2824$at_check_filter
2825echo >>"$at_stderr"; $as_echo "dpkg-deb: warning: conffile name '/test-conffile-1' is duplicated
2826dpkg-deb: warning: ignoring 1 warning about the control file(s)
2827" | \
2828 $at_diff - "$at_stderr" || at_failed=:
2829echo stdout:; cat "$at_stdout"
2830at_fn_check_status 0 $at_status "$at_srcdir/deb-content.at:14"
2831$at_failed && at_fn_log_failure
2832$at_traceon; }
2833
2834
2835
2836 mkdir -p 'pkg-conff-noel/DEBIAN'
2837
2838 cat >'pkg-conff-noel/DEBIAN/control' <<CTRL_TEMPL
2839Package: pkg-conff-noel
2840Version: 0.0-1
2841Section: test
2842Priority: extra
2843Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2844Architecture: all
2845Description: test package
2846CTRL_TEMPL
2847
2848printf "/test-conffile-1" >"pkg-conff-noel/DEBIAN/conffiles"
2849cat >pkg-conff-noel/test-conffile-1 <<'_ATEOF'
2850test init
2851_ATEOF
2852
2853{ set +x
2854$as_echo "$at_srcdir/deb-content.at:25:
2855# Conffiles need a final newline to guarantee there's been no accidental
2856# file truncation.
2857dpkg-deb -b pkg-conff-noel pkg-conff-noel.deb
2858"
2859at_fn_check_prepare_notrace 'an embedded newline' "deb-content.at:25"
2860( $at_check_trace;
2861# Conffiles need a final newline to guarantee there's been no accidental
2862# file truncation.
2863dpkg-deb -b pkg-conff-noel pkg-conff-noel.deb
2864
2865) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2866at_status=$? at_failed=false
2867$at_check_filter
2868echo >>"$at_stderr"; $as_echo "dpkg-deb: error: conffile name '/test-conffile-1' is too long, or missing final newline
2869" | \
2870 $at_diff - "$at_stderr" || at_failed=:
2871echo stdout:; cat "$at_stdout"
2872at_fn_check_status 2 $at_status "$at_srcdir/deb-content.at:25"
2873$at_failed && at_fn_log_failure
2874$at_traceon; }
2875
2876
2877
2878 mkdir -p 'pkg-deb-newline/DEBIAN'
2879
2880 cat >'pkg-deb-newline/DEBIAN/control' <<CTRL_TEMPL
2881Package: pkg-deb-newline
2882Version: 0.0-1
2883Section: test
2884Priority: extra
2885Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2886Architecture: all
2887Description: test package
2888CTRL_TEMPL
2889
2890touch 'pkg-deb-newline/file
2891newline'
2892{ set +x
2893$as_echo "$at_srcdir/deb-content.at:35:
2894# Cannot create package with newlines in filenames.
2895dpkg-deb -b pkg-deb-newline
2896"
2897at_fn_check_prepare_notrace 'an embedded newline' "deb-content.at:35"
2898( $at_check_trace;
2899# Cannot create package with newlines in filenames.
2900dpkg-deb -b pkg-deb-newline
2901
2902) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2903at_status=$? at_failed=false
2904$at_check_filter
2905echo >>"$at_stderr"; $as_echo "dpkg-deb: error: newline not allowed in pathname './file
2906newline'
2907" | \
2908 $at_diff - "$at_stderr" || at_failed=:
2909echo stdout:; cat "$at_stdout"
2910at_fn_check_status 2 $at_status "$at_srcdir/deb-content.at:35"
2911$at_failed && at_fn_log_failure
2912$at_traceon; }
2913
2914
2915 set +x
2916 $at_times_p && times >"$at_times_file"
2917) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2918read at_status <"$at_status_file"
2919#AT_STOP_3
2920#AT_START_4
2921at_fn_group_banner 4 'deb-fields.at:3' \
2922 "dpkg-deb .deb fields" " " 1
2923at_xfail=no
2924(
2925 $as_echo "4. $at_setup_line: testing $at_desc ..."
2926 $at_traceon
2927
2928
2929
2930
2931 mkdir -p 'pkg-package-type-void/DEBIAN'
2932
2933 cat >'pkg-package-type-void/DEBIAN/control' <<CTRL_TEMPL
2934Package: pkg-package-type-void
2935Version: 0.0-1
2936Section: test
2937Priority: extra
2938Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2939Architecture: all
2940Description: test package
2941CTRL_TEMPL
2942
2943{ set +x
2944$as_echo "$at_srcdir/deb-fields.at:7:
2945dpkg-deb -b pkg-package-type-void
2946# Test absence of Package-Type field.
2947test -z \"\$(dpkg-deb -f pkg-package-type-void.deb Package-Type)\"
2948"
2949at_fn_check_prepare_notrace 'a $(...) command substitution' "deb-fields.at:7"
2950( $at_check_trace;
2951dpkg-deb -b pkg-package-type-void
2952# Test absence of Package-Type field.
2953test -z "$(dpkg-deb -f pkg-package-type-void.deb Package-Type)"
2954
2955) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2956at_status=$? at_failed=false
2957$at_check_filter
2958at_fn_diff_devnull "$at_stderr" || at_failed=:
2959echo stdout:; cat "$at_stdout"
2960at_fn_check_status 0 $at_status "$at_srcdir/deb-fields.at:7"
2961$at_failed && at_fn_log_failure
2962$at_traceon; }
2963
2964
2965
2966 mkdir -p 'pkg-package-type-use/DEBIAN'
2967
2968 cat >'pkg-package-type-use/DEBIAN/control' <<CTRL_TEMPL
2969Package: pkg-package-type-use
2970Version: 0.0-1
2971Section: test
2972Priority: extra
2973Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
2974Architecture: all
2975Description: test package
2976CTRL_TEMPL
2977
2978
2979 sed -i -e '/^Package:/aPackage-Type: udeb' 'pkg-package-type-use/DEBIAN/control'
2980
2981{ set +x
2982$as_echo "$at_srcdir/deb-fields.at:15:
2983dpkg-deb -b pkg-package-type-use
2984# Test presence of Package-Type field.
2985test -n \"\$(dpkg-deb -f pkg-package-type-use.deb Package-Type)\"
2986"
2987at_fn_check_prepare_notrace 'a $(...) command substitution' "deb-fields.at:15"
2988( $at_check_trace;
2989dpkg-deb -b pkg-package-type-use
2990# Test presence of Package-Type field.
2991test -n "$(dpkg-deb -f pkg-package-type-use.deb Package-Type)"
2992
2993) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2994at_status=$? at_failed=false
2995$at_check_filter
2996at_fn_diff_devnull "$at_stderr" || at_failed=:
2997echo stdout:; cat "$at_stdout"
2998at_fn_check_status 0 $at_status "$at_srcdir/deb-fields.at:15"
2999$at_failed && at_fn_log_failure
3000$at_traceon; }
3001
3002
3003 set +x
3004 $at_times_p && times >"$at_times_file"
3005) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3006read at_status <"$at_status_file"
3007#AT_STOP_4
3008#AT_START_5
3009at_fn_group_banner 5 'deb-split.at:3' \
3010 "dpkg-split options" " " 2
3011at_xfail=no
3012(
3013 $as_echo "5. $at_setup_line: testing $at_desc ..."
3014 $at_traceon
3015
3016
3017{ set +x
3018$as_echo "$at_srcdir/deb-split.at:5: dpkg-split --help"
3019at_fn_check_prepare_trace "deb-split.at:5"
3020( $at_check_trace; dpkg-split --help
3021) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3022at_status=$? at_failed=false
3023$at_check_filter
3024at_fn_diff_devnull "$at_stderr" || at_failed=:
3025echo stdout:; cat "$at_stdout"
3026at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:5"
3027$at_failed && at_fn_log_failure
3028$at_traceon; }
3029
3030 set +x
3031 $at_times_p && times >"$at_times_file"
3032) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3033read at_status <"$at_status_file"
3034#AT_STOP_5
3035#AT_START_6
3036at_fn_group_banner 6 'deb-split.at:8' \
3037 "dpkg-split .deb format" " " 2
3038at_xfail=no
3039(
3040 $as_echo "6. $at_setup_line: testing $at_desc ..."
3041 $at_traceon
3042
3043
3044
3045
3046 mkdir -p 'pkg-split/DEBIAN'
3047
3048 cat >'pkg-split/DEBIAN/control' <<CTRL_TEMPL
3049Package: pkg-split
3050Version: 0.0-1
3051Section: test
3052Priority: extra
3053Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
3054Architecture: all
3055Description: test package
3056CTRL_TEMPL
3057
3058
3059 sed -i -e 's/^Description:.*$/& - normal package to be split/' 'pkg-split/DEBIAN/control'
3060
3061{ set +x
3062$as_echo "$at_srcdir/deb-split.at:14:
3063# Initialize the template package
3064chmod -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.
3067yes 2>/dev/null | dd of=pkg-split/data-file bs=1024 count=1024 status=none
3068find pkg-split | xargs touch -t 197001010100.00
3069\$ASROOT dpkg-deb -b -Znone pkg-split >/dev/null
3070"
3071at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:14"
3072( $at_check_trace;
3073# Initialize the template package
3074chmod -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.
3077yes 2>/dev/null | dd of=pkg-split/data-file bs=1024 count=1024 status=none
3078find pkg-split | xargs touch -t 197001010100.00
3079$ASROOT dpkg-deb -b -Znone pkg-split >/dev/null
3080
3081) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3082at_status=$? at_failed=false
3083$at_check_filter
3084at_fn_diff_devnull "$at_stderr" || at_failed=:
3085at_fn_diff_devnull "$at_stdout" || at_failed=:
3086at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:14"
3087$at_failed && at_fn_log_failure
3088$at_traceon; }
3089
3090
3091{ set +x
3092$as_echo "$at_srcdir/deb-split.at:24:
3093# Test splitting a package (in 3 parts: 400 KiB + 400 KiB + 224 KiB)
3094dpkg-split -S 400 -s pkg-split.deb pkg-split-part
3095test -f pkg-split-part.1of3.deb
3096test -f pkg-split-part.2of3.deb
3097test -f pkg-split-part.3of3.deb
3098"
3099at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:24"
3100( $at_check_trace;
3101# Test splitting a package (in 3 parts: 400 KiB + 400 KiB + 224 KiB)
3102dpkg-split -S 400 -s pkg-split.deb pkg-split-part
3103test -f pkg-split-part.1of3.deb
3104test -f pkg-split-part.2of3.deb
3105test -f pkg-split-part.3of3.deb
3106
3107) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3108at_status=$? at_failed=false
3109$at_check_filter
3110at_fn_diff_devnull "$at_stderr" || at_failed=:
3111echo >>"$at_stdout"; $as_echo "Splitting package pkg-split into 3 parts: 1 2 3 done
3112" | \
3113 $at_diff - "$at_stdout" || at_failed=:
3114at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:24"
3115$at_failed && at_fn_log_failure
3116$at_traceon; }
3117
3118
3119DEB_SPLIT_MD5SUM=a4042d88f6da3da8ab2ab191a290ab66
3120
3121{ set +x
3122$as_echo "$at_srcdir/deb-split.at:35:
3123# Test getting information about the split parts (parsing verification)
3124dpkg-split -I pkg-split-part.1of3.deb
3125dpkg-split -I pkg-split-part.2of3.deb
3126dpkg-split -I pkg-split-part.3of3.deb
3127"
3128at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:35"
3129( $at_check_trace;
3130# Test getting information about the split parts (parsing verification)
3131dpkg-split -I pkg-split-part.1of3.deb
3132dpkg-split -I pkg-split-part.2of3.deb
3133dpkg-split -I pkg-split-part.3of3.deb
3134
3135) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3136at_status=$? at_failed=false
3137$at_check_filter
3138at_fn_diff_devnull "$at_stderr" || at_failed=:
3139echo >>"$at_stdout"; $as_echo "pkg-split-part.1of3.deb:
3140 Part format version: 2.1
3141 Part of package: pkg-split
3142 ... version: 0.0-1
3143 ... architecture: all
3144 ... MD5 checksum: $DEB_SPLIT_MD5SUM
3145 ... length: 1055178 bytes
3146 ... split every: 408576 bytes
3147 Part number: 1/3
3148 Part length: 408576 bytes
3149 Part offset: 0 bytes
3150 Part file size (used portion): 408780 bytes
3151
3152pkg-split-part.2of3.deb:
3153 Part format version: 2.1
3154 Part of package: pkg-split
3155 ... version: 0.0-1
3156 ... architecture: all
3157 ... MD5 checksum: $DEB_SPLIT_MD5SUM
3158 ... length: 1055178 bytes
3159 ... split every: 408576 bytes
3160 Part number: 2/3
3161 Part length: 408576 bytes
3162 Part offset: 408576 bytes
3163 Part file size (used portion): 408780 bytes
3164
3165pkg-split-part.3of3.deb:
3166 Part format version: 2.1
3167 Part of package: pkg-split
3168 ... version: 0.0-1
3169 ... architecture: all
3170 ... MD5 checksum: $DEB_SPLIT_MD5SUM
3171 ... length: 1055178 bytes
3172 ... split every: 408576 bytes
3173 Part number: 3/3
3174 Part length: 238026 bytes
3175 Part offset: 817152 bytes
3176 Part file size (used portion): 238230 bytes
3177
3178" | \
3179 $at_diff - "$at_stdout" || at_failed=:
3180at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:35"
3181$at_failed && at_fn_log_failure
3182$at_traceon; }
3183
3184
3185{ set +x
3186$as_echo "$at_srcdir/deb-split.at:81:
3187# Test joining the split parts back together
3188dpkg-split -o pkg-joined.deb -j pkg-split-part.*.deb
3189cmp pkg-split.deb pkg-joined.deb
3190"
3191at_fn_check_prepare_notrace 'an embedded newline' "deb-split.at:81"
3192( $at_check_trace;
3193# Test joining the split parts back together
3194dpkg-split -o pkg-joined.deb -j pkg-split-part.*.deb
3195cmp pkg-split.deb pkg-joined.deb
3196
3197) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3198at_status=$? at_failed=false
3199$at_check_filter
3200at_fn_diff_devnull "$at_stderr" || at_failed=:
3201echo >>"$at_stdout"; $as_echo "Putting package pkg-split together from 3 parts: 1 2 3 done
3202" | \
3203 $at_diff - "$at_stdout" || at_failed=:
3204at_fn_check_status 0 $at_status "$at_srcdir/deb-split.at:81"
3205$at_failed && at_fn_log_failure
3206$at_traceon; }
3207
3208
3209 set +x
3210 $at_times_p && times >"$at_times_file"
3211) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3212read at_status <"$at_status_file"
3213#AT_STOP_6