File tree Expand file tree Collapse file tree
devops/build/packaging/deb Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export CBDB_FULL_VERSION=$VERSION
109109
110110# Set version if not provided
111111if [ -z " ${VERSION} " ]; then
112- export CBDB_FULL_VERSION=$( ./getversion | cut -d' -' -f 1 | cut -d' +' -f 1)
112+ export CBDB_FULL_VERSION=$( ./getversion 2> /dev/null | cut -d' -' -f 1 | cut -d' +' -f 1 || echo " unknown " )
113113fi
114114
115115if [[ ! $CBDB_FULL_VERSION =~ ^[0-9] ]]; then
127127# Detect OS distribution (e.g., ubuntu22.04, debian12)
128128if [ -z ${OS_DISTRO+x} ]; then
129129 if [ -f /etc/os-release ]; then
130+ # Temporarily disable unbound variable check for sourcing os-release
131+ set +u
130132 . /etc/os-release
131- OS_DISTRO=$( echo " ${ID}${VERSION_ID} " | tr ' [:upper:]' ' [:lower:]' )
133+ set -u
134+ # Ensure ID and VERSION_ID are set before using them
135+ OS_DISTRO=$( echo " ${ID:- unknown}${VERSION_ID:- } " | tr ' [:upper:]' ' [:lower:]' )
132136 else
133137 OS_DISTRO=" unknown"
134138 fi
135139fi
136140
141+ # Ensure OS_DISTRO is exported and not empty
142+ export OS_DISTRO=${OS_DISTRO:- unknown}
143+
137144export CBDB_PKG_VERSION=${CBDB_FULL_VERSION} -${BUILD_NUMBER} -${OS_DISTRO}
138145
139146# Check if required commands are available
You can’t perform that action at this time.
0 commit comments