[projects/git-slug: 72/170] ADC to remove a repository

glen glen at pld-linux.org
Mon Sep 21 21:44:52 CEST 2015


commit 1ebff88317162c2e6998b73e96dcef98b7ee5cba
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Fri Dec 16 15:13:56 2011 +0000

    ADC to remove a repository

 adc/trash | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
---
diff --git a/adc/trash b/adc/trash
new file mode 100755
index 0000000..38ed273
--- /dev/null
+++ b/adc/trash
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+. $(dirname $0)/adc.common-functions
+
+[ -z "$1" ] && die 'Error: Need a repo name'
+
+get_rights_and_owner gitolite-admin
+[ -z "$perm_write" ] && die "Error: You do not have permission to remove repositories"
+
+ATTIC=$HOME/Attic
+ATTIC_SUFFIX=`date +%Y-%m-%d_%H:%M:%S`
+WATCHDIR=$HOME/watchdir
+EMPTYSHA1='0000000000000000000000000000000000000000'
+
+repo=$1
+repofull=$GL_REPO_BASE_ABS/packages/$repo.git
+
+[ -d $repofull ] || die "Error: repository $repofull doesn't exist"
+newdir=$ATTIC/$repo
+mkdir -p $newdir || die "Error: cannot create attic directory in $ATTIC"
+[ -d $newdir/%$ATTIC_SUFFIX ] && die "Error: Directory with this timestap already exists"
+echo "Repository removed by $GL_USER" > $repofull/.gitolite.down
+
+( echo $GL_USER
+  echo $1
+  GIT_DIR=$repofull git for-each-ref  --format="%(objectname) $EMPTYSHA1 %(refname)" refs/heads/\*
+  ) > $WATCHDIR/`mktemp $1.XXXXXX`
+
+mv $repofull $newdir/$ATTIC_SUFFIX
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list