diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index aecbae6202146b762ad3136fc2f60c29977f812b..bbdfe9747e6f355a86a3fc9880fec45fa0b2360d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,7 +3,7 @@ image: ralfjung/opam-ci:latest
 lrust-coq8.6:
   script:
   # prepare
-  - . build/opam-ci.sh 'coq 8.6' 'coq-mathcomp-ssreflect 1.6.1'
+  - . build/opam-ci.sh coq 8.6 coq-mathcomp-ssreflect 1.6.1
   # build
   - 'time make -j8 TIMED=y 2>&1 | tee build-log.txt'
   - 'if fgrep Axiom build-log.txt >/dev/null; then exit 1; fi'
diff --git a/build/opam-ci.sh b/build/opam-ci.sh
index e952573636e81572cd9e5de6607331fe326daa33..c4189bab6cf3199a00526ea958918c909cfd23d5 100755
--- a/build/opam-ci.sh
+++ b/build/opam-ci.sh
@@ -14,14 +14,19 @@ test -d "$OPAMROOT/repo/coq-extra-dev" || opam repo add coq-extra-dev https://co
 test -d "$OPAMROOT/repo/coq-core-dev" || opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev -p 5
 test -d "$OPAMROOT/repo/coq-released" || opam repo add coq-released https://coq.inria.fr/opam/released -p 10
 opam update
-opam install ocamlfind -y # Remove this once the Coq crew fixed their package...
 
 # Install fixed versions of some dependencies
 echo
-for PIN in "${@}"
-do
-    echo "Applying pin: $PIN"
-    opam pin add $PIN -k version -y
+while (( "$#" )); do # while there are arguments left
+    PACKAGE="$1" ; shift
+    VERSION="$1" ; shift
+    # Check if the pin is already set
+    if opam pin list | fgrep "$PACKAGE.$VERSION " > /dev/null; then
+        echo "[opam-ci] $PACKAGE already pinned to $VERSION"
+    else
+        echo "[opam-ci] Pinning $PACKAGE to $VERSION"
+        opam pin add "$PACKAGE" "$VERSION" -k version -y
+    fi
 done
 
 # Install build-dependencies