From 2f150db563d11c4ce5b62eae4000d6625fc374ca Mon Sep 17 00:00:00 2001 From: Michael Gebetsroither Date: Sat, 11 Feb 2012 10:39:37 +0100 Subject: add pkglist scripts for gitolite for both server and ct client --- examples/pkglist-gitolite-adc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 examples/pkglist-gitolite-adc (limited to 'examples/pkglist-gitolite-adc') diff --git a/examples/pkglist-gitolite-adc b/examples/pkglist-gitolite-adc new file mode 100755 index 0000000..e41c2b8 --- /dev/null +++ b/examples/pkglist-gitolite-adc @@ -0,0 +1,23 @@ +#!/bin/bash +# Added to gitolite as an Admin Defined Command (adc) +# used by ct update remote through pkglist-gitolite +# +# This file is licensed under the GPL v2. +# (c) Michael Gebetsroither + +CONFIG_PREFIX_="config/" + +if [[ $GL_REPO_BASE_ABS == "" ]]; then + exit 1 +fi +cd "${GL_REPO_BASE_ABS}" || exit 1 + +find "$CONFIG_PREFIX_" -maxdepth 1 -type d -iname '*.git' |while read i; do + hash_="`cat $i/refs/heads/master 2>/dev/null`" + if [[ $hash_ == "" ]]; then + continue + fi + reponame_="${i#$CONFIG_PREFIX_}" + reponame_="${reponame_%.git}" + echo "${reponame_} git $hash_" +done -- cgit v1.2.3