From 471b2df9228c4a0d62e3cb5af2f0a3e3ff10ae69 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 19 Feb 2010 13:45:39 +0000 Subject: [Tcl 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 | 18 ++++--- unix/installManPage | 133 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 102 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 554dcee..a7bd389 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-02-19 Donal K. Fellows + + * unix/installManPage: [Tcl 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-19 Stuart Cassoff * tcl.m4: Correct compiler/linker flags @@ -6,14 +13,13 @@ 2010-02-17 Joe English - * generic/tkMenu.c: Defer TkMenuOptionTables cleanup - to CallWhenDeleted() time, to ensure that the record - doesn't get freed until after all widget instance commands - have been deleted (Fixes [Bug#2952745]). + * generic/tkMenu.c: [Bug 2952745]: Defer TkMenuOptionTables cleanup to + CallWhenDeleted() time, to ensure that the record doesn't get freed + until after all widget instance commands have been deleted. 2010-02-16 Jan Nijtmans - * unix/tkUnixWm.c make TkSetTransientFor static + * unix/tkUnixWm.c make TkSetTransientFor static 2010-02-07 Jan Nijtmans @@ -162,7 +168,7 @@ 2009-12-27 Pat Thoyts - * win/tkWinMenu.c: [Bug 2879927]: Highlight for cascade items in + * win/tkWinMenu.c: [Bug 2879927]: Highlight for cascade items in torn-off menus is incorrect on Windows. 2009-12-25 Donal K. Fellows diff --git a/unix/installManPage b/unix/installManPage index 98cd899..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 +case $ManPage in + *.1) Section=1 ;; + *.3) Section=3 ;; + *.n) Section=n ;; + *) echo "unknown section for $ManPage" + exit 2 ;; +esac + +SrcDir=`dirname $ManPage` + +######################################################################## +### Process Page to Create Target Pages +### + +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