Mercurial > hg > anonet-resdb
changeset 391:eb842ad567b4 draft
Merge branch 'master' of git://git1.somerandomnick.ano
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Wed, 02 Feb 2011 19:30:10 +0100 |
parents | 3531789e64ef (diff) 5844e7171eb5 (current diff) |
children | 7d44e2eb3afc |
files | |
diffstat | 4 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/dom/ano/mirz/ns/ns1.mirz.ano Wed Feb 02 19:30:10 2011 +0100 @@ -0,0 +1,1 @@ +1.0.86.1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/dom/ano/mirz/owner Wed Feb 02 19:30:10 2011 +0100 @@ -0,0 +1,1 @@ +mirsal
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/usr/mirsal/git Wed Feb 02 19:30:10 2011 +0100 @@ -0,0 +1,1 @@ +git://1.0.86.1/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/update-git-remotes Wed Feb 02 19:30:10 2011 +0100 @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Creates git remotes from the user db +# TODO: detect users' git address changes +# + +if ! ./scripts/check_db_safety; then + exit 1 +fi + +USR_DB_DIR=./db/usr +GIT_REPO=./.git +GIT_REMOTES_DIR=$GIT_REPO/refs/remotes + +for u in `ls -1 $USR_DB_DIR`; do + git_url_file="$USR_DB_DIR/$u/git" + + if [ -f $git_url_file ]; then + git_url=`cat $git_url_file` + git_remote_name="anonet_$u" + + if [ -d $GIT_REMOTES_DIR/$git_remote_name ]; then + # The remote already exists; + # TODO: Update it if it has changed. + echo "skipping $u" >&2 + + else + git remote add -t master -m master $git_remote_name $git_url + + fi + + fi +done