2010-04-18 13:11:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# 2008 Nico Schottelius (nico-nsbin at schottelius.org)
|
|
|
|
#
|
|
|
|
# This file is part of nsbin.
|
|
|
|
#
|
|
|
|
# nsbin 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.
|
|
|
|
#
|
|
|
|
# nsbin 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.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with nsbin. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
#
|
2010-04-18 13:19:46 +00:00
|
|
|
# Usage: $0 repo desc pseudo-owner
|
2010-04-18 13:11:45 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
basedir=/home/services/sans/git
|
|
|
|
group=sans
|
|
|
|
|
|
|
|
repo="$1"; shift
|
2010-04-18 13:19:46 +00:00
|
|
|
desc="$1"; shift
|
2010-04-18 13:11:45 +00:00
|
|
|
powner="$1"; shift
|
|
|
|
|
|
|
|
export GIT_DIR="${basedir}/${repo}"
|
|
|
|
|
|
|
|
git init
|
2010-04-18 13:15:28 +00:00
|
|
|
|
|
|
|
# allow display via gitweb
|
2010-04-18 13:11:45 +00:00
|
|
|
touch "${GIT_DIR}/git-daemon-export-ok"
|
2010-04-18 13:19:46 +00:00
|
|
|
|
|
|
|
# add description
|
|
|
|
echo "${desc}" > "${GIT_DIR}/description"
|
|
|
|
|
|
|
|
# make sure group rights are kept
|
2010-04-18 13:11:45 +00:00
|
|
|
cat << eof > "${GIT_DIR}/config"
|
|
|
|
[core]
|
|
|
|
filemode = true
|
|
|
|
bare = true
|
|
|
|
sharedRepository = group
|
|
|
|
[gitweb]
|
2010-04-18 13:15:28 +00:00
|
|
|
owner = "${powner:-"sans"}"
|
2010-04-18 13:11:45 +00:00
|
|
|
eof
|
|
|
|
|
|
|
|
chgrp sans -R "${GIT_DIR}"
|
2010-04-18 13:15:28 +00:00
|
|
|
chmod g+rw -R "${GIT_DIR}"
|