diff options
Diffstat (limited to 'examples/pkglist')
-rwxr-xr-x | examples/pkglist | 16 |
1 files changed, 7 insertions, 9 deletions
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 <package root path>" >&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 { |