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 23, 2020
1 parent f1f3db0 commit caad36c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ autom4te.cache
src/ocaml-flags-configure.sexp
src/**/.merlin
src/client/linking.sexp
src/client/no-git-version
src/core/developer
src/manifest/dune
src/manifest/install.inc
Expand Down
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 = \"\" || 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 caad36c

Please sign in to comment.