This repository has been archived on 2024-12-14. You can view files and clone it, but cannot push or open issues or pull requests.
2023-06-16 06:23:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
[ -f /.dockerenv ] || { echo "please run in supplied container"; exit 1; }
|
|
|
|
set -e
|
|
|
|
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
|
2023-09-03 09:47:17 +00:00
|
|
|
echo ARCHIVE_SOURCES -> $ARCHIVE_SOURCES
|
|
|
|
if [[ "${ARCHIVE_SOURCES}" == "true" ]]; then
|
|
|
|
rm /etc/apt/sources.list.d/*
|
|
|
|
cp /config/apt-sources-x86_64.list /etc/apt/sources.list
|
|
|
|
fi
|
|
|
|
|
2023-06-18 09:41:10 +00:00
|
|
|
cp /config/apt-hashes-x86_64.list /etc/apt/
|
|
|
|
cp /config/apt-pins-x86_64.list /etc/apt/
|
2023-06-16 06:23:10 +00:00
|
|
|
apt update -o Acquire::Check-Valid-Until=false
|
|
|
|
|
|
|
|
until apt-get install \
|
|
|
|
--download-only \
|
|
|
|
--allow-downgrades \
|
|
|
|
-o Acquire::Check-Valid-Until=false \
|
|
|
|
-y $(cat /etc/apt/apt-pins-${ARCH}.list);
|
|
|
|
do
|
|
|
|
echo "apt install failed. Likely throttled. Retrying in 10 mins...";
|
|
|
|
sleep 600;
|
|
|
|
done;
|
|
|
|
|
|
|
|
(
|
|
|
|
cd /var/cache/apt/archives \
|
|
|
|
&& find . -type f \( -iname \*.deb \) -exec sha256sum {} \; \
|
|
|
|
| sed 's/.\///g' \
|
|
|
|
| LC_ALL=C sort
|
|
|
|
) > /etc/apt/apt-hashes-${ARCH}-compare.list
|
|
|
|
|
|
|
|
diff /etc/apt/apt-hashes-${ARCH}{,-compare}.list
|
|
|
|
|
|
|
|
mkdir -p /fetch/apt
|
|
|
|
|
|
|
|
mv /var/cache/apt/archives/*.deb /fetch/apt/
|
|
|
|
apt-get install -y dpkg-dev
|
2023-06-16 18:56:43 +00:00
|
|
|
env -C /fetch dpkg-scanpackages apt | bzip2 > /fetch/apt/Packages.bz2
|