Commit d4f830d7 authored by Ralf Jung's avatar Ralf Jung
Browse files

improve 'package already pinned' check

parent 1763e08e
......@@ -51,10 +51,11 @@ while (( "$#" )); do # while there are arguments left
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"
PIN=$(opam pin list | egrep "^$PACKAGE\.")
if [[ "$(echo "$PIN" | cut -d ' ' -f 2)" == "$KIND" && "$(echo "$PIN" | cut -d ' ' -f 3)" == "$VERSION" ]]; then
echo "[opam-ci] $PACKAGE already $KIND-pinned to $VERSION"
echo "[opam-ci] Pinning $PACKAGE to $VERSION"
echo "[opam-ci] $KIND-pinning $PACKAGE to $VERSION"
run_and_print opam pin add -y -k "$KIND" "$PACKAGE" "$VERSION"
Supports Markdown
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