summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-21 16:23:25 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-21 16:23:25 +0200
commit7bed8dbc079a3903608327f88a47604fe4e28234 (patch)
tree01618c51435678410a2b947a5e527b06fbcd4687 /bin/pkg
parent825c86fbfd2aaf2461a01b66ea58fa83b3e7c403 (diff)
bin/pkg: Use more zsh magic
Diffstat (limited to 'bin/pkg')
-rwxr-xr-xbin/pkg20
1 files changed, 9 insertions, 11 deletions
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 "."