]> granicus.if.org Git - graphviz/commitdiff
ci/build.sh: CMake: use OSTYPE to determine if on GNU/Linux
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 4 Sep 2021 13:37:13 +0000 (15:37 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 7 Sep 2021 05:55:36 +0000 (07:55 +0200)
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

index 37eac218c90b2306ee15ea0e0b01232cbcb4dff5..10c693252b16bdbbadbf356d1c17ae8df00a3c97 100755 (executable)
@@ -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 )