2023-02-11 14:26:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
export LC_ALL=C.UTF-8
|
|
|
|
export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }}
|
|
|
|
|
|
|
|
tmpdir="$(mktemp -d)"
|
|
|
|
chmod 755 "$tmpdir"
|
2024-06-12 09:41:17 +00:00
|
|
|
ret=0
|
|
|
|
debootstrap "$([ "{{ DIST }}" = oldstable ] && echo --no-merged-usr || echo --merged-usr)" --variant={{ VARIANT }} {{ DIST }} "$tmpdir" {{ MIRROR }} || ret=$?
|
|
|
|
if [ "$ret" -ne 0 ]; then
|
2024-10-11 16:29:25 +00:00
|
|
|
echo "E: debootstrap failed, dumping $tmpdir/debootstrap/debootstrap.log"
|
|
|
|
cat "$tmpdir/debootstrap/debootstrap.log"
|
|
|
|
exit 1
|
2024-06-12 09:41:17 +00:00
|
|
|
fi
|
2024-10-11 16:29:25 +00:00
|
|
|
tar --sort=name --mtime=@$SOURCE_DATE_EPOCH --clamp-mtime --numeric-owner --one-file-system --xattrs -C "$tmpdir" -c . >"./cache/debian-{{ DIST }}-{{ VARIANT }}.tar"
|
2023-02-11 14:26:48 +00:00
|
|
|
rm -r "$tmpdir"
|