make_mirror.sh: also download a foreign architecture

This commit is contained in:
Johannes 'josch' Schauer 2018-10-21 18:02:08 +02:00
parent 7b4d052653
commit 7ca2e490d7
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -6,7 +6,11 @@ mirrordir="./mirror"
cachedir="./cache"
mirror="http://deb.debian.org/debian"
nativearch=$(dpkg --print-architecture)
arch1=$(dpkg --print-architecture)
arch2=armhf
if [ "$arch1" = "$arch2" ]; then
arch2=amd64
fi
components=main
if [ -e "$mirrordir/dists/unstable/Release" ]; then
@ -24,7 +28,8 @@ for dist in stable testing unstable; do
done
done
for dist in stable testing unstable; do
for nativearch in $arch1 $arch2; do
for dist in stable testing unstable; do
rootdir=$(mktemp --directory)
for p in /etc/apt/apt.conf.d /etc/apt/sources.list.d /etc/apt/preferences.d /var/cache/apt/archives /var/lib/apt/lists/partial /var/lib/dpkg; do
@ -33,6 +38,7 @@ for dist in stable testing unstable; do
cat << END > "$rootdir/etc/apt/apt.conf"
Apt::Architecture "$nativearch";
Apt::Architectures "$nativearch";
Dir::Etc "$rootdir/etc/apt";
Dir::State "$rootdir/var/lib/apt";
Dir::Cache "$rootdir/var/cache/apt";
@ -140,4 +146,5 @@ END
fi
rm -r "$rootdir"
done
done