From 2856fbdda3fbd6eb64e83d8540714031ce8c241e Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sat, 28 Oct 2023 15:24:06 +0200 Subject: [PATCH] hooks/copy-host-apt-sources-and-preferences/setup00.sh: mkdir parent directories if necessary --- hooks/copy-host-apt-sources-and-preferences/setup00.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hooks/copy-host-apt-sources-and-preferences/setup00.sh b/hooks/copy-host-apt-sources-and-preferences/setup00.sh index d04e6c8..07caa78 100755 --- a/hooks/copy-host-apt-sources-and-preferences/setup00.sh +++ b/hooks/copy-host-apt-sources-and-preferences/setup00.sh @@ -29,10 +29,13 @@ for f in "$SOURCELIST" \ "$PREFERENCES" \ "$PREFERENCESPARTS"/*; do [ -e "$f" ] || continue + mkdir --parents "$(dirname "$rootdir/$f")" if [ -e "$rootdir/$f" ]; then if [ "${MMDEBSTRAP_VERBOSITY:-1}" -ge 2 ]; then echo "I: $f already exists in chroot, appending..." >&2 fi + # Add extra newline between old content and new content. + # This is required in case of deb822 files. echo >> "$rootdir/$f" fi cat "$f" >> "$rootdir/$f"