diff options
Diffstat (limited to '.github/os_detect.sh')
-rw-r--r-- | .github/os_detect.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.github/os_detect.sh b/.github/os_detect.sh index ee9c145d..3c5956de 100644 --- a/.github/os_detect.sh +++ b/.github/os_detect.sh | |||
@@ -1,10 +1,17 @@ | |||
1 | #!/bin/sh -e | 1 | #!/bin/sh -e |
2 | |||
3 | . /etc/os-release | ||
4 | |||
2 | # workaround for really bare-bones Archlinux containers: | 5 | # workaround for really bare-bones Archlinux containers: |
3 | if [ -x "$(command -v pacman)" ]; then | 6 | if [ -x "$(command -v pacman)" ]; then |
4 | pacman --noconfirm -Sy | 7 | pacman --noconfirm -Sy |
5 | pacman --noconfirm -S grep gawk sed | 8 | pacman --noconfirm -S grep gawk sed |
6 | fi | 9 | fi |
7 | 10 | ||
11 | if [ ${ID} == "fedora" -a ${VERSION_ID} -gt 41 ]; then | ||
12 | dnf install -y gawk | ||
13 | fi | ||
14 | |||
8 | os_release_file= | 15 | os_release_file= |
9 | if [ -s "/etc/os-release" ]; then | 16 | if [ -s "/etc/os-release" ]; then |
10 | os_release_file="/etc/os-release" | 17 | os_release_file="/etc/os-release" |
@@ -15,4 +22,7 @@ else | |||
15 | return 1 | 22 | return 1 |
16 | fi | 23 | fi |
17 | export distro_id=$(grep '^ID=' $os_release_file|awk -F = '{print $2}'|sed 's/\"//g') | 24 | export distro_id=$(grep '^ID=' $os_release_file|awk -F = '{print $2}'|sed 's/\"//g') |
25 | export version_id=$(grep '^VERSION_ID=' $os_release_file|awk -F = '{print $2}'|sed 's/\"//g') | ||
18 | export platform_id=$(grep '^PLATFORM_ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g'| cut -d":" -f2) | 26 | export platform_id=$(grep '^PLATFORM_ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g'| cut -d":" -f2) |
27 | # Fedora dropped PLATFORM_ID: https://fedoraproject.org/wiki/Changes/Drop_PLATFORM_ID?#Drop_PLATFORM_ID | ||
28 | if [ -z $platform_id ]; then export platform_id=$(echo ${distro_id:0:1}${version_id}); fi | ||