Commit b5096d70 by Riccardo Vicedomini

attempt to fix macOS problem with mktemp

parent 8113881f
...@@ -145,10 +145,13 @@ fi ...@@ -145,10 +145,13 @@ fi
# Create temp working directory # Create temp working directory
if [ -z "${PV_TMPDIR}" ]; then if [ -z "${PV_TMPDIR}" ]; then
PV_TMPDIR=$(mktemp -p "${TMPDIR:-.}" -d pvtmp-XXXXX) || { if [ check_system = "Linux" ]; then
print_error "cannot create temporary directory" PV_TMPDIR=$(mktemp -p "${PWD}" -d pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
exit 1 else
} PV_TMPDIR=$(mktemp -d "${PWD}"/pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
fi
else
mkdir -p "${PV_TMPDIR}" || { print_error "cannot create temporary directory"; exit 1; }
fi fi
PV_TMPDIR=$(abspath "${PV_TMPDIR}") PV_TMPDIR=$(abspath "${PV_TMPDIR}")
if [ ! -d "${PV_TMPDIR}" ] || [ -n "$(ls -A "${PV_TMPDIR}")" ]; then if [ ! -d "${PV_TMPDIR}" ] || [ -n "$(ls -A "${PV_TMPDIR}")" ]; then
......
...@@ -181,10 +181,13 @@ fi ...@@ -181,10 +181,13 @@ fi
# Create temp working directory # Create temp working directory
if [ -z "${PV_TMPDIR}" ]; then if [ -z "${PV_TMPDIR}" ]; then
PV_TMPDIR=$(mktemp -p "${TMPDIR:-.}" -d pvtmp-XXXXX) || { if [ check_system = "Linux" ]; then
print_error "cannot create temporary directory" PV_TMPDIR=$(mktemp -p "${PWD}" -d pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
exit 1 else
} PV_TMPDIR=$(mktemp -d "${PWD}"/pvtmp-XXXXX) || { print_error "cannot create temporary directory"; exit 1; }
fi
else
mkdir -p "${PV_TMPDIR}" || { print_error "cannot create temporary directory"; exit 1; }
fi fi
PV_TMPDIR=$(abspath "${PV_TMPDIR}") PV_TMPDIR=$(abspath "${PV_TMPDIR}")
if [ ! -d "${PV_TMPDIR}" ] || [ -n "$(ls -A "${PV_TMPDIR}")" ]; then if [ ! -d "${PV_TMPDIR}" ] || [ -n "$(ls -A "${PV_TMPDIR}")" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment