File: check-platform.sh

package info (click to toggle)
python-pysam 0.23.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,468 kB
  • sloc: ansic: 158,936; python: 8,604; sh: 338; makefile: 264; perl: 41
file content (32 lines) | stat: -rwxr-xr-x 588 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh -e

case $1 in
    ubuntu-*-arm)  expected=arm ;;
    macos-13)      expected=x86_64 ;;
    ubuntu-*)      expected=x86_64 ;;
    macos-*)       expected=arm ;;
    windows-*)     expected=x86_64 ;;
    *)
	echo Unknown platform $1 >&2
	exit 2
	;;
esac

arch=$(uname -m)
case $arch in
    arm*|aarch*)  actual=arm ;;
    x86*)         actual=x86_64 ;;
    *)
	echo Unrecognized uname result $arch >&2
	exit 2
	;;
esac

if test $actual = $expected
then
    echo Running on $arch as expected
    exit 0
else
    echo Platform $arch is not the expected $expected >&2
    exit 1
fi