diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-27 23:47:42 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-27 23:47:42 +0200 |
commit | 3ef4cde2e6659a6e6858c9b3502c2605c8b03e9c (patch) | |
tree | 4cfb2e0090eb4cd5460e2030cc3e393df24ed264 | |
parent | 8555ec255addb1ea54d7cbb1eb824cfa976b279a (diff) |
bin/pkg: Automatically get the repo type
-rwxr-xr-x | bin/pkg | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -119,9 +119,9 @@ confirm_no () { vcs_add () { cd "$PDIR" - case "$1" in - git) git clone "$2" ;; - hg|'') hg clone "$2" ;; + case vcs_type "$1" in + git) git clone "$1" ;; + hg) hg clone "$1" ;; *) die "Cannot handle repository format '$1'\n" ;; esac } @@ -136,6 +136,10 @@ vcs_log () { [ -d .git ] && {git log ; return} } +vcs_type () { + grep ^"$1" $PDIR/.list-remote | cut -d ' ' -f 2 +} + vcs_upgrade () { [ -d .hg ] && {hg pull --update ; return} [ -d .git ] && {git pull ; return} @@ -324,7 +328,7 @@ pkg_update () { if ([ "$PKG_PROTO" = 'ssh' ]) { scp $PKG_HOST:$(echo $PKG_ROOT | cut -d / -f 4- | sed 's!~/!!')/.list .remote-list } elif ([ "$PKG_PROTO" = 'file' ]) { - cp $PKG_ROOT/.list . + cp $PKG_ROOT/.list .list-remote } core/include/pkglist $PDIR } |