From a25dc638eae1a78ec60ec291c5f83c68c1cdbd0d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 7 Feb 2010 16:47:02 +0100 Subject: Move bootstrap and pkglist to examples/ --- examples/pkglist | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 examples/pkglist (limited to 'examples/pkglist') diff --git a/examples/pkglist b/examples/pkglist new file mode 100755 index 0000000..95696a2 --- /dev/null +++ b/examples/pkglist @@ -0,0 +1,34 @@ +#!/usr/bin/env zsh +## on the PKG_HOST: list available packages +## used by ct update remote +## the PKG_PATH (package root path) is given as first argument ($1) + +if [[ ! -d $1 ]] { + echo "$0: package root directory '$1' does not exist!" >&2 + exit 1 +} + +setopt err_exit + +cd $1 +shift + +for i in *(-/); { + + # git repo + if [[ -d $i/.git ]] { + echo -n "$i git " + echo -n ${$(git --git-dir=$i/.git log -n 1)[2]} + echo " $*" + + # bare git repo + } elif [[ -d $i/objects && -d $i/refs ]] { + echo -n "$i git " + echo -n ${$(git --git-dir=$i log -n 1)[2]} + echo " $*" + + # unknown + } else { + echo "$i: Unsupported or no repository" >&2 + } +} -- cgit v1.2.3