1 #!/bin/sh -- # no runable script, just for vi
5 # we all like colorful messages
6 if [ "$MSGCOLOR" != 'NO' ]; then
7 if ! expr match
"$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev
/null
; then
13 if [ "$MSGCOLOR" != 'NO' ]; then
14 CERROR
="\033[1;31m" # red
15 CWARNING
="\033[1;33m" # yellow
16 CMSG
="\033[1;32m" # green
17 CINFO
="\033[1;96m" # light blue
18 CDEBUG
="\033[1;94m" # blue
19 CNORMAL
="\033[0;39m" # default system console color
20 CDONE
="\033[1;32m" # green
21 CPASS
="\033[1;32m" # green
22 CFAIL
="\033[1;31m" # red
23 CCMD
="\033[1;35m" # pink
26 msgdie
() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; }
27 msgwarn
() { echo "${CWARNING}W: $1${CNORMAL}" >&2; }
28 msgmsg
() { echo "${CMSG}$1${CNORMAL}"; }
29 msginfo
() { echo "${CINFO}I: $1${CNORMAL}"; }
30 msgdebug
() { echo "${CDEBUG}D: $1${CNORMAL}"; }
31 msgdone
() { echo "${CDONE}DONE${CNORMAL}"; }
32 msgnwarn
() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; }
33 msgnmsg
() { echo -n "${CMSG}$1${CNORMAL}"; }
34 msgninfo
() { echo -n "${CINFO}I: $1${CNORMAL}"; }
35 msgndebug
() { echo -n "${CDEBUG}D: $1${CNORMAL}"; }
38 echo -n "${CINFO}$1${CCMD} "
39 echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} "
41 if [ -n "$1" ]; then shift; else break; fi
43 echo -n "…${CNORMAL} "
45 msgpass
() { echo "${CPASS}PASS${CNORMAL}"; }
46 msgskip
() { echo "${CWARNING}SKIP${CNORMAL}" >&2; }
48 if [ $# -gt 0 ]; then echo "${CFAIL}FAIL: $*${CNORMAL}" >&2;
49 else echo "${CFAIL}FAIL${CNORMAL}" >&2; fi
50 EXIT_CODE
=$((EXIT_CODE+1));
53 # enable / disable Debugging
54 MSGLEVEL
=${MSGLEVEL:-3}
55 if [ $MSGLEVEL -le 0 ]; then
58 if [ $MSGLEVEL -le 1 ]; then
62 if [ $MSGLEVEL -le 2 ]; then
66 msgpass
() { echo -n " ${CPASS}P${CNORMAL}"; }
67 msgskip
() { echo -n " ${CWARNING}S${CNORMAL}" >&2; }
68 if [ -n "$CFAIL" ]; then
69 msgfail
() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE
=$((EXIT_CODE+1)); }
71 msgfail
() { echo -n " ###FAILED###" >&2; EXIT_CODE
=$((EXIT_CODE+1)); }
74 if [ $MSGLEVEL -le 3 ]; then
78 if [ $MSGLEVEL -le 4 ]; then
83 if [ "$1" = "debug" -a $MSGLEVEL -le 4 ] ||
84 [ "$1" = "info" -a $MSGLEVEL -le 3 ] ||
85 [ "$1" = "msg" -a $MSGLEVEL -le 2 ] ||
86 [ "$1" = "warn" -a $MSGLEVEL -le 1 ] ||
87 [ "$1" = "die" -a $MSGLEVEL -le 0 ]; then
90 echo "${CDONE}DONE${CNORMAL}";
95 msgdebug
"Executing: ${CCMD}$*${CDEBUG} "
96 local CMD
="${BUILDDIRECTORY}/$1"
97 if [ "$1" = 'sh' ]; then CMD
='sh'; fi
99 if [ -f .
/aptconfig.conf
]; then
100 MALLOC_PERTURB_
=21 MALLOC_CHECK_
=2 APT_CONFIG
=aptconfig.conf LD_LIBRARY_PATH
=${BUILDDIRECTORY} $CMD "$@"
101 elif [ -f ..
/aptconfig.conf
]; then
102 MALLOC_PERTURB_
=21 MALLOC_CHECK_
=2 APT_CONFIG
=..
/aptconfig.conf LD_LIBRARY_PATH
=${BUILDDIRECTORY} $CMD "$@"
104 MALLOC_PERTURB_
=21 MALLOC_CHECK_
=2 LD_LIBRARY_PATH
=${BUILDDIRECTORY} $CMD "$@"
107 aptconfig
() { runapt apt
-config "$@"; }
108 aptcache
() { runapt apt
-cache "$@"; }
109 aptcdrom
() { runapt apt
-cdrom "$@"; }
110 aptget
() { runapt apt
-get "$@"; }
111 aptftparchive
() { runapt apt
-ftparchive "$@"; }
112 aptkey
() { runapt apt
-key "$@"; }
113 aptmark
() { runapt apt
-mark "$@"; }
114 apt
() { runapt apt
"$@"; }
116 LD_LIBRARY_PATH
=${APTHELPERBINDIR} ${APTHELPERBINDIR}/apt
-helper "$@";
119 LD_LIBRARY_PATH
=${APTWEBSERVERBINDIR} ${APTWEBSERVERBINDIR}/aptwebserver
"$@";
122 command dpkg
--root=${TMPWORKINGDIRECTORY}/rootdir
--force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir
/var
/log
/dpkg.log
"$@"
124 dpkgcheckbuilddeps
() {
125 command dpkg
-checkbuilddeps --admindir=${TMPWORKINGDIRECTORY}/rootdir
/var
/lib
/dpkg
"$@"
128 if [ -f .
/aptconfig.conf
]; then
129 APT_CONFIG
=aptconfig.conf LD_LIBRARY_PATH
=${BUILDDIRECTORY} command aptitude
"$@"
130 elif [ -f ..
/aptconfig.conf
]; then
131 APT_CONFIG
=..
/aptconfig.conf LD_LIBRARY_PATH
=${BUILDDIRECTORY} command aptitude
"$@"
133 LD_LIBRARY_PATH
=${BUILDDIRECTORY} command aptitude
"$@"
138 APT_CONFIG
=aptconfig.conf LD_LIBRARY_PATH
=${BUILDDIRECTORY} command gdb
${BUILDDIRECTORY}/$1 --args "$@"
141 LD_LIBRARY_PATH
=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods
/http
144 # see apt-key for the whole trickery. Setup is done in setupenvironment
145 command gpg
--ignore-time-conflict --no-options --no-default-keyring \
146 --homedir "${TMPWORKINGDIRECTORY}/gnupghome" \
147 --no-auto-check-trustdb --trust-model always \
152 # error if we about to overflow, but ...
153 # "255 failures ought to be enough for everybody"
154 if [ $EXIT_CODE -gt 255 ]; then
155 msgdie
"Total failure count $EXIT_CODE too big"
157 exit $((EXIT_CODE <= 255 ? EXIT_CODE : 255));
160 shellsetedetector
() {
162 if [ "$exit_status" != '0' ]; then
163 echo >&2 "${CERROR}E: Looks like the testcases ended prematurely with exitcode: ${exit_status}${CNORMAL}"
164 if [ "$EXIT_CODE" = '0' ]; then
165 EXIT_CODE
="$exit_status"
171 if [ "$1" = 'prefix' ]; then
172 CURRENTTRAP
="$2 $CURRENTTRAP"
174 CURRENTTRAP
="$CURRENTTRAP $1"
176 trap "shellsetedetector; $CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
180 TMPWORKINGDIRECTORY
=$(mktemp -d)
181 TESTDIRECTORY
=$(readlink -f $(dirname $0))
182 msgninfo
"Preparing environment for ${CCMD}$(basename $0)${CINFO} in ${TMPWORKINGDIRECTORY}… "
184 # allow overriding the default BUILDDIR location
185 BUILDDIRECTORY
=${APT_INTEGRATION_TESTS_BUILD_DIR:-"${TESTDIRECTORY}/../../build/bin"}
186 METHODSDIR
=${APT_INTEGRATION_TESTS_METHODS_DIR:-"${BUILDDIRECTORY}/methods"}
187 APTHELPERBINDIR
=${APT_INTEGRATION_TESTS_LIBEXEC_DIR:-"${BUILDDIRECTORY}"}
188 APTWEBSERVERBINDIR
=${APT_INTEGRATION_TESTS_WEBSERVER_BIN_DIR:-"${BUILDDIRECTORY}"}
189 test -x "${BUILDDIRECTORY}/apt-get" || msgdie
"You need to build tree first"
192 addtrap
"cd /; rm -rf $TMPWORKINGDIRECTORY;"
193 cd $TMPWORKINGDIRECTORY
194 mkdir rootdir aptarchive keys
196 mkdir -p etc
/apt
/apt.conf.d etc
/apt
/sources.list.d etc
/apt
/trusted.gpg.d etc
/apt
/preferences.d
197 mkdir -p var
/cache var
/lib var
/log tmp
198 mkdir -p var
/lib
/dpkg
/info var
/lib
/dpkg
/updates var
/lib
/dpkg
/triggers
199 touch var
/lib
/dpkg
/available
201 ln -s ${METHODSDIR} usr
/lib
/apt
/methods
202 ln -s ${BUILDDIRECTORY}/..
/..
/debian
/apt.conf.autoremove etc
/apt
/apt.conf.d
/01autoremove
204 local PACKAGESFILE
=$(echo "$(basename $0)" | sed -e 's/^test-/Packages-/' -e 's/^skip-/Packages-/')
205 if [ -f "${TESTDIRECTORY}/${PACKAGESFILE}" ]; then
206 cp "${TESTDIRECTORY}/${PACKAGESFILE}" aptarchive/Packages
208 local SOURCESSFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Sources-/' -e 's/^skip-/Sources-/')
209 if [ -f "${TESTDIRECTORY}/${SOURCESSFILE}" ]; then
210 cp "${TESTDIRECTORY}/${SOURCESSFILE}" aptarchive
/Sources
212 cp $(find $TESTDIRECTORY -name '*.pub' -o -name '*.sec') keys
/
213 ln -s ${TMPWORKINGDIRECTORY}/keys
/joesixpack.pub rootdir
/etc
/apt
/trusted.gpg.d
/joesixpack.gpg
214 echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
215 echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf
216 echo "Debug::NoLocking \"true\";" >> aptconfig.conf
217 echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
218 echo "Dir::Bin::Methods \"${METHODSDIR}\";" >> aptconfig.conf
219 echo "Dir::Bin::dpkg \"fakeroot\";" >> aptconfig.conf
220 echo "DPKG::options:: \"dpkg\";" >> aptconfig.conf
221 echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf
222 echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf
223 echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf
224 if ! command dpkg
--assert-multi-arch >/dev
/null
2>&1; then
225 echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf
# Added to test multiarch before dpkg is ready for it…
227 echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
228 echo 'quiet::NoUpdate "true";' >> aptconfig.conf
229 echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir
/etc
/apt
/apt.conf.d
/99https
230 echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir
/etc
/apt
/apt.conf.d
/apt
-binary
231 configcompression
'.' 'gz' #'bz2' 'lzma' 'xz'
233 # gpg needs a trustdb to function, but it can't be invalid (not even empty)
234 # see also apt-key where this trickery comes from:
235 local TRUSTDBDIR
="${TMPWORKINGDIRECTORY}/gnupghome"
237 chmod 700 "$TRUSTDBDIR"
238 # We also don't use a secret keyring, of course, but gpg panics and
239 # implodes if there isn't one available - and writeable for imports
240 local SECRETKEYRING
="${TRUSTDBDIR}/secring.gpg"
242 # now create the trustdb with an (empty) dummy keyring
243 # newer gpg versions are fine without it, but play it safe for now
244 gpg
--quiet --check-trustdb --secret-keyring $SECRETKEYRING --keyring $SECRETKEYRING >/dev
/null
2>&1
246 # cleanup the environment a bit
247 export PATH
="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
248 export LC_ALL
=C.UTF
-8
250 unset GREP_OPTIONS DEB_BUILD_PROFILES
256 if [ "$1" = "native" -o -z "$1" ]; then
257 eval `aptconfig shell ARCH APT::Architecture`
258 if [ -n "$ARCH" ]; then
261 dpkg
--print-architecture
269 echo "$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')"
272 configarchitecture
() {
274 echo "APT::Architecture \"$(getarchitecture $1)\";"
275 while [ -n "$1" ]; do
276 echo "APT::Architectures:: \"$(getarchitecture $1)\";"
279 } >rootdir
/etc
/apt
/apt.conf.d
/01multiarch.conf
284 if [ ! -e rootdir
/var
/lib
/dpkg
/status
]; then
285 local STATUSFILE
=$(echo "$(basename $0)" | sed -e 's/^test-/status-/' -e 's/^skip-/status-/')
286 if [ -f "${TESTDIRECTORY}/${STATUSFILE}" ]; then
287 cp "${TESTDIRECTORY}/${STATUSFILE}" rootdir/var/lib/dpkg/status
289 echo -n > rootdir/var/lib/dpkg/status
292 rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg
293 if command dpkg --assert-multi-arch >/dev/null 2>&1 ; then
294 local ARCHS="$(getarchitectures)"
295 if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then
296 DPKGARCH="$(dpkg --print-architecture)"
297 for ARCH in ${ARCHS}; do
298 if [ "${ARCH}" != "${DPKGARCH}" ]; then
299 if ! dpkg --add-architecture ${ARCH} >/dev/null 2>&1; then
300 # old-style used e.g. in Ubuntu-P – and as it seems travis
301 echo "DPKG
::options
:: \"--foreign-architecture\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg
302 echo "DPKG
::options
:: \"${ARCH}\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg
306 if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
307 # dpkg doesn't really check the version as long as it is fully installed,
308 # but just to be sure we choose one above the required version
309 insertinstalledpackage 'dpkg' "all
" '1.16.2+fake'
315 configcompression() {
316 while [ -n "$1" ]; do
318 '.') echo ".
\t.
\tcat
";;
319 'gz') echo "gzip\tgz
\tgzip
";;
320 'bz2') echo "bzip2\tbz
2\tbzip
2";;
321 'lzma') echo "lzma
\tlzma
\txz
--format=lzma
";;
322 'xz') echo "xz
\txz
\txz
";;
323 *) echo "$1\t$1\t$1";;
326 done > ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf
329 setupsimplenativepackage() {
333 local RELEASE="${4:-unstable}"
334 local DEPENDENCIES="$5"
335 local DESCRIPTION="${6:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
336 If you
find such a package installed on your system
,
337 something went horribly wrong
! They are autogenerated
338 und used only by testcases and surf no other propose…
"}"
340 local SECTION
="${7:-others}"
342 if [ "$SECTION" = "$(echo "$SECTION" | cut -d'/' -f 2)" ]; then
345 DISTSECTION
="$(echo "$SECTION" | cut -d'/' -f 1)"
347 local BUILDDIR
=incoming
/${NAME}-${VERSION}
348 mkdir -p ${BUILDDIR}/debian
/source
350 echo "* most suckless software product ever" > FEATURES
351 test -e debian
/copyright
|| echo "Copyleft by Joe Sixpack $(date +%Y)" > debian
/copyright
352 test -e debian
/changelog
|| echo "$NAME ($VERSION) $RELEASE; urgency=low
356 -- Joe Sixpack <joe@example.org> $(date -R)" > debian
/changelog
357 test -e debian
/control
|| echo "Source: $NAME
360 Maintainer: Joe Sixpack <joe@example.org>
361 Build-Depends: debhelper (>= 7)
362 Standards-Version: 3.9.1
364 Package: $NAME" > debian
/control
365 if [ "$ARCH" = 'all' ]; then
366 echo "Architecture: all" >> debian
/control
368 echo "Architecture: any" >> debian
/control
370 test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> debian
/control
371 echo "Description: $DESCRIPTION" >> debian
/control
373 test -e debian
/compat
|| echo "7" > debian
/compat
374 test -e debian
/source
/format
|| echo "3.0 (native)" > debian
/source
/format
375 test -e debian
/rules
|| cp /usr
/share
/doc
/debhelper
/examples
/rules.tiny debian
/rules
379 buildsimplenativepackage
() {
383 local RELEASE
="${4:-unstable}"
384 local DEPENDENCIES
="$5"
385 local DESCRIPTION
="${6:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
386 If you find such a package installed on your system,
387 something went horribly wrong! They are autogenerated
388 und used only by testcases and surf no other propose…"}"
390 local SECTION="${7:-others}"
391 local PRIORITY="${8:-optional}"
393 local COMPRESS_TYPE="${10:-gzip}"
395 if [ "$SECTION" = "$(echo "$SECTION" | cut -d'/' -f 2)" ]; then
398 DISTSECTION="$(echo "$SECTION" | cut -d'/' -f 1)"
400 local BUILDDIR=${TMPWORKINGDIRECTORY}/incoming/${NAME}-${VERSION}
402 msgninfo "Build package
${NAME} in ${VERSION} for ${RELEASE} in ${DISTSECTION}…
"
403 mkdir -p $BUILDDIR/debian/source
404 echo "* most suckless software product ever
" > ${BUILDDIR}/FEATURES
406 echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME}
408 echo "Copyleft by Joe Sixpack
$(date +%Y)" > ${BUILDDIR}/debian/copyright
409 echo "$NAME ($VERSION) $RELEASE; urgency
=low
413 -- Joe Sixpack
<joe@example.org
> $(date -R)" > ${BUILDDIR}/debian/changelog
417 Maintainer
: Joe Sixpack
<joe@example.org
>
418 Standards
-Version: 3.9.3" > ${BUILDDIR}/debian/control
419 local BUILDDEPS="$(echo "$DEPENDENCIES" | grep '^Build-')"
420 test -z "$BUILDDEPS" || echo "$BUILDDEPS" >> ${BUILDDIR}/debian/control
422 Package
: $NAME" >> ${BUILDDIR}/debian/control
424 if [ "$ARCH" = 'all' ]; then
425 echo "Architecture
: all
" >> ${BUILDDIR}/debian/control
427 echo "Architecture
: any
" >> ${BUILDDIR}/debian/control
429 local DEPS="$(echo "$DEPENDENCIES" | grep -v '^Build-')"
430 test -z "$DEPS" || echo "$DEPS" >> ${BUILDDIR}/debian/control
431 echo "Description
: $DESCRIPTION" >> ${BUILDDIR}/debian/control
433 echo '3.0 (native)' > ${BUILDDIR}/debian/source/format
434 (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | sed -n 's#^dpkg-source: info: building [^ ]\+ in ##p' \
436 echo "pool
/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist
437 # if expr match "${SRC}" '.*\.dsc' >/dev/null 2>&1; then
438 # gpg --yes --secret-keyring ./keys/joesixpack.sec \
439 # --keyring ./keys/joesixpack.pub --default-key 'Joe Sixpack' \
440 # --clearsign -o "${BUILDDIR}/..
/${SRC}.sign
" "${BUILDDIR}/..
/$SRC"
441 # mv "${BUILDDIR}/..
/${SRC}.sign
" "${BUILDDIR}/..
/$SRC"
445 for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
446 rm -rf ${BUILDDIR}/debian
/tmp
447 mkdir -p ${BUILDDIR}/debian
/tmp
/DEBIAN
${BUILDDIR}/debian
/tmp
/usr
/share
/doc
/${NAME} ${BUILDDIR}/debian
/tmp
/usr
/bin
448 cp ${BUILDDIR}/debian
/copyright
${BUILDDIR}/debian
/changelog
${BUILDDIR}/FEATURES
${BUILDDIR}/debian
/tmp
/usr
/share
/doc
/${NAME}
449 cp ${BUILDDIR}/${NAME} ${BUILDDIR}/debian
/tmp
/usr
/bin
/${NAME}-${arch}
450 if [ -n "$FILE_TREE" ]; then
451 cp -ar "$FILE_TREE" ${BUILDDIR}/debian
/tmp
454 (cd ${BUILDDIR}; dpkg
-gencontrol -DArchitecture=$arch)
455 (cd ${BUILDDIR}/debian
/tmp
; md5sum $(find usr/ -type f) > DEBIAN
/md5sums
)
456 local LOG
="${BUILDDIR}/../${NAME}_${VERSION}_${arch}.dpkg-deb.log"
457 # ensure the right permissions as dpkg-deb ensists
458 chmod 755 ${BUILDDIR}/debian
/tmp
/DEBIAN
459 if ! dpkg
-deb -Z${COMPRESS_TYPE} --build ${BUILDDIR}/debian
/tmp
${BUILDDIR}/..
>$LOG 2>&1; then
464 echo "pool/${NAME}_${VERSION}_${arch}.deb" >> ${BUILDDIR}/..
/${RELEASE}.
${DISTSECTION}.pkglist
467 mkdir -p ${BUILDDIR}/..
/${NAME}_
${VERSION}
468 cp ${BUILDDIR}/debian
/changelog
${BUILDDIR}/..
/${NAME}_
${VERSION}/
469 cp ${BUILDDIR}/debian
/changelog
${BUILDDIR}/..
/${NAME}_
${VERSION}.changelog
478 local ARCH
=$(getarchitecture $4)
479 local PKGNAME
="$(echo "$BUILDDIR" | grep -o '[^/]*$')"
480 local BUILDLOG
="$(readlink -f "${BUILDDIR}/../${PKGNAME}_${RELEASE}_${SECTION}.dpkg-bp.log")"
481 msgninfo
"Build package ${PKGNAME} for ${RELEASE} in ${SECTION}… "
483 if [ "$ARCH" = "all" ]; then
484 ARCH
="$(dpkg-architecture -qDEB_HOST_ARCH 2> /dev/null)"
486 if ! dpkg
-buildpackage -uc -us -a$ARCH >$BUILDLOG 2>&1 ; then
490 local PKGS
="$(grep '^dpkg-deb: building package' $BUILDLOG | cut -d'/' -f 2 | sed -e "s#'\.##")"
491 local SRCS
="$(grep '^dpkg-source: info: building' $BUILDLOG | grep -o '[a-z0-9._+~-]*$')"
494 echo "pool/${PKG}" >> ${TMPWORKINGDIRECTORY}/incoming
/${RELEASE}.
${SECTION}.pkglist
497 echo "pool/${SRC}" >> ${TMPWORKINGDIRECTORY}/incoming
/${RELEASE}.
${SECTION}.srclist
503 if [ -d incoming
]; then
504 buildaptarchivefromincoming
"$@"
506 buildaptarchivefromfiles
"$@"
510 createaptftparchiveconfig
() {
511 local COMPRESSORS
="$(cut -d' ' -f 1 ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf | tr '\n' ' ')"
512 COMPRESSORS
="${COMPRESSORS%* }"
513 local ARCHS
="$(find pool/ -name '*.deb' | grep -oE '_[a-z0-9-]+\.deb$' | sort | uniq | sed -e '/^_all.deb$/ d' -e 's#^_\([a-z0-9-]*\)\.deb$#\1#' | tr '\n' ' ')"
514 if [ -z "$ARCHS" ]; then
515 # the pool is empty, so we will operate on faked packages - let us use the configured archs
516 ARCHS
="$(getarchitectures)"
519 ArchiveDir "' >> ftparchive.conf
520 echo -n $(readlink -f .) >> ftparchive.conf
522 CacheDir "' >> ftparchive.conf
523 echo -n $(readlink -f ..) >> ftparchive.conf
525 FileListDir "' >> ftparchive.conf
526 echo -n $(readlink -f pool/) >> ftparchive.conf
530 Packages::Compress "'"$COMPRESSORS"'";
531 Sources::Compress "'"$COMPRESSORS"'";
532 Contents::Compress "'"$COMPRESSORS"'";
533 Translation::Compress "'"$COMPRESSORS"'";
534 LongDescription "false";
538 SrcDirectory "pool/";
544 Label "apttestcases";
546 Description "repository with dummy packages";
547 Architectures "' >> ftparchive.conf
548 echo -n "$ARCHS" >> ftparchive.conf
552 };' >> ftparchive.conf
553 for DIST
in $(find ./pool/ -maxdepth 1 -name '*.pkglist' -type f | cut -d'/' -f 3 | cut -d'.' -f 1 | sort | uniq); do
554 echo -n 'tree "dists/' >> ftparchive.conf
555 echo -n "$DIST" >> ftparchive.conf
557 Architectures "' >> ftparchive.conf
558 echo -n "$ARCHS" >> ftparchive.conf
560 FileList "' >> ftparchive.conf
561 echo -n "${DIST}.\$(SECTION).pkglist" >> ftparchive.conf
563 SourceFileList "' >> ftparchive.conf
564 echo -n "${DIST}.\$(SECTION).srclist" >> ftparchive.conf
566 Sections "' >> ftparchive.conf
567 echo -n "$(find ./pool/ -maxdepth 1 -name "${DIST}.*.pkglist" -type f | cut -d'/' -f 3 | cut -d'.' -f 2 | sort | uniq | tr '\n' ' ')" >> ftparchive.conf
569 };' >> ftparchive.conf
573 buildaptftparchivedirectorystructure
() {
574 local DISTS
="$(grep -i '^tree ' ftparchive.conf | cut -d'/' -f 2 | sed -e 's#".*##')"
575 for DIST
in $DISTS; do
576 local SECTIONS
="$(grep -i -A 5 "dists/$DIST" ftparchive.conf | grep -i 'Sections' | cut -d'"' -f 2)"
577 for SECTION
in $SECTIONS; do
578 local ARCHS
="$(grep -A 5 "dists/$DIST" ftparchive.conf | grep Architectures | cut -d'"' -f 2 | sed -e 's#source##')"
579 for ARCH
in $ARCHS; do
580 mkdir -p dists
/${DIST}/${SECTION}/binary
-${ARCH}
582 mkdir -p dists
/${DIST}/${SECTION}/source
583 mkdir -p dists
/${DIST}/${SECTION}/i18n
593 local DEPENDENCIES
="$5"
594 local PRIORITY
="${6:-optional}"
595 local DESCRIPTION
="${7:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
596 If you find such a package installed on your system,
597 something went horribly wrong! They are autogenerated
598 und used only by testcases and surf no other propose…"}"
600 for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
601 if [ "$arch" = 'all' -o "$arch" = 'none' ]; then
602 ARCHS
="$(getarchitectures)"
606 for BUILDARCH
in $ARCHS; do
607 local PPATH
="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}"
608 mkdir -p $PPATH aptarchive
/dists
/${RELEASE}/main
/source
609 touch aptarchive
/dists
/${RELEASE}/main
/source
/Sources
610 local FILE
="${PPATH}/Packages"
615 Maintainer: Joe Sixpack <joe@example.org>" >> $FILE
616 test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE
617 echo "Version: $VERSION
618 Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE
619 test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
620 echo "Description: $DESCRIPTION" >> $FILE
631 local DEPENDENCIES
="$5"
633 local SPATH
="aptarchive/dists/${RELEASE}/main/source"
635 local FILE
="${SPATH}/Sources"
639 Maintainer: Joe Sixpack <joe@example.org>
640 Architecture: $ARCH" >> $FILE
641 test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
643 d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.dsc
644 d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz
648 insertinstalledpackage
() {
652 local DEPENDENCIES
="$4"
653 local PRIORITY
="${5:-optional}"
654 local STATUS
="${6:-install ok installed}"
655 local DESCRIPTION
="${7:-"an autogenerated dummy ${NAME}=${VERSION}/installed
656 If you find such a package installed on your system,
657 something went horribly wrong! They are autogenerated
658 und used only by testcases and surf no other propose…"}"
660 local FILE='rootdir/var/lib/dpkg/status'
661 local INFO='rootdir/var/lib/dpkg/info'
662 for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
668 Maintainer: Joe Sixpack <joe@example.org>
669 Version: $VERSION" >> $FILE
670 test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE
671 test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
672 echo "Description: $DESCRIPTION" >> $FILE
674 if [ "$(dpkg-query -W --showformat='${Multi-Arch}')" = 'same' ]; then
675 echo -n > ${INFO}/${NAME}:${arch}.list
677 echo -n > ${INFO}/${NAME}.list
683 buildaptarchivefromincoming
() {
684 msginfo
"Build APT archive for ${CCMD}$(basename $0)${CINFO} based on incoming packages…"
686 [ -e pool
] || ln -s ..
/incoming pool
687 [ -e ftparchive.conf
] || createaptftparchiveconfig
688 [ -e dists
] || buildaptftparchivedirectorystructure
689 msgninfo
"\tGenerate Packages, Sources and Contents files… "
690 aptftparchive
-qq generate ftparchive.conf
696 buildaptarchivefromfiles
() {
697 msginfo
"Build APT archive for ${CCMD}$(basename $0)${CINFO} based on prebuild files…"
698 find aptarchive
-name 'Packages' -o -name 'Sources' | while read line
; do
699 msgninfo
"\t${line} file… "
700 compressfile
"$line" "$1"
703 generatereleasefiles
"$@"
707 cat ${TMPWORKINGDIRECTORY}/rootdir
/etc
/testcase
-compressor.conf
| while read compressor extension
command; do
708 if [ "$compressor" = '.' ]; then
714 cat "$1" | $command > "${1}.${extension}"
716 touch -d "$2" "${1}.${extension}"
721 # can be overridden by testcases for their pleasure
722 getcodenamefromsuite
() {
724 unstable
) echo 'sid';;
728 getreleaseversionfromsuite
() { true
; }
729 getlabelfromsuite
() { true
; }
731 generatereleasefiles
() {
732 # $1 is the Date header and $2 is the ValidUntil header to be set
733 # both should be given in notation date/touch can understand
734 msgninfo
"\tGenerate Release files… "
735 if [ -e aptarchive
/dists
]; then
736 for dir
in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do
737 local SUITE
="$(echo "$dir" | cut -d'/' -f 4)"
738 local CODENAME
="$(getcodenamefromsuite $SUITE)"
739 local VERSION
="$(getreleaseversionfromsuite $SUITE)"
740 local LABEL
="$(getlabelfromsuite $SUITE)"
741 if [ -n "$VERSION" ]; then
742 VERSION
="-o APT::FTPArchive::Release::Version=${VERSION}"
744 if [ -n "$LABEL" ]; then
745 LABEL
="-o APT::FTPArchive::Release::Label=${LABEL}"
747 aptftparchive
-qq release
$dir \
748 -o APT
::FTPArchive
::Release
::Suite
="${SUITE}" \
749 -o APT
::FTPArchive
::Release
::Codename
="${CODENAME}" \
752 | sed -e '/0 Release$/ d' > $dir/Release
# remove the self reference
753 if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then
755 NotAutomatic: yes' $dir/Release
757 if [ -n "$1" -a "$1" != "now" ]; then
758 sed -i "s/^Date: .*$/Date: $(date -d "$1" '+%a, %d %b %Y %H:%M:%S %Z')/" $dir/Release
762 Valid-Until: $(date -d "$2" '+%a, %d %b %Y %H:%M:%S %Z')" $dir/Release
766 aptftparchive
-qq release .
/aptarchive
| sed -e '/0 Release$/ d' > aptarchive
/Release
# remove the self reference
768 if [ -n "$1" -a "$1" != "now" ]; then
769 for release
in $(find ./aptarchive -name 'Release'); do
770 touch -d "$1" $release
776 setupdistsaptarchive
() {
777 local APTARCHIVE
=$(readlink -f ./aptarchive)
778 rm -f root
/etc
/apt
/sources.list.d
/apt
-test-*-deb.list
779 rm -f root
/etc
/apt
/sources.list.d
/apt
-test-*-deb-src.list
780 for DISTS
in $(find ./aptarchive/dists/ -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 4); do
781 SECTIONS
=$(find ./aptarchive/dists/${DISTS}/ -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 5 | tr '\n' ' ')
782 msgninfo
"\tadd deb and deb-src sources.list lines for ${CCMD}${DISTS} ${SECTIONS}${CINFO}… "
783 echo "deb file://$APTARCHIVE $DISTS $SECTIONS" > rootdir
/etc
/apt
/sources.list.d
/apt
-test-${DISTS}-deb.list
784 echo "deb-src file://$APTARCHIVE $DISTS $SECTIONS" > rootdir
/etc
/apt
/sources.list.d
/apt
-test-${DISTS}-deb-src.list
789 setupflataptarchive
() {
790 local APTARCHIVE
=$(readlink -f ./aptarchive)
791 if [ -f ${APTARCHIVE}/Packages
]; then
792 msgninfo
"\tadd deb sources.list line… "
793 echo "deb file://$APTARCHIVE /" > rootdir
/etc
/apt
/sources.list.d
/apt
-test-archive-deb.list
796 rm -f rootdir
/etc
/apt
/sources.list.d
/apt
-test-archive-deb.list
798 if [ -f ${APTARCHIVE}/Sources
]; then
799 msgninfo
"\tadd deb-src sources.list line… "
800 echo "deb-src file://$APTARCHIVE /" > rootdir
/etc
/apt
/sources.list.d
/apt
-test-archive-deb-src.list
803 rm -f rootdir
/etc
/apt
/sources.list.d
/apt
-test-archive-deb-src.list
809 if [ -e aptarchive
/dists
]; then
815 if [ "$1" != '--no-update' ]; then
816 msgninfo
"\tSync APT's cache with the archive… "
823 local SIGNER
="${1:-Joe Sixpack}"
824 local GPG
="gpg --batch --yes"
825 msgninfo
"\tSign archive with $SIGNER key… "
826 local REXKEY
='keys/rexexpired'
827 local SECEXPIREBAK
="${REXKEY}.sec.bak"
828 local PUBEXPIREBAK
="${REXKEY}.pub.bak"
829 if [ "${SIGNER}" = 'Rex Expired' ]; then
830 # the key is expired, so gpg doesn't allow to sign with and the --faked-system-time
831 # option doesn't exist anymore (and using faketime would add a new obscure dependency)
832 # therefore we 'temporary' make the key not expired and restore a backup after signing
833 cp ${REXKEY}.sec
$SECEXPIREBAK
834 cp ${REXKEY}.pub
$PUBEXPIREBAK
835 local SECUNEXPIRED
="${REXKEY}.sec.unexpired"
836 local PUBUNEXPIRED
="${REXKEY}.pub.unexpired"
837 if [ -f "$SECUNEXPIRED" ] && [ -f "$PUBUNEXPIRED" ]; then
838 cp $SECUNEXPIRED ${REXKEY}.sec
839 cp $PUBUNEXPIRED ${REXKEY}.pub
841 printf "expire\n1w\nsave\n" | $GPG --keyring ${REXKEY}.pub
--secret-keyring ${REXKEY}.sec
--command-fd 0 --edit-key "${SIGNER}" >/dev
/null
2>&1 || true
842 cp ${REXKEY}.sec
$SECUNEXPIRED
843 cp ${REXKEY}.pub
$PUBUNEXPIRED
846 for KEY
in $(find keys/ -name '*.sec'); do
847 GPG
="$GPG --secret-keyring $KEY"
849 for KEY
in $(find keys/ -name '*.pub'); do
850 GPG
="$GPG --keyring $KEY"
852 for RELEASE
in $(find aptarchive/ -name Release); do
853 $GPG --default-key "$SIGNER" --armor --detach-sign --sign --output ${RELEASE}.gpg
${RELEASE}
854 local INRELEASE
="$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')"
855 $GPG --default-key "$SIGNER" --clearsign --output $INRELEASE $RELEASE
856 # we might have set a specific date for the Release file, so copy it
857 touch -d "$(stat --format "%y" ${RELEASE})" ${RELEASE}.gpg
${INRELEASE}
859 if [ -f "$SECEXPIREBAK" ] && [ -f "$PUBEXPIREBAK" ]; then
860 mv -f $SECEXPIREBAK ${REXKEY}.sec
861 mv -f $PUBEXPIREBAK ${REXKEY}.pub
867 msgtest
"Set webserver config option '${1}' to" "$2"
868 local DOWNLOG
='rootdir/tmp/download-testfile.log'
869 local STATUS
='rootdir/tmp/webserverconfig.status'
870 rm -f "$STATUS" "$DOWNLOG"
871 if downloadfile
"http://localhost:8080/_config/set/${1}/${2}" "$STATUS" > "$DOWNLOG"; then
874 cat "$DOWNLOG" "$STATUS"
877 testwebserverlaststatuscode
'200'
880 rewritesourceslist
() {
881 local APTARCHIVE
="file://$(readlink -f "${TMPWORKINGDIRECTORY}/aptarchive")"
882 for LIST
in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
883 sed -i $LIST -e "s#$APTARCHIVE#${1}#" -e "s#http://localhost:8080/#${1}#" -e "s#http://localhost:4433/#${1}#"
887 changetowebserver
() {
888 if [ "$1" != '--no-rewrite' ]; then
889 rewritesourceslist
'http://localhost:8080/'
893 if test -x ${APTWEBSERVERBINDIR}/aptwebserver
; then
895 local LOG
="webserver.log"
896 if ! aptwebserver
-o aptwebserver
::fork
=1 "$@" >$LOG 2>&1 ; then
900 local PID
="$(cat aptwebserver.pid)"
901 if [ -z "$PID" ]; then
902 msgdie
'Could not fork aptwebserver successfully'
907 msgdie
'You have to build aptwerbserver or install a webserver'
911 changetohttpswebserver
() {
912 if ! which stunnel4
>/dev
/null
; then
913 msgdie
'You need to install stunnel4 for https testcases'
915 if [ ! -e "${TMPWORKINGDIRECTORY}/aptarchive/aptwebserver.pid" ]; then
916 changetowebserver
--no-rewrite "$@"
918 echo "pid = ${TMPWORKINGDIRECTORY}/aptarchive/stunnel.pid
919 cert = ${TESTDIRECTORY}/apt.pem
925 " > ${TMPWORKINGDIRECTORY}/stunnel.conf
926 stunnel4
"${TMPWORKINGDIRECTORY}/stunnel.conf"
927 local PID
="$(cat ${TMPWORKINGDIRECTORY}/aptarchive/stunnel.pid)"
928 addtrap
'prefix' "kill ${PID};"
929 rewritesourceslist
'https://localhost:4433/'
933 mkdir -p rootdir
/media
/cdrom
/.disk
934 local CD
="$(readlink -f rootdir/media/cdrom)"
935 echo "acquire::cdrom::mount \"${CD}\";
936 acquire::cdrom::${CD}/::mount \"mv ${CD}-unmounted ${CD}\";
937 acquire::cdrom::${CD}/::umount \"mv ${CD} ${CD}-unmounted\";
938 acquire::cdrom::autodetect 0;" > rootdir
/etc
/apt
/apt.conf.d
/00cdrom
939 echo -n "$1" > ${CD}/.disk
/info
940 if [ ! -d aptarchive
/dists
]; then
941 msgdie
'Flat file archive cdroms can not be created currently'
944 mv aptarchive
/dists
"$CD"
945 ln -s "$(readlink -f ./incoming)" $CD/pool
946 find rootdir
/etc
/apt
/sources.list.d
/ -name 'apt-test-*.list' -delete
947 # start with an unmounted disk
948 mv "${CD}" "${CD}-unmounted"
949 # we don't want the disk to be modifiable
950 addtrap
'prefix' "chmod -f -R +w $PWD/rootdir/media/cdrom/dists/ $PWD/rootdir/media/cdrom-unmounted/dists/ || true;"
951 chmod -R -w rootdir
/media
/cdrom
-unmounted/dists
955 local PROTO
="$(echo "$1" | cut -d':' -f 1 )"
956 apthelper
-o Acquire
::https
::CaInfo
=${TESTDIR}/apt.pem \
957 -o Debug
::Acquire
::${PROTO}=1 \
958 download
-file "$1" "$2" 2>&1 || true
959 # only if the file exists the download was successful
968 local DIFFTEXT
="$(command diff -u "$@" | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')"
969 if [ -n "$DIFFTEXT" ]; then
981 msgtest
"Test for correctness of file" "$FILE"
983 echo -n "" | checkdiff
$FILE - && msgpass
|| msgfail
985 echo "$*" | checkdiff
$FILE - && msgpass
|| msgfail
990 msgtest
"Test for no output of" "$*"
991 test -z "$($* 2>&1)" && msgpass
|| msgfail
995 local MSG
='Test of equality of'
996 if [ "$1" = '--nomsg' ]; then
1001 local COMPAREFILE
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequal.comparefile"
1002 echo "$1" > $COMPAREFILE
1005 if [ -n "$MSG" ]; then
1008 $
* 2>&1 | checkdiff
$COMPAREFILE - && msgpass
|| msgfail
1012 local COMPAREFILE1
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequalor2.comparefile1"
1013 local COMPAREFILE2
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequalor2.comparefile2"
1014 local COMPAREAGAINST
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testequalor2.compareagainst"
1015 echo "$1" > $COMPAREFILE1
1016 echo "$2" > $COMPAREFILE2
1018 msgtest
"Test for equality OR of" "$*"
1019 $
* >$COMPAREAGAINST 2>&1 || true
1020 if checkdiff
$COMPAREFILE1 $COMPAREAGAINST >/dev
/null
2>&1 || \
1021 checkdiff
$COMPAREFILE2 $COMPAREAGAINST >/dev
/null
2>&1
1025 echo -n "\n${CINFO}Diff against OR 1${CNORMAL}"
1026 checkdiff
$COMPAREFILE1 $COMPAREAGAINST || true
1027 echo -n "${CINFO}Diff against OR 2${CNORMAL}"
1028 checkdiff
$COMPAREFILE2 $COMPAREAGAINST || true
1034 local VIRTUAL
="N: Can't select versions from package '$1' as it is purely virtual"
1037 while [ -n "$1" ]; do
1039 N: Can't select versions from package '$1' as it is purely virtual"
1040 PACKAGE
="${PACKAGE} $1"
1043 msgtest
"Test for virtual packages" "apt-cache show $PACKAGE"
1045 N: No packages found"
1046 local COMPAREFILE
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testshowvirtual.comparefile"
1047 local ARCH
="$(getarchitecture 'native')"
1048 echo "$VIRTUAL" | sed -e "s/:$ARCH//" -e 's/:all//' > $COMPAREFILE
1049 aptcache show
-q=0 $PACKAGE 2>&1 | checkdiff
$COMPAREFILE - && msgpass
|| msgfail
1053 msgtest
"Test for non-existent packages" "apt-cache show $*"
1054 local SHOWPKG
="$(aptcache show "$@" 2>&1 | grep '^Package: ')"
1055 if [ -n "$SHOWPKG" ]; then
1064 testdpkginstalled
() {
1065 msgtest
"Test for correctly installed package(s) with" "dpkg -l $*"
1066 local PKGS
="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
1067 if [ "$PKGS" != $# ]; then
1069 dpkg
-l "$@" | grep '^[a-z]' >&2
1076 testdpkgnotinstalled
() {
1077 msgtest
"Test for correctly not-installed package(s) with" "dpkg -l $*"
1078 local PKGS
="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
1079 if [ "$PKGS" != 0 ]; then
1081 dpkg
-l "$@" | grep '^[a-z]' >&2
1089 local COMPAREFILE
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testmarkedauto.comparefile"
1090 if [ -n "$1" ]; then
1091 msgtest
'Test for correctly marked as auto-installed' "$*"
1092 while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE
1094 msgtest
'Test for correctly marked as auto-installed' 'no package'
1095 echo -n > $COMPAREFILE
1097 aptmark showauto
2>&1 | checkdiff
$COMPAREFILE - && msgpass
|| msgfail
1101 if [ "$1" = '--nomsg' ]; then
1104 msgtest
'Test for successful execution of' "$*"
1106 local OUTPUT
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output"
1107 if $@
>${OUTPUT} 2>&1; then
1117 if [ "$1" = '--nomsg' ]; then
1120 msgtest
'Test for failure in execution of' "$*"
1122 local OUTPUT
="${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output"
1123 if $@
>${OUTPUT} 2>&1; then
1132 testwebserverlaststatuscode
() {
1133 local DOWNLOG
='rootdir/tmp/webserverstatus-testfile.log'
1134 local STATUS
='rootdir/tmp/webserverstatus-statusfile.log'
1135 rm -f "$DOWNLOG" "$STATUS"
1136 msgtest
'Test last status code from the webserver was' "$1"
1137 downloadfile
"http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" > "$DOWNLOG"
1138 if [ "$(cat "$STATUS")" = "$1" ]; then
1142 if [ -n "$2" ]; then
1144 echo >&2 '#### Additionally provided output files contain:'
1147 echo >&2 '#### Download log of the status code:'
1149 msgfail
"Status was $(cat "$STATUS")"
1154 echo "STOPPED execution. Press enter to continue"