···
-
# generated during the install step
-
source .travis-ocaml.env
-
# Ensure build logs are printed live
-
# display info about OS distribution and version
-
case $TRAVIS_OS_NAME in
-
echo OCAML_VERSION=$OCAML_VERSION
-
echo OPAM_SWITCH=$OPAM_SWITCH
-
echo pull req: $TRAVIS_PULL_REQUEST
-
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
-
curl -L https://github.com/$TRAVIS_REPO_SLUG/pull/$TRAVIS_PULL_REQUEST.diff -o pullreq.diff
-
git show > pullreq.diff.tmp
-
merge=`grep "^Merge: " pullreq.diff.tmp | awk -F: '{print $2}'`
-
if [ "$merge" = "" ]; then
-
mv pullreq.diff.tmp pullreq.diff
-
echo Merge detected, extracting $merge diff
-
git show $merge > pullreq.diff
-
case $TRAVIS_OS_NAME in
-
osx) export OPAMFETCH=wget ;;
-
# CR: this will be replaced with the OCamlot analysis of affected packages
-
cat pullreq.diff | sed -E -n -e 's,\+\+\+ b/packages/[^/]*/([^/]*)/.*,\1,p' | sort -u > tobuild.txt
-
# test for installability
-
echo "Checking for availability..."
-
if ! opam depext --with-test -ls $pkg; then
-
echo "Package unavailable."
-
if opam show $pkg; then
-
echo "Package is unavailable on this configuration, skipping:"
-
opam install $pkg --dry-run || true
-
echo "ERROR: Package not found."
-
echo "Maybe its definition failed to parse, check above."
-
echo "... package available."
-
depext=$(opam depext --with-test -ls $pkg)
-
opam depext --with-test $pkg
-
echo "====== Installing dependencies ======"
-
opam install --deps-only $pkg
-
echo "====== Installing package ======"
-
opam remove -a ${pkg%%.*}
-
if [ "$depext" != "" ]; then
-
case $TRAVIS_OS_NAME in
-
sudo apt-get remove $depext
-
sudo apt-get autoremove
-
echo "====== External dependency handling ======"
-
opam install 'opam-depext>=1.1.3'
-
for i in `cat tobuild.txt`; do
-
name=$(echo $i | cut -f1 -d".")
-
ocaml|ocaml-base-compiler) ;;