From 7f7406ec7712a8db1df82beefdfcfb174d5d146a Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 10 Aug 2022 23:10:31 +0800 Subject: [PATCH] Build: Detect OS by packager. v5.0.39 --- trunk/auto/depends.sh | 21 ++++++--------------- trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core_version5.hpp | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 77fb916d1..60847c57f 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -33,16 +33,10 @@ echo "Required tools are ok." OS_IS_UBUNTU=NO function Ubuntu_prepare() { - uname -v|grep Ubuntu >/dev/null 2>&1 - ret=$?; if [[ 0 -ne $ret ]]; then - # for debian, we think it's ubuntu also. - # for example, the wheezy/sid which is debian armv7 linux, can not identified by uname -v. - if [[ ! -f /etc/debian_version ]]; then - return 0; - fi - fi - - OS_IS_UBUNTU=YES + # For Debian, we think it's ubuntu also. + # For example, the wheezy/sid which is debian armv7 linux, can not identified by uname -v. + OS_IS_UBUNTU=$(apt-get --version >/dev/null 2>&1 && echo YES) + if [[ $OS_IS_UBUNTU != YES ]]; then return 0; fi echo "Installing tools for Ubuntu." gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then @@ -134,11 +128,8 @@ Ubuntu_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Install tools for ubuntu OS_IS_CENTOS=NO function Centos_prepare() { - if [[ ! -f /etc/redhat-release ]]; then - return 0; - fi - - OS_IS_CENTOS=YES + OS_IS_CENTOS=$(yum --version >/dev/null 2>&1 && echo YES) + if [[ $OS_IS_CENTOS != YES ]]; then return 0; fi echo "Installing tools for Centos." gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 23fa4d089..51ad0b6f2 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -6,6 +6,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2022-08-10, Build: Detect OS by packager. v5.0.39 * v5.0, 2022-08-06, Support MIPS 64bits for loongson 3A4000/3B3000. v5.0.38 * v5.0, 2022-06-29, Support multiple threads by thread pool. v5.0.32 * v5.0, 2022-06-28, ST: Support thread-local for multiple threads. v5.0.31 diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index 67391720b..a7f058dae 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 38 +#define VERSION_REVISION 39 #endif