From 08b0426318656b0d64cd245d15f9cfd27ea623cb Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 6 Mar 2024 09:42:28 +0200 Subject: [PATCH] scripts/open-coredump.sh: calculate MAIN_BRANCH before cloning repo We need MAIN_BRANCH calculated earlier so we can use it to checkout the right branch when cloning the src repo (either `master` or `enterprise`, based on the detected `PRODUCT`) Signed-off-by: Benny Halevy Closes scylladb/scylladb#17647 --- scripts/open-coredump.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/open-coredump.sh b/scripts/open-coredump.sh index 944a06f63b..9e9080aa7a 100755 --- a/scripts/open-coredump.sh +++ b/scripts/open-coredump.sh @@ -270,10 +270,17 @@ else log "Relocatable package ${PACKAGE_URL} already downloaded and extracted" fi +if [[ "${PRODUCT}" == "scylla-enterprise" ]] +then + MAIN_BRANCH=enterprise +else + MAIN_BRANCH=master +fi + COMMIT_HASH=$(cut -f3 -d. <<< $RELEASE) if [ "$(grep -o ~dev <<< $VERSION)" == "~dev" ] then - BRANCH=master + BRANCH=${MAIN_BRANCH} else BASE_VERSION=$(grep -o "^[0-9]\+\.[0-9]\+" <<< $VERSION) BRANCH=branch-${BASE_VERSION} @@ -302,13 +309,6 @@ if ! [[ -f ${COREDIR}/scylla-gdb.py ]] then if [[ "${SCYLLA_GDB_PY_SOURCE}" == "repo" ]] then - if [[ "${PRODUCT}" == "scylla-enterprise" ]] - then - MAIN_BRANCH=enterprise - else - MAIN_BRANCH=master - fi - WORKDIR=$(pwd) cd ${SCYLLA_REPO_PATH} git checkout -q $MAIN_BRANCH