From af869dc693057dcaf707924b56fcdb9f7cde3605 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sat, 4 Sep 2021 15:37:13 +0200 Subject: [PATCH] ci/build.sh: CMake: use OSTYPE to determine if on GNU/Linux OSTYPE is a built-in variable in bash and exists on all operating systems. As a second discriminator, use ID_LIKE to determine if on a Debian like OS, e.g. Ubuntu. --- ci/build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index 37eac218c..10c693252 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -31,15 +31,17 @@ if [ "${build_system}" = "cmake" ]; then cmake --build . cpack cd .. - if [ "${ID_LIKE}" = "debian" ]; then - mv build/*.deb ${DIR}/os/${ARCH}/ + if [ "${OSTYPE}" = "linux-gnu" ]; then + if [ "${ID_LIKE:-}" = "debian" ]; then + mv build/*.deb ${DIR}/os/${ARCH}/ + else + mv build/*.rpm ${DIR}/os/${ARCH}/ + fi elif [[ "${OSTYPE}" =~ "darwin" ]]; then mv build/*.zip ${DIR}/os/${ARCH}/ elif [ "${OSTYPE}" = "msys" ]; then mv build/*.zip ${DIR}/os/${ARCH}/ mv build/*.exe ${DIR}/os/${ARCH}/ - else - mv build/*.rpm ${DIR}/os/${ARCH}/ fi else GV_VERSION=$( cat VERSION ) -- 2.40.0