forked from josch/mmdebstrap
hooks/copy-host-apt-sources-and-preferences/setup00.sh: mkdir parent directories if necessary
This commit is contained in:
parent
fd33bd2a40
commit
2856fbdda3
1 changed files with 3 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue