summaryrefslogtreecommitdiff
path: root/examples/pkglist
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-05-02 14:05:06 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-05-02 14:28:50 +0200
commit162d905c93ef52f59a8bc582549b6ec429cbd421 (patch)
tree14d2f55bcbe56c95058f29711474dc7cbdc7c631 /examples/pkglist
parenteb254a1deca26d8a409300776f0a46549ebf74b8 (diff)
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.
Diffstat (limited to 'examples/pkglist')
-rwxr-xr-xexamples/pkglist16
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 {