From 6dffa7c3c6dc71b70dac9a2bd24faf6825fbe63f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 26 Jun 2018 11:49:55 +0200 Subject: lib/load-configuration,lib/mysql-functions: make runable outside of build-master in build-master mode --- lib/load-configuration | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lib/load-configuration') diff --git a/lib/load-configuration b/lib/load-configuration index c89e757..fb9a2a2 100755 --- a/lib/load-configuration +++ b/lib/load-configuration @@ -19,19 +19,23 @@ work_dir="${base_dir}/work" # shellcheck source=../lib/common-functions . "${base_dir}/lib/common-functions" +if [ "$(hostname)" = 'buildmaster.archlinux32.org' ]; then + i_am_the_master=true +else + i_am_the_master=false +fi + # if mysqld is not running, we're either on a build slave and don't need # lib/mysql-functions or we're on the build master and something is wrong # anyway if pgrep -x mysqld >/dev/null 2>&1; then # shellcheck source=../lib/mysql-functions . "${base_dir}/lib/mysql-functions" + # load static values from the database + mysql_retrieve_static_information fi -if [ "$(hostname)" = 'buildmaster.archlinux32.org' ]; then - i_am_the_master=true -else - i_am_the_master=false - +if ! ${i_am_the_master}; then repo_names='packages community archlinux32' repo_paths__packages="${work_dir}/repos/packages" repo_paths__community="${work_dir}/repos/community" @@ -107,11 +111,6 @@ if ! ${i_am_the_master} && \ . "${base_dir}/conf/slave.conf" fi -# load static values from the database -if pgrep -x mysqld >/dev/null 2>&1; then - mysql_retrieve_static_information -fi - # check / set up environment if [ -z "${build_list_lock_file}" ]; then -- cgit v1.2.3-70-g09d2