Add PYTHON and python2/python3 support

Perhaps we should have an option for py2/p3, but for
now we detect the default python version and it can
also be specified via the PYTHON env var.
This commit is contained in:
Bob Lantz
2018-07-25 19:44:46 -07:00
parent 2ac4f92af3
commit f4490069ca
+15 -7
View File
@@ -102,6 +102,14 @@ function version_ge {
[ "$1" == "$latest" ]
}
# Attempt to identify Python version
PYTHON=${PYTHON:-python}
if $PYTHON --version |& grep 'Python 2' > /dev/null; then
PYTHON_VERSION=2; PYPKG=python
else
PYTHON_VERSION=3; PYPKG=python3
fi
echo "${PYTHON} is version ${PYTHON_VERSION}"
# Kernel Deb pkg to be removed:
KERNEL_IMAGE_OLD=linux-image-2.6.26-33-generic
@@ -145,19 +153,19 @@ function mn_deps {
$install gcc make socat psmisc xterm openssh-clients iperf \
iproute telnet python-setuptools libcgroup-tools \
ethtool help2man pyflakes pylint python-pep8 python-pexpect
elif [ "$DIST" = "SUSE LINUX" ]; then
elif [ "$DIST" = "SUSE LINUX" ]; then
$install gcc make socat psmisc xterm openssh iperf \
iproute telnet python-setuptools libcgroup-tools \
ethtool help2man python-pyflakes python3-pylint python-pep8 python-pexpect
else
iproute telnet ${PYPKG}-setuptools libcgroup-tools \
ethtool help2man python-pyflakes python3-pylint python-pep8 ${PYPKG}-pexpect
else # Debian/Ubuntu
$install gcc make socat psmisc xterm ssh iperf iproute2 telnet \
python-setuptools cgroup-bin ethtool help2man \
pyflakes pylint pep8 python-pexpect
cgroup-bin ethtool help2man pyflakes pylint pep8 \
${PYPKG}-setuptools ${PYPKG}-pexpect
fi
echo "Installing Mininet core"
pushd $MININET_DIR/mininet
sudo make install
sudo PYTHON=${PYTHON} make install
popd
}