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

glen glen at pld-linux.org
Mon Sep 21 21:45:17 CEST 2015


commit 60658e341c1b76521c4f6c2ef98d801d23860de2
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Mon Dec 19 05:49:24 2011 +0000

    ADC to remove a repository

 setup.py |  1 +
 trash    | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
---
diff --git a/setup.py b/setup.py
index 188cb02..7f51e6a 100644
--- a/setup.py
+++ b/setup.py
@@ -10,5 +10,6 @@ setup(name='git-core-slug',
       url='https://github.com/draenog/slug',
       classifiers=['Programming Language :: Python :: 3'],
       packages=['git_slug'],
+      data_files=[('/home/services/gitolite/adc/bin', ['trash'])],
       scripts=['slug.py', 'slug_watch']
      )
diff --git a/trash b/trash
new file mode 100755
index 0000000..b716c77
--- /dev/null
+++ b/trash
@@ -0,0 +1,27 @@
+#!/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
+GL_REPO_BASE_ABS=$HOME/repositories
+WATCHDIR=$HOME/watchdir
+EMPTYSHA1='0000000000000000000000000000000000000000'
+
+repo=$GL_REPO_BASE_ABS/packages/$1.git
+
+[ -d $repo ] || die "Error: repository $repo does'nt exist"
+[ -d $ATTIC ] || die "Error: Directory $ATTIC does not exist"
+[ -e $ATTIC/$repo ] && die "Error: Directory $ATTIC/abra already exist"
+echo "Repository removed by $GL_USER" > $repo/.gitolite.down
+
+( echo $GL_USER
+  echo $1
+  GIT_DIR=$repo git for-each-ref  --format="%(objectname) $EMPTYSHA1 %(refname)" refs/heads/\*
+  ) > $WATCHDIR/`mktemp $1.XXXXXX`
+
+mv $repo $ATTIC
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list