Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
  • Loading branch information
andyneff committed Sep 25, 2020
1 parent 40f2f0d commit 95a3e77
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions 30_get-pipenv
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,62 @@

#*# docker/recipes/get-pipenv

# Temp fix for https://github.com/pypa/virtualenv/issues/1949
if [ -f "${VSI_COMMON_DIR-}/linux/real_path" ]; then
source "${VSI_COMMON_DIR}/linux/real_path"
else
if command -v realpath > /dev/null 2>&1; then
function real_path()
{
realpath ${@+"${@}"}
}
elif readlink -f / > /dev/null 2>&1; then
function real_path()
{
readlink -f ${@+"${@}"}
}
else
function real_path()
{
for x in "${@}"; do
real_path_manual "${x}"
done
}
fi

function real_path_manual()
{
pushd "$(dirname "${1}")" &> /dev/null
local target="$(basename "${1}")"

while [ -L "$target" ]
do
target="$(readlink "$target")"
cd "$(dirname "${target}")"
target="$(basename "${target}")"
done

local physical_dir="$(pwd -P)"

if [ "${target}" = "." ]; then
target=""
else
target="/${target}"
fi
popd &> /dev/null

if [ "${physical_dir}" = "/" ]; then
if [ "${target}" = "//" ] || [ "${target}" = "" ]; then
echo /
else
echo "$target"
fi
else
echo "${physical_dir}$target"
fi
}
fi

#**
# .. default-domain:: bash
#
Expand Down Expand Up @@ -77,6 +133,9 @@ install_pipenv()
" "${virtualenv_pyz}"
fi

# Temp fix for https://github.com/pypa/virtualenv/issues/1949
virtualenv_pyz="$(real_path "${virtualenv_pyz}")"

# create output virtualenv
"${PIPENV_PYTHON}" "${virtualenv_pyz}" "${output_dir}"

Expand Down

0 comments on commit 95a3e77

Please sign in to comment.