From 57ee061f92f967744eb386d744f4fb4d41534e55 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 19 Feb 2010 09:56:48 +0000 Subject: [Bug 2954638]: Correct behaviour of manual page installer. Also added armouring to check that assumptions about the initial state are actually valid (e.g., look for existing input file). --- ChangeLog | 6 +++ unix/installManPage | 103 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 82 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 481430d..92df407 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-02-19 Donal K. Fellows + + * unix/installManPage: [Bug 2954638]: Correct behaviour of manual page + installer. Also added armouring to check that assumptions about the + initial state are actually valid (e.g., look for existing input file). + 2010-02-11 Donal K. Fellows * generic/tclIOCmd.c (Tcl_OpenObjCmd): [Bug 2949740]: Make sure that diff --git a/unix/installManPage b/unix/installManPage index 993d097..e636db7 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -1,12 +1,29 @@ #!/bin/sh -ZIP=: +######################################################################## +### Parse Options +### + +Gzip=: +SymOrLoc="" +Gz="" +Suffix="" + while true; do case $1 in - -s | --symlinks ) S="-s ";; - -z | --compress ) ZIP=$2; shift ;; - -e | --extension ) Z=$2; shift ;; - -s | --suffix ) SUFFIX=$2; shift ;; + -s | --symlinks ) SymOrLoc="-s " ;; + -z | --compress ) Gzip=$2; shift ;; + -e | --extension ) Gz=$2; shift ;; + -x | --suffix ) Suffix=$2; shift ;; + -*) cat < $DIR/$FIRST - chmod 444 $DIR/$FIRST - $ZIP $DIR/$FIRST +First="" +for Target in $Names; do + Target=$Target.$Section$Suffix + rm -f $Dir/$Target $Dir/$Target.* + if test -z "$First" ; then + First=$Target + sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \ + $ManPage > $Dir/$First + chmod 444 $Dir/$First + $Gzip $Dir/$First else - rm -f $DIR/$f $DIR/$f.* - ln $S$FIRST$Z $DIR/$f$Z + ln $SymOrLoc$First$Gz $Dir/$Target$Gz fi done + +######################################################################## +exit 0 -- cgit v0.12