]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
fix various typos reported by codespell
[apt.git] / test / integration / framework
index 53157e2d0dfef51d8839036a0ca356d16fc85568..c046507e436348c56df8506d85c3cf2af4b0701a 100644 (file)
@@ -570,10 +570,12 @@ echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME}
 
  -- Joe Sixpack <joe@example.org>  $(date -R)" > ${BUILDDIR}/debian/changelog
        echo "Source: $NAME
-Section: $SECTION
 Priority: $PRIORITY
 Maintainer: Joe Sixpack <joe@example.org>
 Standards-Version: 3.9.3" > ${BUILDDIR}/debian/control
+       if [ "$SECTION" != '<none>' ]; then
+               echo "Section: $SECTION" >> ${BUILDDIR}/debian/control
+       fi
        local BUILDDEPS="$(echo "$DEPENDENCIES" | grep '^Build-')"
        test -z "$BUILDDEPS" || echo "$BUILDDEPS" >> ${BUILDDIR}/debian/control
        echo "
@@ -792,6 +794,7 @@ insertsource() {
        local ARCH="$3"
        local VERSION="$4"
        local DEPENDENCIES="$5"
+        local BINARY="${6:-$NAME}"
        local ARCHS=""
        local SPATH="aptarchive/dists/${RELEASE}/main/source"
        mkdir -p $SPATH
@@ -799,7 +802,7 @@ insertsource() {
        local DSCFILE="${NAME}_${VERSION}.dsc"
        local TARFILE="${NAME}_${VERSION}.tar.gz"
        echo "Package: $NAME
-Binary: $NAME
+Binary: $BINARY
 Version: $VERSION
 Maintainer: Joe Sixpack <joe@example.org>
 Architecture: $ARCH" >> $FILE
@@ -1322,6 +1325,17 @@ testmarkedauto() {
        fi
        aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
 }
+testmarkedmanual() {
+       local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testmarkedmanual.comparefile"
+       if [ -n "$1" ]; then
+               msgtest 'Test for correctly marked as manually installed' "$*"
+               while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE
+       else
+               msgtest 'Test for correctly marked as manually installed' 'no package'
+               echo -n > $COMPAREFILE
+       fi
+       aptmark showmanual 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
+}
 
 msgfailoutput() {
        local MSG="$1"
@@ -1364,8 +1378,17 @@ testsuccess() {
                if expr match "$1" '^apt.*' >/dev/null; then
                        if grep -q -E ' runtime error: ' "$OUTPUT"; then
                                msgfailoutput 'compiler detected undefined behavior' "$OUTPUT" "$@"
-                       elif grep -q -E '^[WE]: ' "$OUTPUT"; then
-                               msgfailoutput 'successful run, but output contains warnings/errors' "$OUTPUT" "$@"
+                       elif grep -E '^[WE]: ' "$OUTPUT" > "${TMPWORKINGDIRECTORY}/rootdir/tmp/checkforwarnings.output" 2>&1; then
+                               if [ "$IGNORE_PTY_NOT_MOUNTED" = '1' ]; then
+                                       if echo 'E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)' \
+                                               | cmp - "${TMPWORKINGDIRECTORY}/rootdir/tmp/checkforwarnings.output" >/dev/null 2>&1; then
+                                               msgpass
+                                       else
+                                               msgfailoutput 'successful run, but output contains warnings/errors' "$OUTPUT" "$@"
+                                       fi
+                               else
+                                       msgfailoutput 'successful run, but output contains warnings/errors' "$OUTPUT" "$@"
+                               fi
                        else
                                msgpass
                        fi
@@ -1532,7 +1555,7 @@ listcurrentlistsdirectory() {
        } | sort
 }
 
-### convinience hacks ###
+### convenience hacks ###
 mkdir() {
        # creating some directories by hand is a tedious task, so make it look simple
        if [ "$*" = '-p rootdir/var/lib/apt/lists' ] || [ "$*" = "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" ] ||