From c415821025e4efe8b28e37fac17f33ae0467f780 Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Mon, 29 Dec 2003 16:49:49 +0000 Subject: [PATCH] fix_man now properly handles manpages with embedded spaces in the name Symlinks are now retargetet. manpage RM moved to be pr. manpage, this fixes the race? condition I was seeing on Irix 5.3 with GNU rm. --- buildpkg.functions | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/buildpkg.functions b/buildpkg.functions index a33e1cc..3758757 100644 --- a/buildpkg.functions +++ b/buildpkg.functions @@ -50,6 +50,7 @@ SORT=/usr/bin/sort CUT=/usr/bin/cut LS=/usr/bin/ls EXPR=/usr/bin/expr +MV=/usr/bin/mv # Groff stuff for manpages NEQN=/usr/local/bin/neqn @@ -279,15 +280,22 @@ fix_man() do if [ -d $i ]; then catdir=cat${i##man} - mkdir $catdir + $MKDIR $catdir cd $i - for j in * + for manpage in * do - $NEQN $NEQNOPTS $j | $TBL | $NROFF $NROFFOPTS > ../$catdir/$j - $GZIP ../$catdir/$j + if [ -L "$manpage" ]; then + TARGET=$($LS -l "$manpage" | $AWK '{ print $NF }') + ln -snf "$TARGET".gz "$manpage".gz + $MV "$manpage".gz "../$catdir" + $RM -f "$manpage" + else + $NEQN $NEQNOPTS "$manpage" | $TBL | $NROFF $NROFFOPTS > "../$catdir/$manpage" + $GZIP "../$catdir/$manpage" + $RM -f $manpage + fi done cd .. - rm -rf $i/* rmdir $i fi done