From 90448a479de47aa482e2975471e6edf4e51698bb Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 23:52:31 +0200 Subject: [PATCH] only generate man|html pages when necessery; allow the process to be interrupted Signed-off-by: Steven Armstrong --- build.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index a6a0e7b0..7fbb94cc 100755 --- a/build.sh +++ b/build.sh @@ -49,10 +49,24 @@ case "$1" in ;; manbuild) - for src in ${MAN1DSTDIR}/*.text ${MAN7DSTDIR}/*.text; do - echo "Compiling manpage and html for $src" - $A2XM "$src" - $A2XH "$src" + trap abort INT + abort() { + kill 0 + } + for section in 1 7; do + for src in ${MANDIR}/man${section}/*.text; do + manpage="${src%.text}.$section" + if [ ! -f "$manpage" -o "$manpage" -ot "$src" ]; then + echo "Compiling manpage for $src" + setsid $A2XM "$src" + a2x_pids="" + fi + htmlpage="${src%.text}.html" + if [ ! -f "$htmlpage" -o "$htmlpage" -ot "$src" ]; then + echo "Compiling html for $src" + $A2XH "$src" + fi + done done ;;