diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-18 17:39:24 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-18 17:39:24 +0200 |
commit | 631f0deafc38d245e13e1ccbc2a6076c46eee676 (patch) | |
tree | a9c85345f53e36a30e35cd02cace93a08adcc7be /bin/pkg | |
parent | 7d42e1976ed39df414ca2373a0a481cd5e074732 (diff) |
bin/pkg: Use less external commands
Diffstat (limited to 'bin/pkg')
-rwxr-xr-x | bin/pkg | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -76,9 +76,9 @@ if [[ ! -d $PDIR ]] { ## # Protocol -if (grep '^ssh' <<< $PKG_ROOT &> /dev/null) { +if [[ ${PKG_ROOT#ssh} != $PKG_ROOT ]] { PKG_PROTO='ssh' - } elif (grep '^/' <<< $PKG_ROOT &> /dev/null) { +} elif [[ ${PKG_ROOT#'/'} != $PKG_ROOT ]] { PKG_PROTO='file' } else { false @@ -86,12 +86,12 @@ if (grep '^ssh' <<< $PKG_ROOT &> /dev/null) { # Host if [[ $PKG_PROTO = 'ssh' ]] { - PKG_HOST=$(sed 's!^ssh://!!' <<< $PKG_ROOT | sed -r 's!^([^/]*)/.*$!\1!') + PKG_HOST=$(sed -r 's!^([^/]*)/.*$!\1!' <<< ${PKG_ROOT#'ssh://'}) } # Remote path if [[ $PKG_PROTO = 'ssh' ]] { - PKG_PATH=$(sed 's!^ssh://'"$PKG_HOST"'/!!' <<< $PKG_ROOT) + PKG_PATH=${PKG_ROOT#"ssh://$PKG_HOST"} } elif [[ $PKG_PROTO = 'file' ]] { PKG_PATH=$PKG_ROOT } @@ -209,7 +209,7 @@ list_type_local () { list_update_remote () { if [[ $PKG_PROTO = 'ssh' ]] { - scp -q $PKG_HOST:$(cut -d / -f 4- <<< $PKG_ROOT | sed 's!~/!!')/.list .list-remote + scp -q $PKG_HOST:${$(cut -d / -f 4- <<< $PKG_ROOT)/'~/'}/.list .list-remote } elif [[ $PKG_PROTO = 'file' ]] { cp $PKG_ROOT/.list .list-remote } |