aboutgitcode
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-04-06 15:25:17 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-04-06 15:35:55 +0200
commitb87e4f2e65958ef3d44ee640b6f9114cc5157a09 (patch)
tree85fb1158f8880490e79aaf87adf935716eaab602
parent4a4014391b6be9629046fbbd1968e175805ed9d4 (diff)
downloadmbuto-b87e4f2e65958ef3d44ee640b6f9114cc5157a09.tar
mbuto-b87e4f2e65958ef3d44ee640b6f9114cc5157a09.tar.gz
mbuto-b87e4f2e65958ef3d44ee640b6f9114cc5157a09.tar.bz2
mbuto-b87e4f2e65958ef3d44ee640b6f9114cc5157a09.tar.lz
mbuto-b87e4f2e65958ef3d44ee640b6f9114cc5157a09.tar.xz
mbuto-b87e4f2e65958ef3d44ee640b6f9114cc5157a09.tar.zst
mbuto-b87e4f2e65958ef3d44ee640b6f9114cc5157a09.zip
mbuto: Create working directory before profiles are sourced
This offers some flexibility to source things from profile definitions themselves. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-xmbuto7
1 files 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}"