From 0c01f2946ed21f5e7977b5503f9c9f00e72fd708 Mon Sep 17 00:00:00 2001 From: waja Date: Fri, 23 Feb 2024 14:25:44 +0100 Subject: CI specfile (#1894) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding spec file and github pipeline for testing * Restructure github pipelines for more clarity * Add build tests for several RPM based distributions --------- Co-authored-by: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> --- .github/os_detect.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/os_detect.sh (limited to '.github/os_detect.sh') diff --git a/.github/os_detect.sh b/.github/os_detect.sh new file mode 100644 index 00000000..ee9c145d --- /dev/null +++ b/.github/os_detect.sh @@ -0,0 +1,18 @@ +#!/bin/sh -e +# workaround for really bare-bones Archlinux containers: +if [ -x "$(command -v pacman)" ]; then + pacman --noconfirm -Sy + pacman --noconfirm -S grep gawk sed +fi + +os_release_file= +if [ -s "/etc/os-release" ]; then + os_release_file="/etc/os-release" +elif [ -s "/usr/lib/os-release" ]; then + os_release_file="/usr/lib/os-release" +else + echo >&2 "Cannot find an os-release file ..." + return 1 +fi +export distro_id=$(grep '^ID=' $os_release_file|awk -F = '{print $2}'|sed 's/\"//g') +export platform_id=$(grep '^PLATFORM_ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g'| cut -d":" -f2) -- cgit v1.2.3-74-g34f1