diff --git a/build-image.sh b/build-image.sh index cdb6432..63bf7ab 100755 --- a/build-image.sh +++ b/build-image.sh @@ -49,10 +49,15 @@ exit_err() exit -1 } -mkdir -p "${REPOS}" -mkdir -p "${DISTFILES}" -mkdir -p "${BINPKG}" -mkdir -p "${LOGDIR}" +_mkdir() +{ + mkdir -p "${@}" || exit_err "Could not create dir ${@}." +} + +_mkdir "${REPOS}" +_mkdir "${DISTFILES}" +_mkdir "${BINPKG}" +_mkdir "${LOGDIR}" podman pull gentoo/stage3:amd64-nomultilib-systemd podman build "${PODMAN_BUILD_ARGS[@]}" diff --git a/build-packages.sh b/build-packages.sh index fd8f1d3..902a560 100755 --- a/build-packages.sh +++ b/build-packages.sh @@ -45,10 +45,15 @@ exit_err() exit -1 } -mkdir -p "${REPOS}" -mkdir -p "${DISTFILES}" -mkdir -p "${BINPKG}" -mkdir -p "${LOGDIR}" +_mkdir() +{ + mkdir -p "${@}" || exit_err "Could not create dir ${@}." +} + +_mkdir "${REPOS}" +_mkdir "${DISTFILES}" +_mkdir "${BINPKG}" +_mkdir "${LOGDIR}" podman run "${PODMAN_BUILD_ARGS[@]}" "${REGISTRY}:${VERSION}" \ bash -c "emerge --usepkg --newuse --keep-going --oneshot --deep --update @world \