From fdb0d1b3ee103ab87fbe15c492402fb4f23846ce Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 Jan 2018 10:59:24 +0100 Subject: bin/bootstrap-mysql: lock everything --- bin/bootstrap-mysql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bin') diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index fcb2f7e..b67be6f 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -6,6 +6,22 @@ tmp_dir=$(mktemp -d 'tmp.bootstrap-mysql.XXXXXXXXXX' --tmpdir) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT +exec 9> "${build_list_lock_file}" +if ! flock -n 9; then + >&2 echo 'Cannot get build-list lock.' + exit 1 +fi +exec 8> "${sanity_check_lock_file}" +if ! flock -s -n 9; then + >&2 echo 'Cannot get sanity-check lock.' + exit 1 +fi +exec 7> "${package_database_lock_file}" +if ! flock -s -n 7; then + >&2 echo 'Cannot get package-database lock.' + exit 1 +fi + for dir in $(ls_master_mirror 'i686'); do ls_master_mirror "i686/${dir}" | \ sed ' -- cgit v1.2.3-70-g09d2