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 <bhalevy@scylladb.com>

Closes scylladb/scylladb#17647
This commit is contained in:
Benny Halevy
2024-03-06 09:42:28 +02:00
committed by Botond Dénes
parent c32a4c8d5c
commit 08b0426318

View File

@@ -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