set -e
usage() {
- echo "usage: dcp-init [-C key=val] [-d REPODIR] PACKAGE [PATCH...]"
+ echo "usage: dcp-init [-sh] [-C key=val] [-d REPODIR] PACKAGE [PATCH...]"
echo " PATCH ::= [-p LEVEL] [-bB BRANCH] FILE"
echo " -b creates a new branch at the current patch"
echo " -B creates a new branch at the upstream sources"
mkdir "$td/apt-tmp"
(cd "$td/apt-tmp"; apt-get source "$1") || false
- echo Achtung
- sleep 10
-
sdir=
for f in "$td/apt-tmp"/*; do
if [ -d "$f" ]; then
}
initrepo() {
- rungit init -q
+ rungit init
mkdir "$td/control"
touch "$td/control/conf"
rungit add control
defdir=/srv/dcp
repodir=
confopts=()
+shared=n
while [ "${1:0:1}" = - ]; do
opt="${1:1}"
elif [ "$opt" = h ]; then
usage
exit 0
+ elif [ "$opt" = s ]; then
+ shared=y
elif [ "$opt" = C ]; then
confopts=("${confopts[@]}" "$1")
shift
done
git clone -q --bare "$td" "$repodir"
+if [ "$shared" = y ]; then
+ chmod -R g+w "$repodir"
+ td="$repodir" rungit config core.sharedrepository 1
+fi
rm -rf "$td"