Fix check for global_lock_dir
[buildfarm-client.git] / run_branches
index 7506a52ec5a6b9762b9aad3ed1d4a5cb44934288..429b02e09c9dda5140a71e4ef83cdb03b448934a 100755 (executable)
@@ -159,15 +159,12 @@ elsif ($EximBuild::conf{branches_to_build} =~
 
 @branches = apply_throttle(@branches);
 
-my $global_lock_dir =
-    $EximBuild::conf{global_lock_dir}
-  ||$EximBuild::conf{build_root}
-  ||'';
+my $global_lock_dir = $EximBuild::conf{global_lock_dir}
+  // $EximBuild::conf{build_root}
+  // die "$0: need global_lock_dir\n";
 
-unless ($global_lock_dir && -d $global_lock_dir)
-{
-    die "no global lock directory: $global_lock_dir";
-}
+die "$0: need r/w permissions for directory '$global_lock_dir'\n"
+    if not -d -w $global_lock_dir;
 
 # acquire the lock