Merge "Remove retry routines from mixed_build"
This commit is contained in:
@@ -80,32 +80,17 @@ readonly DIST_DIR="$3"
|
|||||||
readonly CHECK_TOOL="$4"
|
readonly CHECK_TOOL="$4"
|
||||||
readonly TEMP_DIR="$(mktemp -d /tmp/"$(basename $0)"_XXXXXXXX)"
|
readonly TEMP_DIR="$(mktemp -d /tmp/"$(basename $0)"_XXXXXXXX)"
|
||||||
|
|
||||||
# Retry command until a certain limit.
|
readonly SYSTEM_TARGET_FILES_ARCHIVE="$(find "$SYSTEM_DIR" -name "*-target_files-*.zip" -print)"
|
||||||
# Usage: retry "command"
|
|
||||||
retry () {
|
|
||||||
NEXT_WAIT_TIME=0
|
|
||||||
until ($1 && [[ -n "$($1)" ]]) || [[ $NEXT_WAIT_TIME -eq 4 ]]; do
|
|
||||||
sleep $(( ++NEXT_WAIT_TIME ))
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
command="find "$SYSTEM_DIR" -name "*-target_files-*.zip" -print"
|
|
||||||
retry "$command"
|
|
||||||
readonly SYSTEM_TARGET_FILES_ARCHIVE="$($command)"
|
|
||||||
if [[ ! -f "$SYSTEM_TARGET_FILES_ARCHIVE" ]]; then
|
if [[ ! -f "$SYSTEM_TARGET_FILES_ARCHIVE" ]]; then
|
||||||
exit_badparam "Could not find system target files archive in $SYSTEM_DIR."
|
exit_badparam "Could not find system target files archive in $SYSTEM_DIR."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
command="find "$DEVICE_DIR" -name "*-img-*.zip" -print"
|
readonly DEVICE_ARCHIVE="$(find "$DEVICE_DIR" -name "*-img-*.zip" -print)"
|
||||||
retry "$command"
|
|
||||||
readonly DEVICE_ARCHIVE="$($command)"
|
|
||||||
if [[ ! -f "$DEVICE_ARCHIVE" ]]; then
|
if [[ ! -f "$DEVICE_ARCHIVE" ]]; then
|
||||||
exit_badparam "Could not find device img archive in $DEVICE_DIR."
|
exit_badparam "Could not find device img archive in $DEVICE_DIR."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
command="find "$DEVICE_DIR" -name "*-target_files-*.zip" -print"
|
readonly DEVICE_TARGET_FILES_ARCHIVE="$(find "$DEVICE_DIR" -name "*-target_files-*.zip" -print)"
|
||||||
retry "$command"
|
|
||||||
readonly DEVICE_TARGET_FILES_ARCHIVE="$($command)"
|
|
||||||
if [[ ! -f "$DEVICE_TARGET_FILES_ARCHIVE" ]]; then
|
if [[ ! -f "$DEVICE_TARGET_FILES_ARCHIVE" ]]; then
|
||||||
exit_badparam "Could not find device target_files archive in $DEVICE_DIR."
|
exit_badparam "Could not find device target_files archive in $DEVICE_DIR."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user