From 162d905c93ef52f59a8bc582549b6ec429cbd421 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 2 May 2010 14:05:06 +0200 Subject: Make the whole system more flexible (NOT backwards compatible) * Split up PKG_ROOT into PKG_PROTO, PKG_USER, PKG_HOST and PKG_PATH * Change the fourth list field from PKG_ROOT to the repo's clone uri It is now possible to host your repos on github, for example. --- examples/pkglist | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'examples/pkglist') diff --git a/examples/pkglist b/examples/pkglist index 7e6747f..5faf3a8 100755 --- a/examples/pkglist +++ b/examples/pkglist @@ -1,22 +1,20 @@ #!/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 [[ -z $1 ]] { - echo "Usage: $0 " >&2 +if [[ -z ${PKG_PATH} || -z ${PKG_PROTO} ]] { + echo "PKG_PATH and PKG_PROTO must be set while running $0" >&2 exit 1 } -if [[ ! -d $1 ]] { - echo "$0: package root directory '$1' does not exist!" >&2 +if [[ ! -d ${PKG_PATH} ]] { + echo "$0: package root directory '$PKG_PATH' does not exist!" >&2 exit 1 } setopt err_exit -cd $1 -shift +cd $PKG_PATH for dir in *(-/); { @@ -24,13 +22,13 @@ for dir in *(-/); { if [[ -d $dir/.git ]] { echo -n "$dir git " echo -n ${$(git --git-dir=$dir/.git log -n 1)[2]} - echo " $*" + echo " ${PKG_PROTO}://${PKG_UAH}/${PKG_PATH}/${dir}/.git" # bare git repo } elif [[ -d $dir/objects && -d $dir/refs ]] { echo -n "$dir git " echo -n ${$(git --git-dir=$dir log -n 1)[2]} - echo " $*" + echo " ${PKG_PROTO}://${PKG_UAH}/${PKG_PATH}/${dir}" # unknown } else { -- cgit v1.2.3