File: platform_flags.sh

package info (click to toggle)
performous 1.3.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 13,932 kB
  • sloc: cpp: 35,814; sh: 925; python: 626; xml: 480; makefile: 37
file content (26 lines) | stat: -rwxr-xr-x 893 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
#!/bin/bash

if [[ ! -f /root/performous/platform_flags.sh ]]; then
	mkdir -p /root/performous
	cp -v ./platform_flags.sh /root/performous/
fi

function export_platform_flags () {
	if [[ $# > 1 ]]; then
		echo "WARNING: export_platform_flags takes only 1 argument, the rest are ignored." 
	elif [[ $# < 1 ]]; then
		echo "ERROR: export_platform_flags needs an argument."
		exit 1
	fi
		echo "export PLATFORM_CMAKE_FLAGS='"${1}"'" | tee -a /root/performous/PLATFORM_CMAKE_FLAGS
}

function import_platform_flags () {
	if [ $# -gt 0 ]; then
		echo "WARNING: import_platform_flags does not take arguments, we'll just ignore them." 
	elif [ ! -d /root/performous ]; then
		echo "ERROR: /root/performous doesn't exist, so there can't be any flags to import. Use `export_platform_flags` first."
		exit 1
	fi
	test -f /root/performous/PLATFORM_CMAKE_FLAGS && . /root/performous/PLATFORM_CMAKE_FLAGS
}