From 7bed8dbc079a3903608327f88a47604fe4e28234 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 Jun 2008 16:23:25 +0200 Subject: bin/pkg: Use more zsh magic --- bin/pkg | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index 040917b..1986a17 100755 --- a/bin/pkg +++ b/bin/pkg @@ -192,23 +192,21 @@ populate_collected () { cd $PDIR/$1 || return info "Enabling documentation " if ([ -d man ]) { - for section in man/*; { - section=$(basename $section) - for manpage in man/$section/*; { - manpage=$(basename $manpage) - if (podchecker man/$section/$manpage &> /dev/null) { - pod2man -s $section -c "$1 package" -r "/home/derf" man/$section/$manpage > $PDIR/.collected/man/man$section/$manpage.$section - echo -n "+" - } else { - echo -n "." - } + for i in man/*/*; { + section=${i:h:t} + manpage=${i:t} + if (podchecker man/$section/$manpage &> /dev/null) { + pod2man -s $section -c "$1 package" -r "/home/derf" man/$section/$manpage > $PDIR/.collected/man/man$section/$manpage.$section + echo -n "+" + } else { + echo -n "." } } } if ([ -d bin ]) { for i in bin/*; { if (podchecker $i &> /dev/null) { - pod2man $i > $PDIR/.collected/man/man1/$(basename $i).1 + pod2man $i > $PDIR/.collected/man/man1/${i:t}.1 echo -n "+" } else { echo -n "." -- cgit v1.2.3