summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-02 16:01:07 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-02 16:01:07 +0200
commit29fd9d105abe64b4b7c342eb5c303853e08f2b09 (patch)
tree2b5de37fc8d698c8756ce251f2f2de83dc1e57e4
parent0d46c8f965e5b4949fd481801684a18f59e96a51 (diff)
bin/pkg: Also enable list-all for file proto
-rwxr-xr-xbin/pkg14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index 2126d99..0ef07e9 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -27,6 +27,16 @@ die () {
exit 100
}
+pkg_proto () {
+ if (echo "$PKG_ROOT" | grep "^ssh" &> /dev/null) {
+ echo 'ssh'
+ } elif (echo "$PKG_ROOT" | grep "^/" &> /dev/null) {
+ echo 'file'
+ } else {
+ false
+ }
+}
+
confirm_yes () {
echo -n "$* [Y/n] "
read -k 1
@@ -173,8 +183,10 @@ pkg_list_installed () {
}
pkg_list_available () {
- if (echo "$PKG_ROOT" | grep "^ssh" &> /dev/null) {
+ if ([ "$(pkg_proto)" = 'ssh' ]) {
ssh -q $(echo "$PKG_ROOT" | sed 's!^ssh://!!' | sed -r 's!^([^/]*)/.*$!\1!') ls -1 $(echo "$PKG_ROOT" | sed 's!^ssh://[^/]*/!!')
+ } elif ([ "$(pkg_proto)" = 'file' ]) {
+ ls -1 $PKG_ROOT
}
}