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:
+15
-7
@@ -102,6 +102,14 @@ function version_ge {
|
|||||||
[ "$1" == "$latest" ]
|
[ "$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 Deb pkg to be removed:
|
||||||
KERNEL_IMAGE_OLD=linux-image-2.6.26-33-generic
|
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 \
|
$install gcc make socat psmisc xterm openssh-clients iperf \
|
||||||
iproute telnet python-setuptools libcgroup-tools \
|
iproute telnet python-setuptools libcgroup-tools \
|
||||||
ethtool help2man pyflakes pylint python-pep8 python-pexpect
|
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 \
|
$install gcc make socat psmisc xterm openssh iperf \
|
||||||
iproute telnet python-setuptools libcgroup-tools \
|
iproute telnet ${PYPKG}-setuptools libcgroup-tools \
|
||||||
ethtool help2man python-pyflakes python3-pylint python-pep8 python-pexpect
|
ethtool help2man python-pyflakes python3-pylint python-pep8 ${PYPKG}-pexpect
|
||||||
else
|
else # Debian/Ubuntu
|
||||||
$install gcc make socat psmisc xterm ssh iperf iproute2 telnet \
|
$install gcc make socat psmisc xterm ssh iperf iproute2 telnet \
|
||||||
python-setuptools cgroup-bin ethtool help2man \
|
cgroup-bin ethtool help2man pyflakes pylint pep8 \
|
||||||
pyflakes pylint pep8 python-pexpect
|
${PYPKG}-setuptools ${PYPKG}-pexpect
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing Mininet core"
|
echo "Installing Mininet core"
|
||||||
pushd $MININET_DIR/mininet
|
pushd $MININET_DIR/mininet
|
||||||
sudo make install
|
sudo PYTHON=${PYTHON} make install
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user