Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib/shlib.sh
blob: 3d0ff000e5351c18e8dff406618214fad47a8ec2 (plain)
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
# Copyright (C) 2009 One Laptop Per Child
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.

set -e

libdir=$OOB__libdir
bindir=$OOB__bindir
builddir=$OOB__builddir
cachedir=$OOB__cachedir
intermediatesdir=$OOB__intermediatesdir
outputdir=$OOB__outputdir
statedir=$OOB__statedir
fsmount=$OOB__fsmount

read_config() {
	local vname="CFG_$1__$2"
	echo ${!vname}
}

read_buildnr() {
	local buildnr_path=$intermediatesdir/buildnr
	local suffix=$(read_config buildnr_from_file suffix)
	if [[ -e $buildnr_path ]]; then
		echo "$(<$buildnr_path)$suffix"
	else
		echo "0$suffix"
	fi
}