From 85eb743f466651910abeee8db28b2945cd962998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 23 Nov 2021 11:39:57 +0100 Subject: [PATCH] tools: Make hub usage slightly less fragile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `grep`ing by a specific output, in a specific language, is quite fragile and could easily break `hub`. For now, let's work this around following James' suggestion of setting `LC_ALL=C LANG=C` when calling `hub`. > **Note**: I don't think we should invest much time on fixing `hub` > usage, as it'll be soon replaced by `gh`, see: > https://github.com/kata-containers/kata-containers/issues/3083 Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/release/update-repository-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index 624cac8d3c..5a01b18400 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -255,7 +255,7 @@ EOT ${hub_bin} push fork -f "${branch}" info "Create PR" out="" - out=$("${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" + out=$(LC_ALL=C LANG=C "${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" fi if [ "${repo}" == "kata-containers" ] && [ "${target_branch}" == "main" ] && [[ "${new_version}" =~ "rc" ]]; then @@ -276,7 +276,7 @@ EOT ${hub_bin} push fork -f "${reverting_kata_deploy_changes_branch}" info "Create \"${reverting_kata_deploy_changes_branch}\" PR" out="" - out=$("${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" + out=$(LC_ALL=C LANG=C "${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" fi fi