Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using proper laud countdown before cleaning of repository #3744

Merged
merged 5 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sbin/common/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,13 @@ function isFromJdk21LTS() {
[[ "${BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]}" -ge 21 ]] && [[ $(((BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]-21) % 4)) == 0 ]]
}

# Waits N seconds (10 by default), printing a countdown every second.
function verboseSleep() {
if [[ -z "${1}" ]] ; then
local i=10
else
local i="${1}"
fi
while [ "$i" -gt 0 ] ; do echo -n " $i " && sleep 1s && i=$((i-1)) ; done && echo " $i"
}

7 changes: 5 additions & 2 deletions sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=sbin/common/constants.sh
source "$SCRIPT_DIR/common/constants.sh"

# shellcheck source=sbin/common/common.sh
source "$SCRIPT_DIR/common/common.sh"

# Set default versions for 3 libraries that OpenJDK relies on to build

ALSA_LIB_VERSION=${ALSA_LIB_VERSION:-1.1.6}
Expand Down Expand Up @@ -65,7 +68,7 @@ checkoutAndCloneOpenJDKGitRepo() {
if [ "${isValidGitRepo}" == "0" ]; then
cd "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}" || return
echo "Resetting the git openjdk source repository at $PWD in 10 seconds..."
sleep 10
verboseSleep 10
echo "Pulling latest changes from git openjdk source repository"
elif [ "${BUILD_CONFIG[CLEAN_GIT_REPO]}" == "true" ]; then
echo "Removing current git repo as it is the wrong type"
Expand Down Expand Up @@ -343,7 +346,7 @@ checkingAndDownloadingAlsa() {
break
elif [[ ${i} -lt 10 ]]; then
echo "gpg recv-keys attempt has failed. Retrying after 10 second pause..."
sleep 10s
verboseSleep 10
else
echo "ERROR: gpg recv-keys final attempt has failed. Will not try again."
fi
Expand Down
Loading