Use one condition to overwrite the branch

Simplifies the code by removing multiple conditions for the trixie codename
This commit is contained in:
FusionPBX
2026-04-07 18:04:34 +00:00
committed by GitHub
parent 74c0616ab3
commit 066ffe546a

View File

@@ -35,6 +35,12 @@ if [ ."$os_codename" = ."trixie" ]; then
apt install -y python3-distutils-extra plocate
fi
#use master branch for Debian 13 for now
if [ ."$os_codename" = ."trixie" ]; then
switch_version=1.10.13
switch_branch=master
fi
# additional dependencies
apt install -y sqlite3 unzip
@@ -42,7 +48,7 @@ apt install -y sqlite3 unzip
CWD=$(pwd)
#install the following dependencies if the switch version is greater than 1.10.0
if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ] || [ ."$os_codename" = ."trixie" ]; then
if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then
# libks build-requirements
apt install -y cmake uuid-dev
@@ -60,7 +66,7 @@ if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.')
# sofia-sip
cd /usr/src
if [ ."$sofia_version" = ."master" ] || [ ."$os_codename" = ."trixie" ]; then
if [ ."$sofia_version" = ."master" ]; then
git clone https://github.com/freeswitch/sofia-sip.git sofia-sip
cd sofia-sip
else
@@ -77,7 +83,7 @@ if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.')
cd /usr/src
git clone https://github.com/freeswitch/spandsp.git spandsp
cd spandsp
if [ ."$sofia_version" != ."master" ] && [ ."$os_codename" != ."trixie" ] && [ ."$switch_branch" != ."master" ]; then
if [ ."$sofia_version" != ."master" ] && [ ."$switch_branch" != ."master" ]; then
git reset --hard 0d2e6ac65e0e8f53d652665a743015a88bf048d4
fi
#/usr/bin/sed -i 's/AC_PREREQ(\[2\.71\])/AC_PREREQ([2.69])/g' /usr/src/spandsp/configure.ac
@@ -91,7 +97,7 @@ fi
cd /usr/src
#check for master
if [ ."$os_codename" = ."trixie" ] || [ ."$switch_branch" = ."master" ]; then
if [ ."$switch_branch" = ."master" ]; then
#master branch
echo "Using version master"
rm -r /usr/src/freeswitch
@@ -107,7 +113,7 @@ if [ ."$os_codename" = ."trixie" ] || [ ."$switch_branch" = ."master" ]; then
fi
#check for stable release
if [ ."$switch_branch" != ."master" ] && [ ."$os_codename" != ."trixie" ] && [ ."$switch_branch" = ."stable" ]; then
if [ ."$switch_branch" != ."master" ] && [ ."$switch_branch" = ."stable" ]; then
echo "Using version $switch_version"
#1.8 and older
if [ $(echo "$switch_version" | tr -d '.') -lt 1100 ]; then