#!/bin/sh # set up some common variables set -e export LANG=C # dirty hack to get this stuff debugable from a bash if [ "x$0" = "x-bash" ] || [ "x$0" = "xbash" ] || [ "x$0" = "xdash" ]; then base_dir="$(pwd)" else base_dir="$(dirname "$(readlink -f "$0")")/.." fi . "${base_dir}/bin/common-functions" work_dir="${base_dir}/work" repo_names='packages community archlinux32' repo_paths__packages="${work_dir}/repos/packages" repo_paths__community="${work_dir}/repos/community" repo_paths__archlinux32="${work_dir}/repos/packages32" master_build_server="buildmaster.archlinux32.org" master_build_server_port="22" master_build_server_user="slave" master_build_server_identity="${work_dir}/.ssh/id_rsa" max_parallel_build_per_client=2 repo_key='0xdeadbeef' package_key='0x15eebadc0de' # to access the master mirror via rsync master_mirror_rsync_command='rsync --password-file=/home/slave/rsync.password' master_mirror_rsync_directory='rsync://buildmaster@mirror.archlinux32.org/packages32' # to access the master mirror via sshfs (needs to be set up in /etc/fstab) master_mirror_sshfs='/mnt/archlinux32' # directory to keep the build log files in build_log_directory='/srv/http/build-logs' # possibly pull in custom modifications [ -r "${base_dir}/conf/local.conf" ] && . "${base_dir}/conf/local.conf" # check / set up environment if [ -z "${build_list_lock_file}" ]; then build_list_lock_file="${work_dir}/build-list.lock" fi if [ -z "${package_database_lock_file}" ]; then package_database_lock_file="${work_dir}/package-database.lock" fi mkdir -p "${work_dir}" touch "${work_dir}/build-list" touch "${work_dir}/deletion-list" mkdir -p "${work_dir}/build-list.loops" for repo in ${repo_names}; do eval repo_path='"${repo_paths__'"${repo}"'}"' mkdir -p "${repo_path%/*}" if [ ! -d "${repo_path}/.git" ]; then if [ "${repo}" = "archlinux32" ]; then repo_source='git@github.com:archlinux32/packages.git' else repo_source="git://git.archlinux.org/svntogit/${repo}.git" fi git clone "${repo_source}" "${repo_path}" fi done if [ "${master_build_server_identity}" = "${work_dir}/.ssh/id_rsa" ] && \ [ ! -f "${master_build_server_identity}" ]; then mkdir -p "${master_build_server_identity%/*}" ssh-keygen -b4096 -f "${master_build_server_identity}" fi