summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-07-08 19:54:42 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-07-08 19:54:42 +0200
commitbe02e06b00e95060d8707713e8d2140c2f5da70f (patch)
tree209123cd0277753b47be24874cd6c9ee78baf2ca /bin/pkg
parent8421fbd6f4a90749d91ef321434e12050537617d (diff)
pkg: Added experimental support for git:// roots
Diffstat (limited to 'bin/pkg')
-rwxr-xr-xbin/pkg8
1 files changed, 5 insertions, 3 deletions
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#*@}