diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-03 15:10:04 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-03 15:10:04 +0100 |
commit | 2295f52d4fa2882f4ad0ae724a3b1f3d7fa89f98 (patch) | |
tree | e006786ba773679760a4e5bd43f17cab0f6d129c /bin | |
parent | f769ffd2656ae3920d417c458098907e8d1060c9 (diff) |
bin/pkg: Add $PKG_USER
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -94,9 +94,15 @@ if [[ ${PKG_ROOT#ssh} != $PKG_ROOT ]] { false } -# Host +# user@host if [[ $PKG_PROTO = 'ssh' ]] { PKG_HOST=${${PKG_ROOT#'ssh://'}%%/*} + if [[ $PKG_HOST == *@* ]] { + PKG_USER=${PKG_HOST%%@*} + PKG_HOST=${PKG_HOST#*@} + } else { + PKG_USER=$USERNAME + } } # Remote path @@ -216,9 +222,9 @@ function list_type_local { function list_update_remote { export PDIR if [[ $PKG_PROTO = 'ssh' ]] { - ssh $PKG_HOST "PDIR='$PDIR' $PKG_PATH/core/include/pkglist $PKG_PATH" > .list-remote + ssh $PKG_USER@$PKG_HOST "PDIR='$PDIR' $PKG_PATH/core/include/pkglist $PKG_PATH" > .list-remote if [[ ${#$(cat .list-remote)} == 0 ]] { - scp -q $PKG_HOST:$PKG_PATH/.list .list-remote + scp -q $PKG_USER@$PKG_HOST:$PKG_PATH/.list .list-remote warn "The pkglist version on your packages_root is outdated, please update\n" } } elif [[ $PKG_PROTO = 'file' ]] { |