Detect EL8 platform-python
Otherwise, this script fails to run on Enterprise Linux 8 distros. Change-Id: I0168b380d0e201d9c8f8121b384d25a2412c2129 Signed-off-by: Luke Short <ekultails@gmail.com>
This commit is contained in:
parent
a50afeba34
commit
2d692e22f4
@ -16,8 +16,17 @@
|
|||||||
# but pkg_resources can't be imported.
|
# but pkg_resources can't be imported.
|
||||||
echo "import pkg_resources" | python3 2>/dev/null
|
echo "import pkg_resources" | python3 2>/dev/null
|
||||||
has_py3=$?
|
has_py3=$?
|
||||||
|
echo "import pkg_resources" | python2 2>/dev/null
|
||||||
|
has_py2=$?
|
||||||
|
echo "import pkg_resources" | /usr/libexec/platform-python 2>/dev/null
|
||||||
|
has_platform-py=$?
|
||||||
|
|
||||||
if [ $has_py3 = 0 ]; then
|
if [ $has_py3 = 0 ]; then
|
||||||
interpreter="python3"
|
interpreter="python3"
|
||||||
|
elif [ $has_py2 = 0 ]; then
|
||||||
|
interpreter="python"
|
||||||
|
elif [ $has_platform-py = 0 ]; then
|
||||||
|
interpreter="/usr/libexec/platform-python"
|
||||||
else
|
else
|
||||||
interpreter="python"
|
interpreter="python"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user