From e66cdc9ef77931bf63626a693459a2da833fc2e2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 3 Jun 2008 16:28:08 +0200 Subject: bin/pkg: pkg_doc: First test for perldoc, then doc/ --- bin/pkg | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/pkg b/bin/pkg index e449973..7df34d1 100755 --- a/bin/pkg +++ b/bin/pkg @@ -296,13 +296,15 @@ pkg_changelog () { } pkg_doc () { - # FIXME this sucks - if ([ -r $PDIR/*/doc/$1 ]) { - less $PDIR/*/doc/$1 - } elif ([ -x $PDIR/*/bin/$1 ]) { + # FIXME this globbing sucks + if ([ -x $PDIR/*/bin/$1 ]) { if (file $PDIR/*/bin/$1 | grep 'perl script text executable' &> /dev/null) { perldoc $PDIR/*/bin/$1 } + } elif ([ -r $PDIR/*/doc/$1 ]) { + less $PDIR/*/doc/$1 + } else { + echo "No documentation found" } } -- cgit v1.2.3