diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -68,12 +68,6 @@ export PKG_ROOT ## Warn otherwise ## -# we need sed -r (and sed -i, but not checking for that here) -QUUX=$(sed -r 's/^fo{2}(.)$/quu\1/' <<< foox 2> /dev/null) -if [[ $QUUX != 'quux' ]] { - warn "sed is not working properly. This may produce unexpected behaviour.\n" -} - if [[ ! -d $PDIR ]] { die "$PDIR not found!!\n" } @@ -94,7 +88,7 @@ if [[ ${PKG_ROOT#ssh} != $PKG_ROOT ]] { # Host if [[ $PKG_PROTO = 'ssh' ]] { - PKG_HOST=$(sed -r 's!^([^/]*)/.*$!\1!' <<< ${PKG_ROOT#'ssh://'}) + PKG_HOST=${${PKG_ROOT#'ssh://'}%%/*} } # Remote path @@ -203,11 +197,11 @@ list_incoming () { } list_type () { - grep ^"$1 " $PDIR/.list-remote | cut -d ' ' -f 2 + echo ${$(grep ^"$1 " $PDIR/.list-remote)[2]} } list_type_local () { - grep ^"$1 " $PDIR/.list | cut -d ' ' -f 2 + echo ${$(grep ^"$1 " $PDIR/.list)[2]} } list_update_remote () { @@ -253,11 +247,11 @@ list_remove_package () { } list_local_version () { - grep "^$1 " $PDIR/.list | cut -d ' ' -f 3 + echo ${$(grep "^$1 " $PDIR/.list)[3]} } list_remote_version () { - grep "^$1 " $PDIR/.list-remote | cut -d ' ' -f 3 + echo ${$(grep "^$1 " $PDIR/.list-remote)[3]} } |