From be02e06b00e95060d8707713e8d2140c2f5da70f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 8 Jul 2009 19:54:42 +0200 Subject: pkg: Added experimental support for git:// roots --- bin/pkg | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index 51adfc9..83aae40 100755 --- a/bin/pkg +++ b/bin/pkg @@ -136,6 +136,8 @@ if [[ ! -d $PKG_DIR ]] { # Protocol if [[ $PKG_ROOT == ssh://* ]] { PKG_PROTO='ssh' +} elif [[ $PKG_ROOT == git://* ]] { + PKG_PROTO='git' } elif [[ $PKG_ROOT == /* ]] { PKG_PROTO='file' } else { @@ -143,9 +145,9 @@ if [[ $PKG_ROOT == ssh://* ]] { } # user, host, path -if [[ $PKG_PROTO == 'ssh' ]] { - PKG_HOST=${${PKG_ROOT#'ssh://'}%%/*} - PKG_PATH=${PKG_ROOT#"ssh://$PKG_HOST"} +if [[ $PKG_PROTO == (git|ssh) ]] { + PKG_HOST=${${PKG_ROOT#"${PKG_PROTO}://"}%%/*} + PKG_PATH=${PKG_ROOT#"${PKG_PROTO}://$PKG_HOST"} if [[ $PKG_HOST == *@* ]] { PKG_USER=${PKG_HOST%%@*} PKG_HOST=${PKG_HOST#*@} -- cgit v1.2.3