ligo/scripts/opam-check.sh

40 lines
1.1 KiB
Bash
Raw Normal View History

#! /bin/sh
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
src_dir="$(dirname "$script_dir")"
. "$script_dir"/version.sh
2018-07-24 22:29:08 +04:00
opams=$(find "$src_dir/vendors" "$src_dir/src" -name \*.opam -print)
echo "## Checking installed dependencies..."
echo
2018-07-24 22:29:08 +04:00
if ! opam install $opams --deps-only --with-test --show-actions | grep "Nothing to do." > /dev/null 2>&1 ; then
2018-07-06 19:12:05 +04:00
echo
echo 'Failure! Missing actions:'
echo
2019-01-22 05:02:54 +04:00
opam install $opams --deps-only --with-test --show-actions
2018-07-06 19:12:05 +04:00
echo
2018-07-24 22:29:08 +04:00
echo 'Failed! Please read the doc in `./scripts/update_opam_repo.sh` and act accordingly.'
2018-07-06 19:12:05 +04:00
echo
2018-07-24 22:29:08 +04:00
exit 1
fi
echo '## Running `./scripts/update_opam_repo.sh`'
echo
./scripts/update_opam_repo.sh
if [ -n "$(cat opam_repo.patch)" ] ; then
echo "##################################################"
2018-07-06 19:12:05 +04:00
cat opam_repo.patch
2018-07-24 22:29:08 +04:00
echo "##################################################"
echo 'Failed! The variables `opam_repository_tag` and `full_opam_repository_tag` are not synchronized. Please read the doc in `./scripts/update_opam_repo.sh` and act accordingly.'
2018-07-06 19:12:05 +04:00
echo
exit 1
fi
echo "Ok."