[sysadmin-bin: 47/168] Allow specifying repositories for gnomify-repos



commit 695f8ad6944a6fa40f89faff7950d8f2aa20403e
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Tue Mar 17 14:50:32 2009 -0400

    Allow specifying repositories for gnomify-repos
    
    When argument are passed to gnomify-repos, gnomify just the
    named directories.

 gnomify-repos |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/gnomify-repos b/gnomify-repos
index e5ccaeb..0e69ebe 100755
--- a/gnomify-repos
+++ b/gnomify-repos
@@ -13,11 +13,22 @@ gnomify_repo() {
     ln -sf /home/admin/gitadmin-bin/gnome-post-receive $GIT_DIR/hooks/post-receive
 }
 
-# We only enforce the above parameters for the standard repositories; the
-# ones owned by 'gnomecvs'. There are also some unusual repositories owned
-# by other groups that have different policies.
-for r in $(find /git -maxdepth 1 -group gnomecvs -print); do
-    if [ -d $r/objects ] ; then
-       gnomify_repo $r
-    fi
-done
+if [ $# '>' 0 ] ; then
+    for r in $@ ; do
+	if [ -d $r/objects ] ; then
+	    gnomify_repo $r
+	else
+	    echo "$r is not a Git repository" 2>&1
+	    exit 1
+	fi
+    done
+else
+    # We only enforce the above parameters for the standard repositories; the
+    # ones owned by 'gnomecvs'. There are also some unusual repositories owned
+    # by other groups that have different policies.
+    for r in $(find /git -maxdepth 1 -group gnomecvs -print); do
+	if [ -d $r/objects ] ; then
+	    gnomify_repo $r
+	fi
+    done
+fi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]