From 42d3cef11bd9a84d11eb48a4ff9686d2e0ce5436 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 18 Jan 2019 20:36:11 +0000 Subject: Sanity check to run the Make with proper group permissions If the `./for-group' script is not used properly, it can lead to the whole pipeline being re-run. Therefore it is important to do a sanity check immediately at the start of Make's processing and inform the user if there is a problem. With this commit, `./for-group' exports the `reproducible_paper_for_group' variable which is used by both the initial `./configure' script, and later in each call to Make. The `./configure' script will use it to write a value in `reproduce/config/pipeline/LOCAL.mk' and Make will use it to compare with the value in `reproduce/config/pipeline/LOCAL.mk'. If there is an inconsistency, Make will not even attempt to build anything and will just print a message and abort. --- for-group | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'for-group') diff --git a/for-group b/for-group index 66eebf4..7484a09 100755 --- a/for-group +++ b/for-group @@ -40,7 +40,7 @@ # Desired group -thisgroup=ourgroup +thisgroup=YOUR-GROUP @@ -65,5 +65,15 @@ else echo "$0: argument must be 'configure' or 'make'" exit 1 fi -echo; echo $script; echo -sg $thisgroup "umask g+w && $script" + + + + + +# Define the group, and set the permission so the user and group both have +# read and write permissions. Then run the respective script. +# +# We are also exporting a special variable so `./configure' and Make can +# prepare for sanity checks and avoid re-doing the whole analysis with a +# typo (not using this script properly after configuration). +sg $thisgroup "umask u+r,u+w,g+r,g+w,o-r,o-w,o-x && export reproducible_paper_for_group=yes && $script" -- cgit v1.2.1