From c67b5ea1deacddeef7a6d54172e6a655ce8ceaaa Mon Sep 17 00:00:00 2001 From: Josef Holzmayr Date: Fri, 11 Feb 2022 15:07:50 +0100 Subject: [PATCH] docker-mender-convert: fix mktemp invocation for macOS/*BSD Changelog: fix compatibility of docker-mender-convert with macOS/*BSD The macOS/*BSD versions of mktemp do not support the -p flag for passing in a path prefix. Fixing this by making $(pwd) part of the template (-t). Based on a suggestion at [1]. [1]: https://hub.mender.io/t/bug-convert-a-raw-disk-image-in-macos-fails-mktemp-illegal-option-p/4428/3?u=theyoctojester Signed-off-by: Josef Holzmayr --- docker-mender-convert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-mender-convert b/docker-mender-convert index a2dad60..a4cb80d 100755 --- a/docker-mender-convert +++ b/docker-mender-convert @@ -26,7 +26,7 @@ MENDER_CONVERT_DIR="$(pwd)" MENDER_CONVERT_VERSION=$(git_mender_convert_version) # Create a unique work directory so we can run multiple containers in parallel -WORK_DIR=$(mktemp -d -p $(pwd) -t work.XXXX) +WORK_DIR=$(mktemp -d $(pwd)/work.XXXX) WORK_SUFFIX=$(echo $WORK_DIR | awk -F. '{print $NF}') LOG_FILE="convert.log.${WORK_SUFFIX}"