Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add install-dependencies script and use it for .travis.yml install.
- Loading branch information
1 parent
25e6543
commit 2c9bc88
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x -- | ||
|
||
# $1 should be $TWISTED_VERSION from .travis.yml | ||
# $2 should be $PYOPENSSL_VERSION from .travis.yml | ||
|
||
SUDO= | ||
APT_GET=$(which apt-get) | ||
APT_FLAGS='-q --no-install-suggests --no-install-recommends' | ||
PIP=$(which pip) | ||
PIP_FLAGS='--no-use-wheel' | ||
DEPENDS="build-essential openssl sqlite3 python-dev python-setuptools" | ||
DEPENDS="${DEPENDS} libgeoip-dev geoip-database libjpeg-dev" | ||
HERE=$(dirname $0) | ||
|
||
if [ "$EUID" != "0" ] ; then SUDO=$(which sudo); fi | ||
# pip is pre-installed on Travis-CI machines in their Python environment, so | ||
# we should avoid reinstalling it (as that might do odd things to the | ||
# virtualenv that we're already inside): | ||
if [ "$TRAVIS" != "true" ] ; then | ||
DEPENDS="${DEPENDS} python-pip" | ||
fi | ||
|
||
MISSING="" | ||
for dep in $DEPENDS ; do | ||
if ! test "$(dpkg -l $dep | grep \"ii $dep\")" ; then | ||
MISSING="${MISSING} $dep" | ||
fi | ||
done | ||
|
||
$SUDO $APT_GET install ${APT_FLAGS} ${MISSING} | ||
|
||
if [ "$TRAVIS" == "true" ] ; then | ||
$PIP install $PIP_FLAGS -r "$HERE/../.travis.requirements.txt" | ||
else | ||
$PIP install $PIP_FLAGS -r "$HERE/../requirements.txt" | ||
fi |