Commit 39c267a4 authored by Ralf Jung's avatar Ralf Jung

skip opam upgrade if we are working in a fresh opam root

parent e5c45351
...@@ -12,14 +12,18 @@ else ...@@ -12,14 +12,18 @@ else
echo_color "$BOLDYELLOW" "[prepare-opam] Creating new opam root" echo_color "$BOLDYELLOW" "[prepare-opam] Creating new opam root"
mkdir "$OPAMROOT" mkdir "$OPAMROOT"
opam init --no-setup -y opam init --no-setup -y
FRESH_OPAM=yes
fi fi
eval `opam conf env` eval `opam conf env`
# Make sure the pin for the builddep package exists and is up-to-date if [[ -z "$FRESH_OPAM" ]]; then # skip if this is a fresh opam root
make build-dep/opam # Make sure the pin for the builddep package exists and is up-to-date.
# This avoids opam complaining about pins pointing to a non-existing file.
make build-dep/opam
# Update repositories # Update repositories
opam update opam update
fi
# Make sure we got the right set of repositories registered # Make sure we got the right set of repositories registered
if echo "$@" | fgrep "dev" > /dev/null; then if echo "$@" | fgrep "dev" > /dev/null; then
...@@ -56,10 +60,12 @@ while (( "$#" )); do # while there are arguments left ...@@ -56,10 +60,12 @@ while (( "$#" )); do # while there are arguments left
done done
echo echo
# Upgrade cached things. if [[ -z "$FRESH_OPAM" ]]; then # skip if this is a fresh opam root
echo_color "$BOLDGREEN" "[prepare-opam] Upgrading packages" # Upgrade cached things
opam upgrade -y --fixup && opam upgrade -y echo_color "$BOLDGREEN" "[prepare-opam] Upgrading packages"
echo opam upgrade -y --fixup && opam upgrade -y
echo
fi
# Install build-dependencies. # Install build-dependencies.
echo_color "$BOLDGREEN" "[prepare-opam] Installing build-dependencies" echo_color "$BOLDGREEN" "[prepare-opam] Installing build-dependencies"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment