Skip to content

Commit

Permalink
Merge pull request #324 from wilzbach/tags
Browse files Browse the repository at this point in the history
Fix Travis: fix checking out tags with setup.sh
  • Loading branch information
wilzbach committed Feb 20, 2018
2 parents eb4c9b1 + 72236e1 commit d8620e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions setup.sh
Expand Up @@ -31,6 +31,7 @@ parallel=8
model=64
build="release"
githubUri="https://github.com/"
tag=""
# List of projects to install vs. update. Their disjoint union is
# $projects.
declare -a toInstall toUpdate
Expand Down Expand Up @@ -65,10 +66,10 @@ function handleCmdLine() {
for arg in "$@"; do
case "$arg" in
--tag=*)
tag="${arg//[-a-zA-Z0-9]*=//}"
tag="${arg//[-a-zA-Z0-9]*=/}"
;;
--user=*)
githubUser="${arg//[-a-zA-Z0-9]*=//}"
githubUser="${arg//[-a-zA-Z0-9]*=/}"
;;
install)
install="yes"
Expand Down Expand Up @@ -149,8 +150,10 @@ function installAnew() {
echo "Getting $project failed." >&2
exit 1
fi
if [ ! -z "${tag+x}" ] ; then
if [ "$project" == "dmd" ] -o [ "$project" == "druntime" ] -o [ "$project" == "phobos" ] -o [ "$project" == "dlang.org" ] ; then
if [ -n "${tag}" ] ; then
if [ "$project" == "dmd" ] || [ "$project" == "druntime" ] || \
[ "$project" == "phobos" ] || [ "$project" == "dlang.org" ] || \
[ "$project" == "tools" ] ; then
git -C "$wd/$project" checkout "v$tag"
fi
fi
Expand Down
2 changes: 2 additions & 0 deletions travis.sh
Expand Up @@ -33,6 +33,8 @@ echo 'void main(){ import std.stdio; "Hello World".writeln;}' | "./${dmd}" -run
popd && rm -rf "$dir" && mkdir "$dir" && pushd "$dir"

# test checking out tags
# requires an older host compiler too, see also: https://github.com/dlang/tools/pull/324
. $(~/dlang/install.sh install dmd-2.078.1 -a)
echo "y" | "$cwd"/setup.sh --tag=2.078.1
echo 'void main(){ import std.stdio; __VERSION__.writeln;}' | "./2.078.1/${dmd}" -run - | grep -q "2078"
popd

0 comments on commit d8620e2

Please sign in to comment.