Skip to content
This repository was archived by the owner on Mar 6, 2022. It is now read-only.

Fix failed parse of images site #160

Merged
merged 1 commit into from
May 10, 2020
Merged
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
4 changes: 2 additions & 2 deletions templates/build_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ get_latest_versions() {
# this is going to continue being quite fragile unless another method for determining latest factory build is found
# parsing html that can change at any time and can have variations every month is never going to be reliable
echo "Searching for latest factory build date for device=${DEVICE} android_version=${ANDROID_VERSION}"
latest_factory_build_date=$(curl --fail -s "${AOSP_URL_BUILD}" | grep -A1 "${DEVICE}" | grep -F "${ANDROID_VERSION}" | tail -1 | cut -d"(" -f2 | cut -d"," -f2 | cut -d")" -f1 | sed -e 's/^[ \t]*//' || true)
latest_factory_build_date=$(curl --cookie "devsite_wall_acks=nexus-image-tos" --fail -s "${AOSP_URL_BUILD}" | grep -A1 "${DEVICE}" | grep -F "${ANDROID_VERSION}" | tail -1 | cut -d"(" -f2 | cut -d"," -f2 | cut -d")" -f1 | sed -e 's/^[ \t]*//' || true)
if [ -z "$latest_factory_build_date" ]; then
aws_notify_simple "ERROR: Unable to determine latest factory build date for device=${DEVICE} android_version=${ANDROID_VERSION}. Stopping build. This lookup is pretty fragile and can break on any page redesign of ${AOSP_URL_BUILD}"
exit 1
fi
echo "latest_factory_build_date='${latest_factory_build_date}'"

# first check to see if any factory builds exist for this date
factory_builds=$(curl --fail -s "${AOSP_URL_BUILD}" | grep -A1 "${DEVICE}" | grep -F "${ANDROID_VERSION}" | grep "${latest_factory_build_date}" || true)
factory_builds=$(curl --cookie "devsite_wall_acks=nexus-image-tos" --fail -s "${AOSP_URL_BUILD}" | grep -A1 "${DEVICE}" | grep -F "${ANDROID_VERSION}" | grep "${latest_factory_build_date}" || true)
factory_builds_count=$(echo "$factory_builds" | wc -l | awk '{print $1}' || true)
if [ -z "$factory_builds" ]; then
factory_builds_count=0
Expand Down