aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/templates/binrepo/wrapper.upload-bin
blob: 3def84a02c55070cd4a15684204885f4458f06b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

binrepouser="<%= scope.lookupvar('buildsystem::var::binrepo::login') %>"
uploadbinpath="<%= scope.lookupvar('buildsystem::var::binrepo::uploadbinpath') %>"
packagerscommittersgroup="<%= scope.lookupvar('buildsystem::var::groups::packagers_committers') %>"

function isingroup()
{
  grp="$1"
  for group in `groups`
  do if [ "$grp" = "$group" ]
     then
        return 0
     fi
  done
  return 1
}

if ! isingroup "$packagerscommittersgroup"
then
   echo "You are not in $packagerscommittersgroup group."
   exit 1
fi

sudo -u "$binrepouser" "$uploadbinpath" $(whoami) $@