summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-10-09 11:31:36 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-10-09 11:31:36 +0200
commitf7bacc255c28fc17c599562c2450720dd83ada4f (patch)
treed9c04240ce743592331139db1461601a74ca93f8
parent9616e70b5b3de3cf889a70a13d680eaa5b8468be (diff)
bin/pkg: Replaced more external programs by zsh-builtins
-rwxr-xr-xbin/pkg16
1 files changed, 5 insertions, 11 deletions
diff --git a/bin/pkg b/bin/pkg
index f399246..c154649 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -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]}
}