65 lines
1.6 KiB
Bash
65 lines
1.6 KiB
Bash
#! /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=https://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
|
|
}
|