diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-02 16:01:07 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-02 16:01:07 +0200 |
commit | 29fd9d105abe64b4b7c342eb5c303853e08f2b09 (patch) | |
tree | 2b5de37fc8d698c8756ce251f2f2de83dc1e57e4 /bin | |
parent | 0d46c8f965e5b4949fd481801684a18f59e96a51 (diff) |
bin/pkg: Also enable list-all for file proto
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 } } |