[sysadmin-bin: 55/168] Add a finish-import script



commit a1e90d76f33b17e87de9a801d604cabb2d82bace
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Mar 19 18:19:25 2009 -0400

    Add a finish-import script
    
    Add a script to clear the pending flag and mark a newly imported
    repository as ready for use.

 finish-import |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/finish-import b/finish-import
new file mode 100755
index 0000000..c23110a
--- /dev/null
+++ b/finish-import
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Script to clear the "pending" flag on a newly imported module
+
+BINDIR=/home/admin/gitadmin-bin
+
+. $BINDIR/functions
+
+validate_repository_name "$1"
+name="$1"
+
+export GIT_DIR=/git/$name.git
+
+if ! [ -e $GIT_DIR/pending ] ; then
+    echo 1>&2 "'$name' is not a Git repository that is currently being imported"
+    exit 1
+fi
+
+echo "Clearing pending flag on $GIT_DIR"
+rm $GIT_DIR/pending
+
+sudo -u gitadmin $BINDIR/update-cgit
+
+echo "$name is now ready for use"



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