File: prepare.sh

package info (click to toggle)
spring 106.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 55,260 kB
  • sloc: cpp: 543,946; ansic: 44,800; python: 12,575; java: 12,201; awk: 5,889; sh: 1,796; asm: 1,546; xml: 655; perl: 405; php: 211; objc: 194; makefile: 76; sed: 2
file content (55 lines) | stat: -rw-r--r-- 1,480 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
# This file is included by the other shell scripts to set up some variables.
# Each of the scripts (including this) gets 2 arguments: <config> <branch>

# It sets the following variables:
# - CONFIG   : configuration (default, debug, syncdebug, etc.)
# - BRANCH   : branch (master, etc.)
# - CONFIG_  : $CONFIG wrapped in [] or empty if CONFIG=default
# - BRANCH_  : $BRANCH wrapped in {} or empty if BRANCH=master
# - REV      : output of `git describe --tags'
# - SOURCEDIR: absolute path to the source directory
# - BUILDDIR : absolute path to the build directory
# - TMP_BASE : folder for temporary work items
# - TMP_PATH : $TMP_BASE/$CONFIG/$BRANCH/$REV
# - VERSION_ : version string, unsafe, may include special characters
# - VERSION  : sanitized version string, suitable for filenames

# Quit on error.
set -e

if [ ! -n "$1" ] && [ ! -n "$2" ]; then
	echo "Please run with $0 <config> <branch>"
	exit 1
fi


CONFIG=${1:-default}
BRANCH=${2:-develop}
shift 2

REV=$(git describe --abbrev=7 --tags)
SOURCEDIR=${PWD}
BUILDDIR=${PWD}/build/${CONFIG}
TMP_BASE=/tmp/spring
TMP_PATH=${TMP_BASE}/${CONFIG}/${BRANCH}/${REV}/$OUTPUTDIR

if [ x${CONFIG} = xdefault ]; then
   CONFIG_=''
else
   CONFIG_="[${CONFIG}]"
fi

if [ x${BRANCH} = xmaster ]; then
   BRANCH_=''
else
   BRANCH_="{${BRANCH}}"
fi

VERSION_="${CONFIG_}${BRANCH_}${REV}"
VERSION=`echo "${VERSION_}" | tr '<>:\"/\\|?*' -`

if [ -z "${MAKE}" ]; then
	echo "MAKE isn't set, using 'make' as default"
	MAKE=make
fi