diff --git a/images/linux/scripts/base/apt-mock.sh b/images/linux/scripts/base/apt-mock.sh index 03936bd0..d46a1878 100644 --- a/images/linux/scripts/base/apt-mock.sh +++ b/images/linux/scripts/base/apt-mock.sh @@ -13,11 +13,10 @@ i=1 while [ \$i -le 30 ];do err=\$(mktemp) $real_tool "\$@" 2>\$err - result=\$? - cat \$err >&2 - # no errors, continue - test \$result -eq 0 && break + # no errors, break the loop and continue normal flow + test -f \$err || break + cat \$err >&2 retry=false @@ -30,6 +29,9 @@ while [ \$i -le 30 ];do elif grep -q 'IPC connect call failed' \$err;then # the delay should help with gpg-agent not ready retry=true + elif grep -q 'Temporary failure in name resolution' \$err;then + # It looks like DNS is not updated with random generated hostname yet + retry=true fi rm \$err