]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
use apt-mark instead of hand-mangling with the extended_states file
[apt.git] / test / integration / framework
index d91599f1bb050201cfd640ec8d55cd7e35c75395..11d9a9659a578c85bdf7ad0dd050d5eafcea4088 100644 (file)
@@ -79,6 +79,7 @@ aptcache() { runapt apt-cache $*; }
 aptget() { runapt apt-get $*; }
 aptftparchive() { runapt apt-ftparchive $*; }
 aptkey() { runapt apt-key $*; }
+aptmark() { runapt apt-mark $*; }
 dpkg() {
        $(which dpkg) --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log $*
 }
@@ -272,6 +273,9 @@ Package: $NAME" > ${BUILDDIR}/debian/control
        for SRC in $SRCS; do
                echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist
        done
+       mkdir -p ${BUILDDIR}/../${NAME}_${VERSION}
+       cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}/
+       cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}.changelog
        rm -rf "${BUILDDIR}"
        msgdone "info"
 }
@@ -644,3 +648,16 @@ testdpkgnotinstalled() {
        fi
        msgpass
 }
+
+testmarkedauto() {
+       local COMPAREFILE=$(mktemp)
+       addtrap "rm $COMPAREFILE;"
+       if [ -n "$1" ]; then
+               msgtest 'Test for correctly marked as auto-installed' "$*"
+               while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE
+       else
+               msgtest 'Test for correctly marked as auto-installed' 'no package'
+               echo > $COMPAREFILE
+       fi
+       aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
+}