File: qb.system.sh

package info (click to toggle)
retroarch 1.7.3%2Bdfsg1-1.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 49,188 kB
  • sloc: ansic: 600,492; cpp: 23,670; objc: 8,299; asm: 6,404; sh: 2,203; xml: 2,144; makefile: 1,867; python: 1,582; java: 941; perl: 393
file content (50 lines) | stat: -rw-r--r-- 1,103 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
exists() # checks executables listed in $@ against the $PATH
{
	v=1
	while [ "$#" -gt 0 ]; do
		arg="$1"
		shift 1
		case "$arg" in ''|*/) continue ;; esac
		x="${arg##*/}"
		z="${arg%/*}"
		[ ! -f "$z/$x" ] || [ ! -x "$z/$x" ] && [ "$z/$x" = "$arg" ] && continue
		[ "$x" = "$z" ] && [ -x "$z/$x" ] && [ ! -f "$arg" ] && z=
		p=":$z:$PATH"
		while [ "$p" != "${p#*:}" ]; do
			p="${p#*:}"
			d="${p%%:*}"
			{ [ -f "$d/$x" ] && [ -x "$d/$x" ] && \
				{ printf %s\\n "$d/$x"; v=0; break; }; } || :
		done
	done
	return "$v"
}

if [ -n "$CROSS_COMPILE" ]; then
	case "$CROSS_COMPILE" in
		*'-mingw32'*) OS='Win32';;
		*'-msdosdjgpp'*) OS='DOS';;
		*);;
	esac
fi

if [ -z "$CROSS_COMPILE" ] || [ -z "$OS" ]; then
	case "$(uname)" in
		'Linux') OS='Linux';;
		*'BSD') OS='BSD';;
		'Darwin') OS='Darwin';;
		'CYGWIN'*) OS='Cygwin';;
		'Haiku') OS='Haiku';;
		'MINGW'*) OS='Win32';;
		'SunOS') OS='SunOS';;
		*) OS="Win32";;
	esac
fi

DISTRO=''
if [ -e /etc/lsb-release ]; then
	. /etc/lsb-release
	DISTRO="(${DISTRIB_DESCRIPTION} ${DISTRIB_RELEASE})"
fi

echo "Checking operating system ... $OS ${DISTRO}"