From 14d9c4940dca872fb0db2326e7b78336535d3606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C5=91d=20Ill=C3=A9s?= Date: Thu, 14 Mar 2024 14:56:37 +0100 Subject: [PATCH] [release-tool] Fix branch creation exceptions Patch I55ee87cdb9ee712c334c798a1c2a7ba745e5870e extended the make_branch.sh script to not (re)create stable/* or unmaintained/* branches in case a -eol tag exists. However the bash string manipulation magic doesn't work correctly in the job, which resulted that some stable/* branches were recreated. This fix removes the complex magic and only relies the proved to be functioning string manipulation. Change-Id: I3aecdc03ec720ea756a5ba467cc6073b7b7d7941 --- .../files/release-tools/make_branch.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/copy-release-tools-scripts/files/release-tools/make_branch.sh b/roles/copy-release-tools-scripts/files/release-tools/make_branch.sh index 9802a083d5..fd56e0952b 100755 --- a/roles/copy-release-tools-scripts/files/release-tools/make_branch.sh +++ b/roles/copy-release-tools-scripts/files/release-tools/make_branch.sh @@ -55,10 +55,15 @@ if $(git tag | grep ${NEW_BRANCH/\//-}-eol > /dev/null); then cleanup_and_exit fi -# Skip stable/ or unmaintained/ branch creation in case -# -eol tag exists -if $(git tag | grep ${NEW_BRANCH//@(stable\/|unmaintained\/)}-eol >/dev/null); then - echo "A ${NEW_BRANCH//@(stable\/|unmaintained\/)}-eol tag already exists !" +# Skip stable/ branch creation in case -eol tag exists +if $(git tag | grep ${NEW_BRANCH#stable/}-eol >/dev/null); then + echo "A ${NEW_BRANCH#stable/}-eol tag already exists !" + cleanup_and_exit +fi + +# Skip unmaintained/ branch creation in case -eol tag exists +if $(git tag | grep ${NEW_BRANCH#unmaintained/}-eol >/dev/null); then + echo "A ${NEW_BRANCH#unmaintained/}-eol tag already exists !" cleanup_and_exit fi