aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-07-28 14:41:55 +0000
committerNicolas Vigier <boklm@mageia.org>2011-07-28 14:41:55 +0000
commit64742c294a6f9dfa00d57f7b3b0b5d967774bb89 (patch)
treec5579ae81541272f1b98d10a5792b51286ea139a /modules
parentb622c3394ad981d3dcc5f151dde8214c5649834b (diff)
downloadpuppet-64742c294a6f9dfa00d57f7b3b0b5d967774bb89.tar
puppet-64742c294a6f9dfa00d57f7b3b0b5d967774bb89.tar.gz
puppet-64742c294a6f9dfa00d57f7b3b0b5d967774bb89.tar.bz2
puppet-64742c294a6f9dfa00d57f7b3b0b5d967774bb89.tar.xz
puppet-64742c294a6f9dfa00d57f7b3b0b5d967774bb89.zip
improve error message when user is not in mga-packagers group
Diffstat (limited to 'modules')
-rw-r--r--modules/buildsystem/templates/wrapper.maintdb19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/buildsystem/templates/wrapper.maintdb b/modules/buildsystem/templates/wrapper.maintdb
index a27994ff..2f6e2324 100644
--- a/modules/buildsystem/templates/wrapper.maintdb
+++ b/modules/buildsystem/templates/wrapper.maintdb
@@ -2,6 +2,25 @@
maintdbuser="<%= maintdb_login %>"
maintdbpath="<%= maintdb_binpath %>"
+packagersgroup="<%= packagers_group %>"
+
+function isingroup()
+{
+ grp="$1"
+ for group in `groups`
+ do if [ "$grp" = "$group" ]
+ then
+ return 0
+ fi
+ done
+ return 1
+}
+
+if ! isingroup "$packagersgroup"
+then
+ echo "You are not in $packagersgroup group."
+ exit 1
+fi
sudo -u "$maintdbuser" "$maintdbpath" $(whoami) $@