2017-12-06 22:51:49 +04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
|
|
|
|
src_dir="$(dirname "$script_dir")"
|
|
|
|
cd "$src_dir"
|
|
|
|
|
|
|
|
cleanup () {
|
|
|
|
set +e
|
|
|
|
if [ -f LOG ]; then
|
|
|
|
echo "Failure"
|
|
|
|
echo
|
|
|
|
cat LOG
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
trap cleanup EXIT INT
|
|
|
|
|
|
|
|
silent () {
|
|
|
|
"$@" > LOG 2>&1
|
|
|
|
rm LOG
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "Updating package description..."
|
|
|
|
silent . ./scripts/opam-pin.sh
|
|
|
|
|
2018-05-25 11:56:14 +04:00
|
|
|
upgradables=$(opam list --short --installed --pinned $packages)
|
2017-12-06 22:51:49 +04:00
|
|
|
|
|
|
|
if [ -z "$upgradables" ]; then
|
|
|
|
echo "No previously installed package. Nothing to do."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
opam upgrade $upgradables
|