From 061e9960bbccf8d55a42d1106eaa8088c87a8551 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Oct 2017 15:20:25 +0200 Subject: Use bpkg --fetch-timeout instead of forcing curl --- buildos | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/buildos b/buildos index 0bd47d5..e16d853 100755 --- a/buildos +++ b/buildos @@ -33,17 +33,13 @@ function error () # (5 attempts total). These are similar to bbot timeouts. Note that the # toolchain archives can be quite sizable. # -curl=(curl -f -L -s -S \ - --retry 4 \ - --retry-max-time 600 \ - --max-time 600 \ - --connect-timeout 60) +timeout=600 -bpkg=(bpkg --fetch curl \ - --fetch-option --retry --fetch-option 4 \ - --fetch-option --retry-max-time --fetch-option 600 \ - --fetch-option --max-time --fetch-option 600 \ - --fetch-option --connect-timeout --fetch-option 60) +curl=(curl -f -L -s -S \ + --retry 4 \ + --retry-max-time "$timeout" \ + --max-time "$timeout" \ + --connect-timeout 60) info "starting build os monitor..." @@ -678,7 +674,7 @@ function bbot_check () # l_stat="$(bpkg status libbbot)" b_stat="$(bpkg status bbot)" - if ! "${bpkg[@]}" fetch -q; then + if ! bpkg --fetch-timeout "$timeout" fetch -q; then info "failed to fetch package information" break fi @@ -756,8 +752,9 @@ function bbot_start () # # Build and install the bbot agent. Since other agents might already # be running, limit the number of jobs to our slice. # - if ! "${bpkg[@]}" --build-option --jobs --build-option "$cpu_slice" \ - build --yes libbbot bbot; then + if ! bpkg --fetch-timeout "$timeout" \ + --build-option --jobs --build-option "$cpu_slice" \ + build --yes libbbot bbot; then info "failed to build bbot-agent@$tn" break fi -- cgit v1.1