Skip to content

Commit

Permalink
travis: unset dev version properly (for upgrade)
Browse files Browse the repository at this point in the history
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
  • Loading branch information
rjbou and dra27 committed Jul 22, 2020
1 parent f1f3db0 commit 346e145
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ please run make configure and fixup the commit"
}

unset-dev-version () {
# unset git versioning to allow OPAMYES use for upgrade
sed -i -e 's/\(.*with-stdout-to get_git_version.ml.*@@\).*/\1 \\"let version = None\\"")))/' src/client/dune
# disable git versioning to allow OPAMYES use for upgrade
touch src/client/no-git-version
}

case "$TARGET" in
Expand Down
7 changes: 6 additions & 1 deletion src/client/dune
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@
(deps (universe))
(action (ignore-stderr (with-stdout-to %{targets} (system "git rev-parse --quiet --verify HEAD || echo .")))))

(rule
(targets no-git-version)
(mode fallback)
(action (copy git-sha %{targets})))

(rule
; Travis Upgrade job rely on this line. If changed, update travis-ci.sh too.
(with-stdout-to get_git_version.ml (echo "print_string @@ let v = \"%{read-lines:git-sha}\" in if v = \".\" then \"let version = None\" else \"let version = Some \\\"\" ^ v ^ \"\\\"\"")))
(with-stdout-to get_git_version.ml (echo "print_string @@ let v = \"%{read-lines:no-git-version}\" in if v = \".\" then \"let version = None\" else \"let version = Some \\\"\" ^ v ^ \"\\\"\"")))

(rule
(with-stdout-to opamGitVersion.ml (run ocaml %{dep:get_git_version.ml})))
Expand Down

0 comments on commit 346e145

Please sign in to comment.