Browse Source

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 <josef.holzmayr@northern.tech>
change-dependabot-prefix
Josef Holzmayr 3 years ago
parent
commit
c67b5ea1de
  1. 2
      docker-mender-convert

2
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}"

Loading…
Cancel
Save