Skip to content

Commit

Permalink
Retry multiple times when installing package dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pzakha authored Feb 25, 2019
1 parent fe5f599 commit 71754ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
10 changes: 9 additions & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,15 @@ function get_package_config_from_env() {
}

function install_pkgs() {
logmust sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y "$@"
for attempt in {1..3}; do
echo "Running: sudo env DEBIAN_FRONTEND=noninteractive " \
"apt-get install -y $*"
sudo env DEBIAN_FRONTEND=noninteractive apt-get install \
-y "$@" && return
echo "apt-get install failed, retrying."
sleep 10
done
die "apt-get install failed after $attempt attempts"
}

function install_source_package_build_deps() {
Expand Down
16 changes: 7 additions & 9 deletions packages/adoptopenjdk/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,21 @@ DEFAULT_PACKAGE_GIT_URL=none
tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz"

function prepare() {
logmust $TOP/buildpkg.sh make-jpkg
logmust "$TOP/buildpkg.sh" make-jpkg
}

function fetch() {
logmust cd "$WORKDIR/"
logmust cd "$WORKDIR/"

local url="http://artifactory.delphix.com/artifactory"
local url="http://artifactory.delphix.com/artifactory"

wget -nv "$url/java-binaries/linux/jdk/8/$tarfile" -O "$tarfile"
wget -nv "$url/java-binaries/linux/jdk/8/$tarfile" -O "$tarfile"
}

function build() {
logmust cd "$WORKDIR/"
logmust cd "$WORKDIR/"

env DEB_BUILD_OPTIONS=nostrip \
fakeroot make-jpkg "$tarfile" <<<y
env DEB_BUILD_OPTIONS=nostrip fakeroot make-jpkg "$tarfile" <<<y

logmust mv ./*.deb artifacts/
rm -r ./*.tar.gz
logmust mv ./*.deb artifacts/
}

0 comments on commit 71754ce

Please sign in to comment.