Commit 2124611f authored by Markus Frosch's avatar Markus Frosch
Browse files

rpm: Retry network actions

To avoid issues with mirrors of distributions
parent 1c26dfe5
......@@ -18,20 +18,20 @@ case "$ICINGA_BUILD_OS" in
(
set -ex
# Note: force rebuilding here, because zypper is a bit dumb
sudo zypper --non-interactive clean --all
sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys ref -fs
run-retry-timeout sudo zypper --non-interactive clean --all
run-retry-timeout sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys ref -fs
)
;;
*)
(
if command -v dnf &>/dev/null; then
set -ex
sudo dnf clean expire-cache
sudo dnf makecache
run-retry-timeout sudo dnf clean expire-cache
run-retry-timeout sudo dnf makecache
else
set -ex
sudo yum clean expire-cache
sudo yum makecache fast
run-retry-timeout sudo yum clean expire-cache
run-retry-timeout sudo yum makecache fast
fi
)
;;
......@@ -43,17 +43,17 @@ case "$ICINGA_BUILD_OS" in
(
set -ex
# shellcheck disable=SC2046
sudo zypper --non-interactive install $(rpm -qpR "${source_rpm}")
run-retry-timeout sudo zypper --non-interactive install $(rpm -qpR "${source_rpm}")
)
;;
*)
(
if command -v dnf-builddep >/dev/null; then
set -ex
sudo dnf-builddep -y "${source_rpm}"
run-retry-timeout sudo dnf-builddep -y "${source_rpm}"
else
set -ex
sudo yum-builddep -y "${source_rpm}"
run-retry-timeout sudo yum-builddep -y "${source_rpm}"
fi
)
;;
......
......@@ -26,7 +26,7 @@ REPO
(
set -ex
#sudo zypper --non-interactive clean --all
sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys ref -fs
run-retry-timeout sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys ref -fs
# Just use the local dir, zypper will take care of the rest!
if ! sudo zypper lr | grep -q "$repository"; then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment