python-sphinx creates a symlink pointing ../share/sphinx/scripts/python2/sphinx-build
to /usr/bin/sphinx-build even if python3-sphinx is already installed.
in that case, if python-sphinx is installed after python3-sphinx,
sphinx-build is in python2. and it breaks the build of master, as we are
using python3 syntax in conf.py since
e9e17b9ceff0c862c8f29d629ad54a1dc401ed73.
and we are still using python2 as well as "python-sphinx" when building nautilus,
so if a build slave happen to compile nautilus before it is scheduled to
build master or a wip- branch, the doc build fails.
in this change, python-sphinx is uninstalled, if /usr/bin/sphinx-build
is found to be written in python2.
Signed-off-by: Kefu Chai <kchai@redhat.com>
$SUDO ln -nsf /usr/bin/g++ /usr/bin/${ARCH}-linux-gnu-g++
}
+function ensure_python3_sphinx_on_ubuntu {
+ local sphinx_command=/usr/bin/sphinx-build
+ # python-sphinx points $sphinx_command to
+ # ../share/sphinx/scripts/python2/sphinx-build when it's installed
+ # let's "correct" this
+ if test -e $sphinx_command && head -n1 $sphinx_command | grep -q python$; then
+ $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove python-sphinx
+ fi
+}
+
function install_pkg_on_ubuntu {
local project=$1
shift
echo "Using apt-get to install dependencies"
$SUDO apt-get install -y devscripts equivs
$SUDO apt-get install -y dpkg-dev
+ ensure_python3_sphinx_on_ubuntu
case "$VERSION" in
*Bionic*)
ensure_decent_gcc_on_ubuntu 9 bionic