File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,13 +46,18 @@ set_dependencies() {
4646 while read package version; do
4747 (
4848 local install_path=" ${GOPATH%%:* } /src/${package%%/ ...} "
49- is_in_use $install_path && wait
50-
5149 echo " >> Getting package " $package " "
52- while true ; do go get -u -d " $package " 2> /dev/null && break ; done
50+
51+ # Retries in case of possible race conditions when installing a package
52+ # dependency
53+ for (( i= 0 ; i< 5 ; i++ )) ; do
54+ out=$( go get -u -d " $package " 2>&1 > /dev/null) && break
55+ done
56+ [[ $? != 0 ]] && echo " -- Failed to get " $package " , error: " && echo " $out " && exit 1
5357
5458 echo " >> Setting $package to version $version "
5559 cd $install_path
60+ is_in_use $install_path && wait
5661
5762 [ -d .hg ] && hg update -q " $version "
5863 [ -d .git ] && git checkout -q " $version "
You can’t perform that action at this time.
0 commit comments