]> git.proxmox.com Git - rustc.git/blame - src/doc/rustc-guide/ci/build-ignore-timeouts.sh
New upstream version 1.40.0+dfsg1
[rustc.git] / src / doc / rustc-guide / ci / build-ignore-timeouts.sh
CommitLineData
416331ca
XL
1#!/bin/bash -x
2
3output=$(mktemp)
4
e1599b0c
XL
5mkdir -p book/
6cp -r $HOME/linkcheck/ book/
7RUST_LOG=mdbook_linkcheck=debug mdbook-linkcheck -s 2>&1 | tee -a $output
8cp -r book/linkcheck $HOME/
9
10mdbook build
416331ca
XL
11
12result=${PIPESTATUS[0]}
13
14# if passed, great!
15if [ "$result" -eq "0" ] ; then
16 exit 0 ;
17fi
18
19errors=$(cat $output | sed -n 's/There \(was\|were\) \([0-9]\+\).*$/\2/p')
20timeouts=$(cat $output | grep "error while fetching" | wc -l)
21
22# if all errors are timeouts, ignore them...
23if [ "$errors" -eq "$timeouts" ] ; then
24 echo "Ignoring $timeouts timeouts";
25 exit 0;
26else
27 echo "Non-timeout errors found";
28 exit 1;
29fi