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)"
34 if [ x
"$(git show-ref -s HEAD)" = x
"$TRAVIS_COMMIT" ]; then
35 echo "Checked out at $TRAVIS_COMMIT"
37 if [ z
"$TRAVIS_PULL_REQUEST_SLUG" != z
]; then
38 git fetch
source $TRAVIS_COMMIT ||
echo "Unable to fetch $TRAVIS_COMMIT from source"
40 git fetch origin
$TRAVIS_COMMIT ||
echo "Unable to fetch $TRAVIS_COMMIT from origin"
42 git branch
-D $TRAVIS_BRANCH || true
43 git checkout
$TRAVIS_COMMIT -b $TRAVIS_BRANCH
47 # Output status information.
52 echo -en 'travis_fold:end:before_install.git\\r'
55 ##########################################################################
57 # Mac OS X specific setup.
58 if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
61 echo 'Setting up brew...' && echo -en 'travis_fold:start:before_install.brew\\r'
64 brew tap Homebrew
/bundle
68 echo -en 'travis_fold:end:before_install.brew\\r'
73 ##########################################################################
77 if [ ! -e ~
/.local-bin
/bin
/iverilog
]; then
79 echo 'Building iverilog...' && echo -en 'travis_fold:start:before_install.iverilog\\r'
84 git clone git
://github.com
/steveicarus
/iverilog.git
87 .
/configure
--prefix=$HOME/.local-bin
91 echo -en 'travis_fold:end:before_install.iverilog\\r'
96 ##########################################################################