From b87e4f2e65958ef3d44ee640b6f9114cc5157a09 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 6 Apr 2022 15:25:17 +0200 Subject: mbuto: Create working directory before profiles are sourced This offers some flexibility to source things from profile definitions themselves. Signed-off-by: Stefano Brivio --- mbuto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mbuto b/mbuto index 0003262..4f27242 100755 --- a/mbuto +++ b/mbuto @@ -394,7 +394,6 @@ workers() { # cpio_init() - Source existing CPIO archive, or create if needed # $1: Path to CPIO archive, might exist, might be discarded if existing cpio_init() { - wd="$("${MKTEMP}" -d)" if [ -f "${OUT}" ] && [ "${1}" != "discard" ]; then info "Sourcing CPIO archive from ${OUT}" @@ -566,7 +565,7 @@ libs_copy() { [ "$("${BASENAME}" "${__path}")" = "libfakeroot-sysv.so" ] && \ continue - __destpath="${wd}/${__path}" + __destpath="${wd}${__path}" [ -f "${__destpath}" ] && continue __destdir="$("${DIRNAME}" "${__destpath}")" @@ -918,7 +917,6 @@ stats() { # cmds() - Loop over non-option arguments if any, just build image otherwise # $@: Command arguments cmds() { - wd= { [ ! -f "${OUT}" ] || [ -z "${1}" ]; } && build for arg do @@ -1050,6 +1048,9 @@ for __l in ${TOOLS}; do cmd_check "${__l}" done +# Create working directory +wd="$("${MKTEMP}" -d)" + # Apply profile requested via -p, if any, from matching profile_*() function if [ -n "${PROFILE}" ]; then notice "Applying profile ${PROFILE}" -- cgit v1.2.3