From 6dd16b871a04fe29d1805b110371b0a229876159 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Thu, 10 Jan 2019 11:59:37 +0000 Subject: Wrapper script to allow groups working in the build directory On large projects, its often necessary to share the build directory between the various users of the pipeline. To simplify the process a `for-group' script is now added to the pipeline which is just a wrapper over the `./configure' and `.local/bin/make' commands to make sure that the group owner of the outputs and the permission flags are set properly. --- for-group | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 for-group (limited to 'for-group') diff --git a/for-group b/for-group new file mode 100755 index 0000000..653c8d9 --- /dev/null +++ b/for-group @@ -0,0 +1,69 @@ +#! /bin/sh +# +# Running examples: +# +# $ ./for-group configure +# $ ./for-group make [-jN] +# +# This is a wrapper for the configure and Make steps designed for a group +# of users (sharing the same group name) using this pipeline on the same +# build directory. +# +# When the configuration (normally done with `./configure') and build +# (normally done with `.local/bin/make') steps are done with this with this +# script, all the files that are created within the pipeline have these +# properties: +# +# 1) Group owner will be a special group (value of `thisgroup' below). +# 2) The permission flags give write access to the group members. +# +# Original author: +# Mohammad Akhlaghi +# Contributing author(s): +# Copyright (C) 2019, Mohammad Akhlaghi. +# +# This script is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# A copy of the GNU General Public License is available at +# . + + + + + +# Desired group +thisgroup=ourgroup + + + + + +# Script settings +# --------------- +# Stop the script if there are any errors. +set -e + + + + + +# Set and run the respective command. +if [ "x$1" = x ]; then + echo "$0: an argument is necessary ('configure' or 'make')" + exit 1 +elif [ "x$1" = xconfigure ]; then script="./configure" +elif [ "x$1" = xmake ]; then script=".local/bin/make $2" +else + echo "$0: argument must be 'configure' or 'make'" + exit 1 +fi +echo; echo $script; echo +sg $thisgroup "umask g+w && $script" -- cgit v1.2.1