#!/bin/bash

tmp1=$({ _utah_tmp_base="${TMPDIR:-/tmp}"; _utah_prefix=utah; _utah_prefix=$(echo "${_utah_prefix}" | tr -cd '[:alnum:]_.-'); [ -z "${_utah_prefix}" ] && _utah_prefix=utah; if command -v mktemp >/dev/null 2>&1; then dir=$(mktemp -d -t "${_utah_prefix}.XXXXXXXX" 2>/dev/null) || dir=$(mktemp -d "${_utah_tmp_base%/}/${_utah_prefix}.XXXXXXXX" 2>/dev/null); fi; if [ -z "${dir}" ]; then for _i in 1 2 3 4 5 6 7 8 9 10; do _suf=$(LC_ALL=C tr -dc 'a-z0-9' </dev/urandom | head -c12); [ -z "${_suf}" ] && _suf=$$; _cand="${_utah_tmp_base%/}/${_utah_prefix}-${_suf}"; if mkdir -m 700 "${_cand}" 2>/dev/null; then dir="${_cand}"; break; fi; done; fi; if [ -z "${dir}" ]; then echo "Error: Could not create temporary directory" >&2; exit 1; fi; echo "${dir}"; })
echo "TMP1: ${tmp1}"
tmp2=$({ _utah_tmp_base="${TMPDIR:-/tmp}"; _utah_prefix="job"; _utah_prefix=$(echo "${_utah_prefix}" | tr -cd '[:alnum:]_.-'); [ -z "${_utah_prefix}" ] && _utah_prefix=utah; if command -v mktemp >/dev/null 2>&1; then dir=$(mktemp -d -t "${_utah_prefix}.XXXXXXXX" 2>/dev/null) || dir=$(mktemp -d "${_utah_tmp_base%/}/${_utah_prefix}.XXXXXXXX" 2>/dev/null); fi; if [ -z "${dir}" ]; then for _i in 1 2 3 4 5 6 7 8 9 10; do _suf=$(LC_ALL=C tr -dc 'a-z0-9' </dev/urandom | head -c12); [ -z "${_suf}" ] && _suf=$$; _cand="${_utah_tmp_base%/}/${_utah_prefix}-${_suf}"; if mkdir -m 700 "${_cand}" 2>/dev/null; then dir="${_cand}"; break; fi; done; fi; if [ -z "${dir}" ]; then echo "Error: Could not create temporary directory" >&2; exit 1; fi; echo "${dir}"; })
echo "TMP2: ${tmp2}"
base="/var/tmp"
tmp3=$({ _utah_tmp_base=${base}; _utah_prefix="build"; _utah_prefix=$(echo "${_utah_prefix}" | tr -cd '[:alnum:]_.-'); [ -z "${_utah_prefix}" ] && _utah_prefix=utah; if command -v mktemp >/dev/null 2>&1; then dir=$(mktemp -d -p "${_utah_tmp_base}" "${_utah_prefix}.XXXXXXXX" 2>/dev/null) || dir=$(mktemp -d "${_utah_tmp_base%/}/${_utah_prefix}.XXXXXXXX" 2>/dev/null); fi; if [ -z "${dir}" ]; then for _i in 1 2 3 4 5 6 7 8 9 10; do _suf=$(LC_ALL=C tr -dc 'a-z0-9' </dev/urandom | head -c12); [ -z "${_suf}" ] && _suf=$$; _cand="${_utah_tmp_base%/}/${_utah_prefix}-${_suf}"; if mkdir -m 700 "${_cand}" 2>/dev/null; then dir="${_cand}"; break; fi; done; fi; if [ -z "${dir}" ]; then echo "Error: Could not create temporary directory" >&2; exit 1; fi; echo "${dir}"; })
echo "TMP3: ${tmp3}"
