aboutsummaryrefslogtreecommitdiff
path: root/afdo_tools
diff options
context:
space:
mode:
authorDenis Nikitin <denik@google.com>2021-05-24 13:47:45 -0700
committerCommit Bot <commit-bot@chromium.org>2021-05-25 01:17:30 +0000
commit011361fa8f4cdaefa23ecbeb2bc0ff3573b2a403 (patch)
tree61e2a189a16236269f1957c080751c9298057818 /afdo_tools
parentffd95a10c126e65c35703258493aed0279a0cdff (diff)
downloadtoolchain-utils-011361fa8f4cdaefa23ecbeb2bc0ff3573b2a403.tar.gz
update_kernel_afdo: Check last week profiles
The script handles Monday differently which make it failing when profiles are not uploaded yet. Instead we need to check profiles updated within the last week so we can safely run the script any day given that profiles are updated weekly. BUG=None TEST=./afdo_tools/update_kernel_afdo Change-Id: I15489e8462c0fbceb9a73c3e3bec3027e26b18d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2915677 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Denis Nikitin <denik@chromium.org> Tested-by: Denis Nikitin <denik@chromium.org>
Diffstat (limited to 'afdo_tools')
-rwxr-xr-xafdo_tools/update_kernel_afdo9
1 files changed, 2 insertions, 7 deletions
diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo
index aa14b44a..4b41053f 100755
--- a/afdo_tools/update_kernel_afdo
+++ b/afdo_tools/update_kernel_afdo
@@ -36,13 +36,8 @@ outfile="$(realpath --relative-to="${tc_utils_dir}" \
# Convert toolchain_utils into the absolute path.
abs_tc_utils_dir="$(realpath ${tc_utils_dir})"
-# The most recent Monday, in Unix timestamp format.
-if [ $(date +%a) = "Mon" ]
-then
- expected_time=$(date +%s -d 00:00:00)
-else
- expected_time=$(date +%s -d "last Monday")
-fi
+# Check profiles uploaded within the last week.
+expected_time=$(date +%s -d "week ago")
declare -A branch branch_number commit
remote_repo=$(git -C "${tc_utils_dir}" remote)