tests/include-deb-file: create a dummy binary package to make sure apt doesn't download the package from the mirror
This commit is contained in:
parent
24c5a45202
commit
4ccd799b50
1 changed files with 20 additions and 15 deletions
|
@ -3,19 +3,24 @@
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
{{ CMD }} --variant=apt \
|
# instead of obtaining a .deb from our cache, we create a new package because
|
||||||
--customize-hook='mkdir "$1"/tmp/apt' \
|
# otherwise apt might decide to download the package with the same name and
|
||||||
--customize-hook='chroot "$1" env --chdir=/tmp/apt apt-get download busybox' \
|
# version from the cache instead of using the local .deb
|
||||||
--customize-hook='copy-out /tmp/apt /tmp' \
|
mkdir -p /tmp/dummypkg/DEBIAN
|
||||||
{{ DIST }} /dev/null {{ MIRROR }}
|
cat << END > "/tmp/dummypkg/DEBIAN/control"
|
||||||
pkg="$(find /tmp/apt -type f)"
|
Package: dummypkg
|
||||||
# some sanity checks
|
Priority: optional
|
||||||
[ -f "$pkg" ]
|
Section: oldlibs
|
||||||
case $pkg in
|
Maintainer: Johannes Schauer Marin Rodrigues <josch@debian.org>
|
||||||
/tmp/apt/busybox*_{{ HOSTARCH }}.deb) : ;;
|
Architecture: all
|
||||||
*) exit 1;;
|
Multi-Arch: foreign
|
||||||
esac
|
Source: dummypkg
|
||||||
# now try to install that package
|
Version: 1
|
||||||
{{ CMD }} --variant=apt --include="$pkg" \
|
Description: dummypkg
|
||||||
--customize-hook='chroot "$1" dpkg-query -W -f="\${Status}\n" busybox | grep "^install ok installed$"' \
|
END
|
||||||
|
dpkg-deb --build "/tmp/dummypkg" "/tmp/dummypkg.deb"
|
||||||
|
|
||||||
|
{{ CMD }} --variant=apt --include="/tmp/dummypkg.deb" \
|
||||||
|
--hook-dir=./hooks/file-mirror-automount \
|
||||||
|
--customize-hook='chroot "$1" dpkg-query -W -f="\${Status}\n" dummypkg | grep "^install ok installed$"' \
|
||||||
{{ DIST }} /dev/null {{ MIRROR }}
|
{{ DIST }} /dev/null {{ MIRROR }}
|
||||||
|
|
Loading…
Reference in a new issue