2022-05-25 14:02:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
export LC_ALL=C.UTF-8
|
|
|
|
trap "rm -rf /tmp/debian-chroot; rm -f /tmp/sources /tmp/deb822" EXIT INT TERM
|
2024-10-11 16:29:25 +00:00
|
|
|
cat <<SOURCES >/tmp/deb822
|
2022-05-25 14:02:09 +00:00
|
|
|
Types: deb
|
|
|
|
URIs: {{ MIRROR }}1
|
|
|
|
Suites: {{ DIST }}
|
|
|
|
Components: main
|
|
|
|
SOURCES
|
2024-10-11 16:29:25 +00:00
|
|
|
echo "deb {{ MIRROR }}2 {{ DIST }} main" >/tmp/sources
|
|
|
|
cat <<SOURCES | {{ CMD }} --mode={{ MODE }} --variant=apt {{ DIST }} \
|
|
|
|
/tmp/debian-chroot \
|
|
|
|
/tmp/deb822 \
|
|
|
|
- \
|
|
|
|
/tmp/sources
|
2022-05-25 14:02:09 +00:00
|
|
|
Types: deb
|
|
|
|
URIs: {{ MIRROR }}3
|
|
|
|
Suites: {{ DIST }}
|
|
|
|
Components: main
|
|
|
|
SOURCES
|
|
|
|
test ! -e /tmp/debian-chroot/etc/apt/sources.list
|
|
|
|
ls -lha /tmp/debian-chroot/etc/apt/sources.list.d/
|
2024-10-11 16:29:25 +00:00
|
|
|
cat <<SOURCES | cmp /tmp/debian-chroot/etc/apt/sources.list.d/0000deb822.sources -
|
2022-05-25 14:02:09 +00:00
|
|
|
Types: deb
|
|
|
|
URIs: {{ MIRROR }}1
|
|
|
|
Suites: {{ DIST }}
|
|
|
|
Components: main
|
|
|
|
SOURCES
|
2024-10-11 16:29:25 +00:00
|
|
|
cat <<SOURCES | cmp /tmp/debian-chroot/etc/apt/sources.list.d/0001main.sources -
|
2022-05-25 14:02:09 +00:00
|
|
|
Types: deb
|
|
|
|
URIs: {{ MIRROR }}3
|
|
|
|
Suites: {{ DIST }}
|
|
|
|
Components: main
|
|
|
|
SOURCES
|
|
|
|
echo "deb {{ MIRROR }}2 {{ DIST }} main" | cmp /tmp/debian-chroot/etc/apt/sources.list.d/0002sources.list -
|
|
|
|
tar -C /tmp/debian-chroot --one-file-system -c . \
|
2024-10-11 16:29:25 +00:00
|
|
|
| {
|
|
|
|
tar -t \
|
|
|
|
| grep -v "^./etc/apt/sources.list.d/0000deb822.sources$" \
|
|
|
|
| grep -v "^./etc/apt/sources.list.d/0001main.sources$" \
|
|
|
|
| grep -v "^./etc/apt/sources.list.d/0002sources.list$"
|
|
|
|
printf "./etc/apt/sources.list\n"
|
|
|
|
} | sort | diff -u tar1.txt -
|