diff options
Diffstat (limited to 'unix/mkLinks.tcl')
-rw-r--r-- | unix/mkLinks.tcl | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/unix/mkLinks.tcl b/unix/mkLinks.tcl index dd6dc52..166bc88 100644 --- a/unix/mkLinks.tcl +++ b/unix/mkLinks.tcl @@ -22,11 +22,33 @@ puts stdout \ # The script takes one argument, which is the name of the directory # where the manual entries have been installed. +while true; do + case $1 in + -s | --symlinks ) + S=-s + ;; + -z | --compress ) + ZIP=$2 + shift + ;; + *) break + ;; + esac + shift +done + if test $# != 1; then - echo "Usage: mkLinks dir" + echo "Usage: mkLinks <options> dir" exit 1 fi +if test -n "$ZIP"; then + touch TeST + $ZIP TeST + Z=`ls TeST* | sed 's/^[^.]*//'` + rm -f TeST* +fi + cd $1 echo foo > xyzzyTestingAVeryLongFileName.foo x=`echo xyzzyTe*` @@ -72,12 +94,16 @@ foreach file $argv { set tstfi "" } lappend namelist $name$ext - append rmOutput " $tst rm -f $name$ext$tstfi\n" - append lnOutput " $tst ln $tail $name$ext$tstfi\n" + append rmOutput " $tst rm -f $name$ext $name$ext\$Z$tstfi\n" + append lnOutput " $tst ln \$S $tail\$Z $name$ext\$Z$tstfi\n" } } + puts "if test -n \"\$ZIP\" -a -r $tail; then" + puts " rm -f $tail\$Z" + puts " \$ZIP $tail" + puts "fi" if { [llength $namelist] } { - puts "if test -r $tail; then" + puts "if test -r $tail\$Z; then" puts -nonewline $rmOutput puts -nonewline $lnOutput puts "fi" |