commit 5ebf52eb0a3911fdadde204845f60629d40fa411 (HEAD)
Author: Scott Moser <smoser@brickies.net>
Date: Mon Oct 23 14:02:39 2017 -0400
my-reliable-test
diff --git a/tools/read-dependencies b/tools/read-dependencies
index 2a648680..db944be3 100755
--- a/tools/read-dependencies
+++ b/tools/read-dependencies
@@ -30,9 +30,21 @@ DISTRO_PKG_TYPE_MAP = {
'suse': 'suse'
}
+MAYBE_RELIABLE_YUM_INSTALL = [
+ 'sh', '-c',
+ 'n=0; max=10;
+ while n=$(($n+1)) && ! yum makecache; do
+ r=$?
+ [ $n -ge $max ] && { echo "Gave up after $n tries [$r]"; exit 1; }
+ nap=$(($n*5))
+ echo "yum makecache try $n/$max failed [$r]. sleeping $nap"
+ sleep $nap
+ done
+ yum install --cacheonly --assumeyes "$@"', 'reliable-yum-install']
+
DISTRO_INSTALL_PKG_CMD = {
- 'centos': ['yum', 'install', '--assumeyes'],
- 'redhat': ['yum', 'install', '--assumeyes'],
+ 'centos': MAYBE_RELIABLE_YUM_INSTALL,
+ 'redhat': MAYBE_RELIABLE_YUM_INSTALL,
'debian': ['apt', 'install', '-y'],
'ubuntu': ['apt', 'install', '-y'],
'opensuse': ['zypper', 'install'],