2020-06-15 08:08:20 +00:00
|
|
|
#!/bin/bash
|
2020-07-23 11:12:31 +00:00
|
|
|
[ -f /.dockerenv ] || { echo "please run in supplied container"; exit 1; }
|
2020-06-15 08:08:20 +00:00
|
|
|
set -e
|
|
|
|
|
2020-10-08 01:24:58 +00:00
|
|
|
cat /etc/apt/packages-old.list | sed 's/=.*//g' \
|
|
|
|
> /etc/apt/packages.list
|
2020-07-24 20:19:34 +00:00
|
|
|
|
2020-07-23 11:12:31 +00:00
|
|
|
snapshot_date=$(date -d @${GIT_EPOCH} +"%Y%m%dT000000Z")
|
|
|
|
cat <<-EOF > /etc/apt/sources.list
|
2020-07-24 20:19:34 +00:00
|
|
|
deb http://deb.debian.org/debian buster main
|
2020-07-23 11:12:31 +00:00
|
|
|
deb http://snapshot.debian.org/archive/debian/${snapshot_date} buster main
|
2020-07-24 20:19:34 +00:00
|
|
|
deb http://security.debian.org/debian-security buster/updates main
|
2020-07-23 11:12:31 +00:00
|
|
|
deb http://snapshot.debian.org/archive/debian-security/${snapshot_date} buster/updates main
|
2020-07-24 20:19:34 +00:00
|
|
|
deb http://deb.debian.org/debian buster-updates main
|
2020-07-23 11:12:31 +00:00
|
|
|
deb http://snapshot.debian.org/archive/debian/${snapshot_date} buster-updates main
|
|
|
|
EOF
|
2020-10-08 01:24:58 +00:00
|
|
|
|
2020-10-16 00:08:15 +00:00
|
|
|
apt-get update
|
|
|
|
apt install -y openssl
|
|
|
|
apt-get install -y --download-only $(cat /etc/apt/packages.list)
|
2020-10-08 01:24:58 +00:00
|
|
|
|
2020-10-16 00:08:15 +00:00
|
|
|
(
|
|
|
|
cd /var/cache/apt/archives \
|
|
|
|
&& find . -type f \( -iname \*.deb \) -exec openssl sha256 -r {} \; \
|
|
|
|
| sed 's/ \*.\// /g' \
|
|
|
|
| LC_ALL=C sort
|
|
|
|
) > /etc/apt/package-hashes.txt
|
2020-10-08 01:24:58 +00:00
|
|
|
|
2020-10-16 00:08:15 +00:00
|
|
|
cat /etc/apt/package-hashes.txt \
|
|
|
|
| awk '{ print $2 }' \
|
|
|
|
| sed -e 's/_[a-z0-9]\+\.deb//g' -e 's/_/=/g' \
|
|
|
|
> /etc/apt/packages.list
|