diff options
Diffstat (limited to 'tools/run-centos')
-rwxr-xr-x | tools/run-centos | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/run-centos b/tools/run-centos index e87b2025..d58ef3e8 100755 --- a/tools/run-centos +++ b/tools/run-centos @@ -123,7 +123,22 @@ prep() { return 0 fi error "Installing prep packages: ${needed}" - yum install --assumeyes ${needed} + set -- $needed + local n max r + n=0; max=10; + bcmd="yum install --downloadonly --assumeyes --setopt=keepcache=1" + while n=$(($n+1)); do + error ":: running $bcmd $* [$n/$max]" + $bcmd "$@" + r=$? + [ $r -eq 0 ] && break + [ $n -ge $max ] && { error "gave up on $bcmd"; exit $r; } + nap=$(($n*5)) + error ":: failed [$r] ($n/$max). sleeping $nap." + sleep $nap + done + error ":: running yum install --cacheonly --assumeyes $*" + yum install --cacheonly --assumeyes "$@" } start_container() { |