aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/templates/maintdb/wrapper.maintdb
diff options
context:
space:
mode:
Diffstat (limited to 'modules/buildsystem/templates/maintdb/wrapper.maintdb')
-rw-r--r--modules/buildsystem/templates/maintdb/wrapper.maintdb26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/buildsystem/templates/maintdb/wrapper.maintdb b/modules/buildsystem/templates/maintdb/wrapper.maintdb
new file mode 100644
index 00000000..8420022d
--- /dev/null
+++ b/modules/buildsystem/templates/maintdb/wrapper.maintdb
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+maintdbuser="<%= login %>"
+maintdbpath="<%= binpath %>"
+packagersgroup="<%= scope.lookupvar('buildsystem::base::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) $@
+