summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Gebetsroither <michael@mgeb.org>2012-02-11 10:39:37 +0100
committerMichael Gebetsroither <michael@mgeb.org>2012-02-11 10:39:37 +0100
commit2f150db563d11c4ce5b62eae4000d6625fc374ca (patch)
tree2b93f121f7f90861ded67fb09b5a3aa1ab48a8e6
parent996054c82f0aa6260df1acece323ea41b93a410a (diff)
add pkglist scripts for gitolite for both server and ct client
-rwxr-xr-xexamples/pkglist-gitolite9
-rwxr-xr-xexamples/pkglist-gitolite-adc23
2 files changed, 32 insertions, 0 deletions
diff --git a/examples/pkglist-gitolite b/examples/pkglist-gitolite
new file mode 100755
index 0000000..537093a
--- /dev/null
+++ b/examples/pkglist-gitolite
@@ -0,0 +1,9 @@
+#!/bin/bash
+# added to ct as PKGLIST_PATH script with PKGLIST_LOCAL=1
+#
+# This file is licensed under the GPL v2.
+# (c) Michael Gebetsroither <michael@mgeb.org>
+
+ssh $PKG_USER@${PKG_HOST} list_config_repos |while read reponame_ type_ hash_; do
+ echo $reponame_ $type_ $hash_ "$PKG_USER@${PKG_HOST}:${PKG_PATH}/${reponame_}.git"
+done
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 <michael@mgeb.org>
+
+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