From 49d06429321a721025d91bb5af8484c715a93ec6 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sun, 24 Feb 2019 10:49:01 +0100 Subject: [PATCH] make_mirror.sh: only replace mini-httpd config in qcow image if HAVE_QEMU = yes --- make_mirror.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/make_mirror.sh b/make_mirror.sh index a65ddb6..8bc4517 100755 --- a/make_mirror.sh +++ b/make_mirror.sh @@ -361,16 +361,18 @@ END done done -# now replace the minihttpd config with one that serves the new repository -# create a temporary directory because "copy-in" cannot rename the file -tmpdir="$(mktemp -d)" -cat << END > "$tmpdir/mini-httpd" +if [ "$HAVE_QEMU" = "yes" ]; then + # now replace the minihttpd config with one that serves the new repository + # create a temporary directory because "copy-in" cannot rename the file + tmpdir="$(mktemp -d)" + cat << END > "$tmpdir/mini-httpd" START=1 DAEMON_OPTS="-h 127.0.0.1 -p 80 -u nobody -dd /mnt/cache -i /var/run/mini-httpd.pid -T UTF-8" END -guestfish -a "$newcachedir/debian-unstable.qcow" -i copy-in "$tmpdir/mini-httpd" /etc/default -rm "$tmpdir/mini-httpd" -rmdir "$tmpdir" + guestfish -a "$newcachedir/debian-unstable.qcow" -i copy-in "$tmpdir/mini-httpd" /etc/default + rm "$tmpdir/mini-httpd" + rmdir "$tmpdir" +fi # delete possibly leftover symlink if [ -e ./shared/cache.tmp ]; then