From ef7196cec296a5c23659bf545869fb09e8344fd8 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 28 Apr 2020 17:40:25 +0900 Subject: [PATCH] Relax update preciseness (#9758) automerge --- ci/dependabot-updater.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ci/dependabot-updater.sh b/ci/dependabot-updater.sh index 3ee9ee4d3..3da22cb5b 100755 --- a/ci/dependabot-updater.sh +++ b/ci/dependabot-updater.sh @@ -10,14 +10,25 @@ parsed_update_args="$( grep -o 'Bump.*$' | sed -r 's/Bump ([^ ]+) from ([^ ]+) to ([^ ]+)/-p \1:\2 --precise \3/' )" +# relaxed_parsed_update_args is temporal measure... +relaxed_parsed_update_args="$( + git log "$commit_range" --author "dependabot-preview" --oneline -n1 | + grep -o 'Bump.*$' | + sed -r 's/Bump ([^ ]+) from [^ ]+ to ([^ ]+)/-p \1 --precise \2/' +)" package=$(echo "$parsed_update_args" | awk '{print $2}' | grep -o "^[^:]*") if [[ -n $parsed_update_args ]]; then # find other Cargo.lock files and update them, excluding the default Cargo.lock # shellcheck disable=SC2086 for lock in $(git grep --files-with-matches '^name = "'$package'"$' :**/Cargo.lock); do + # it's possible our current versions are out of sync across lock files, + # in that case try to sync them up with $relaxed_parsed_update_args _ scripts/cargo-for-all-lock-files.sh \ "$lock" -- \ - update $parsed_update_args + update $parsed_update_args || + _ scripts/cargo-for-all-lock-files.sh \ + "$lock" -- \ + update $relaxed_parsed_update_args done fi