forked from crawl/dgamelaunch-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrawl-git.conf
64 lines (48 loc) · 1.55 KB
/
crawl-git.conf
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
56
57
58
59
60
61
62
63
64
#! /bin/bash
[[ -z "$BRANCH" ]] && BRANCH="master"
CONFIG_READ="true"
export GAME="crawl-git"
CRAWL_BUILD_DIR=$DGL_CONF_HOME/crawl-build
CRAWL_REPOSITORY_DIR=crawl-git-repository
CRAWL_REPO=$DGL_CONF_HOME/crawl-build/$CRAWL_REPOSITORY_DIR
CRAWL_GIT_URL=git://github.com/crawl/crawl.git
export CHROOT_CRAWL_BINARY_PATH="/usr/games"
export CRAWL_BINARY_PATH="$DGL_CHROOT$CHROOT_CRAWL_BINARY_PATH"
export CHROOT_CRAWL_STABLE_GAMEDIR=/var/games
# Path in chroot where the build's data and savedir will be created:
export CHROOT_CRAWL_BASEDIR=/crawl-master
export CHROOT_CRAWL_GAMEDIR=$CHROOT_CRAWL_BASEDIR/$GAME
# Build config:
export CRAWL_UGRP=crawl:crawl
export CRAWL_BASEDIR=$DGL_CHROOT$CHROOT_CRAWL_BASEDIR
export CRAWL_GAMEDIR=$DGL_CHROOT$CHROOT_CRAWL_GAMEDIR
export CHROOT_VERSIONS_DB="/crawl-versions.db3"
export VERSIONS_DB="$DGL_CHROOT$CHROOT_VERSIONS_DB"
check-versions-db-exists() {
if [[ ! -f "$VERSIONS_DB" ]]; then
echo -e "Crawl version db $VERSIONS_DB does not exist"
echo -e "Please run 'dgl create-versions-db' as root to create it."
exit 1
fi
}
check-crawl-basedir-exists() {
if [[ ! -d "$CRAWL_GAMEDIR" ]]; then
echo -e "Chroot crawl game directory $CRAWL_GAMEDIR does not exist."
echo -e "Please run 'dgl create-crawl-gamedir' to create it."
exit 1
fi
}
crawl-repo-do() {
( cd $CRAWL_REPO && "$@" )
}
crawl-do() {
( cd $CRAWL_REPO/crawl-ref && "$@" )
}
git-do() {
crawl-repo-do git "$@"
}
latest-game-hash() {
query <<EOF
SELECT hash FROM versions ORDER BY time DESC LIMIT 1;
EOF
}