From c462a080c33811e3f0e6e998edec91feae6dd7c9 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Fri, 1 May 2020 23:59:45 +0200 Subject: [PATCH] make_mirror.sh: create debootstrap directory with mktemp if debootstrap is run without qemu and make_mirror.sh is aborted the partly debootstrapped directory is left over. To avoid debootstrapping into the same directory (and failing at it) we generate a new temporary directory every time with mktemp --- make_mirror.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/make_mirror.sh b/make_mirror.sh index 61a19f7..630047d 100755 --- a/make_mirror.sh +++ b/make_mirror.sh @@ -558,15 +558,17 @@ fi mirror="http://127.0.0.1/debian" for dist in stable testing unstable; do for variant in minbase buildd -; do - echo running debootstrap --no-merged-usr --variant=$variant $dist /tmp/debian-$dist-debootstrap $mirror + echo "running debootstrap --no-merged-usr --variant=$variant $dist \${TEMPDIR} $mirror" cat << END > shared/test.sh #!/bin/sh set -eu export LC_ALL=C.UTF-8 export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH -debootstrap --no-merged-usr --variant=$variant $dist /tmp/debian-$dist-debootstrap $mirror -tar --sort=name --mtime=@$SOURCE_DATE_EPOCH --clamp-mtime --numeric-owner --one-file-system --xattrs -C /tmp/debian-$dist-debootstrap -c . > "$newcache/debian-$dist-$variant.tar" -rm -r /tmp/debian-$dist-debootstrap +tmpdir="\$(mktemp -d)" +chmod 755 "\$tmpdir" +debootstrap --no-merged-usr --variant=$variant $dist "\$tmpdir" $mirror +tar --sort=name --mtime=@$SOURCE_DATE_EPOCH --clamp-mtime --numeric-owner --one-file-system --xattrs -C "\$tmpdir" -c . > "$newcache/debian-$dist-$variant.tar" +rm -r "\$tmpdir" END if [ "$HAVE_QEMU" = "yes" ]; then cachedir=$newcachedir ./run_qemu.sh