Missing binary packages don't interrupt tools/ci/tox script
Change-Id: Id763634bb436b598fd90ea8e2f51d5f4e3fcfdd1
This commit is contained in:
parent
eb10374b68
commit
7ead7d7602
31
tools/ci/tox
31
tools/ci/tox
@ -45,7 +45,6 @@ function tox_setup {
|
|||||||
tox_pip install --upgrade setuptools wheel virtualenv tox
|
tox_pip install --upgrade setuptools wheel virtualenv tox
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tox_install_bindeps
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +82,8 @@ function tox_activate {
|
|||||||
source "${venv_script}"
|
source "${venv_script}"
|
||||||
set -eu
|
set -eu
|
||||||
tox_is_active
|
tox_is_active
|
||||||
|
|
||||||
|
tox_install_bindeps
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,19 +99,25 @@ function tox_install_bindeps {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local bindep=${BINDEP:-$(which bindep)}
|
|
||||||
if ! [ -x "${bindep}" ]; then
|
|
||||||
tox_pip install bindep
|
|
||||||
bindep=$(which bindep)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# process ${BINDEP_FILE}
|
# process ${BINDEP_FILE}
|
||||||
local missing_packages=( $("${bindep}" -b -f "${bindep_file}") )
|
local missing_packages=( $(bindep -b -f "${bindep_file}") )
|
||||||
if [ "${#missing_packages[@]}" != "0" ]; then
|
if [ "${#missing_packages[@]}" != "0" ]; then
|
||||||
tox_install_packages "${missing_packages[@]}"
|
tox_install_packages "${missing_packages[@]}"
|
||||||
if ! "${bindep}" -f "${bindep_file}"; then
|
"${BINDEP}" -f "${bindep_file}"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function bindep {
|
||||||
|
export BINDEP=${BINDEP:-$(get_bindep)}
|
||||||
|
"${BINDEP}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_bindep {
|
||||||
|
if ! which bindep; then
|
||||||
|
tox_pip install bindep > /dev/null
|
||||||
|
which bindep
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,8 +141,8 @@ function tox_install_packages {
|
|||||||
sudo apt-get install -y "${packages[@]}"
|
sudo apt-get install -y "${packages[@]}"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Unsupported Linux distribution" 1>&2
|
echo -e "Don't know how to install packages this platform"
|
||||||
exit 1
|
bindep --profiles 1>&2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user