5 source .travis
/common.sh
7 ##########################################################################
9 # Fixing Travis's git clone
11 echo 'Fixing git setup...' && echo -en 'travis_fold:start:before_install.git\\r'
13 git fetch
--unshallow && git fetch
--tags
15 # For pull requests, we get more info about the git source.
16 if [ z
"$TRAVIS_PULL_REQUEST_SLUG" != z
]; then
17 echo "- Fetching from pull request source"
18 git remote add
source https
://github.com
/$TRAVIS_PULL_REQUEST_SLUG.git
19 git fetch
source && git fetch
--tags
21 echo "- Fetching the actual pull request"
22 git fetch origin pull
/$TRAVIS_PULL_REQUEST/head:pull-
$TRAVIS_PULL_REQUEST-head
23 git fetch origin pull
/$TRAVIS_PULL_REQUEST/merge
:pull-
$TRAVIS_PULL_REQUEST-merge
25 git log
-n 5 --graph pull-
$TRAVIS_PULL_REQUEST-merge
28 # For building branches we need to fix the "detached head" state.
29 if [ z
"$TRAVIS_BRANCH" != z
]; then
30 TRAVIS_COMMIT_ACTUAL
=$
(git log
--pretty=format
:'%H' -n 1)
31 echo "- Fixing detached head (current $TRAVIS_COMMIT_ACTUAL -> $TRAVIS_COMMIT)"
32 git fetch origin
$TRAVIS_COMMIT
34 git branch
-D $TRAVIS_BRANCH || true
35 git checkout
$TRAVIS_COMMIT -b $TRAVIS_BRANCH
39 # Output status information.
44 echo -en 'travis_fold:end:before_install.git\\r'
47 ##########################################################################
49 # Mac OS X specific setup.
50 if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
53 echo 'Setting up brew...' && echo -en 'travis_fold:start:before_install.brew\\r'
56 brew tap Homebrew
/bundle
61 echo -en 'travis_fold:end:before_install.brew\\r'
66 ##########################################################################
70 if [ ! -e ~
/.local-bin
/bin
/iverilog
]; then
72 echo 'Building iverilog...' && echo -en 'travis_fold:start:before_install.iverilog\\r'
77 git clone git
://github.com
/steveicarus
/iverilog.git
80 .
/configure
--prefix=$HOME/.local-bin
84 echo -en 'travis_fold:end:before_install.iverilog\\r'
89 ##########################################################################