diff options
-rw-r--r-- | db/dom/ano/mirz/ns/ns1.mirz.ano | 1 | ||||
-rw-r--r-- | db/dom/ano/mirz/owner | 1 | ||||
-rw-r--r-- | db/usr/mirsal/git | 1 | ||||
-rw-r--r-- | scripts/update-git-remotes | 33 |
4 files changed, 36 insertions, 0 deletions
diff --git a/db/dom/ano/mirz/ns/ns1.mirz.ano b/db/dom/ano/mirz/ns/ns1.mirz.ano new file mode 100644 index 0000000..7bf5045 --- /dev/null +++ b/db/dom/ano/mirz/ns/ns1.mirz.ano @@ -0,0 +1 @@ +1.0.86.1 diff --git a/db/dom/ano/mirz/owner b/db/dom/ano/mirz/owner new file mode 100644 index 0000000..89c521d --- /dev/null +++ b/db/dom/ano/mirz/owner @@ -0,0 +1 @@ +mirsal diff --git a/db/usr/mirsal/git b/db/usr/mirsal/git new file mode 100644 index 0000000..acfb511 --- /dev/null +++ b/db/usr/mirsal/git @@ -0,0 +1 @@ +git://1.0.86.1/ diff --git a/scripts/update-git-remotes b/scripts/update-git-remotes new file mode 100644 index 0000000..8048d54 --- /dev/null +++ b/scripts/update-git-remotes @@ -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 |