Merge branch '__package_pip_detect_pip_bin' into 'master'

[__package_pip] detect pip binary

See merge request ungleich-public/cdist!935
This commit is contained in:
poljakowski 2020-09-21 09:06:44 +02:00
commit 139a782c96
3 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,10 @@
#!/bin/sh -e
for bin in pip3 pip
do
if check="$( command -v "$bin" )"
then
echo "$check"
break
fi
done

View file

@ -32,7 +32,7 @@ pipparam="$__object/parameter/pip"
if [ -f "$pipparam" ]; then if [ -f "$pipparam" ]; then
pip=$(cat "$pipparam") pip=$(cat "$pipparam")
else else
pip="pip" pip="$( "$__type_explorer/pip" )"
fi fi
# If there is no pip, it may get created from somebody else. # If there is no pip, it may get created from somebody else.

View file

@ -38,7 +38,12 @@ pipparam="$__object/parameter/pip"
if [ -f "$pipparam" ]; then if [ -f "$pipparam" ]; then
pip=$(cat "$pipparam") pip=$(cat "$pipparam")
else else
pip="pip" pip="$( cat "$__object/explorer/pip" )"
if [ -z "$pip" ]
then
echo 'pip not found in path' >&2
exit 1
fi
fi fi
runasparam="$__object/parameter/runas" runasparam="$__object/parameter/runas"