diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-12-10 23:23:50 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-12-10 23:23:50 (GMT) |
commit | c1784e6b4c9a0008544f33c672e1af223e09ae29 (patch) | |
tree | 70bc77c19aa47bec62ef9cece09fb045d647b65e /tools | |
parent | 15f02f424cbc25390850f6be03592853eab1fa8b (diff) | |
download | tcl-c1784e6b4c9a0008544f33c672e1af223e09ae29.zip tcl-c1784e6b4c9a0008544f33c672e1af223e09ae29.tar.gz tcl-c1784e6b4c9a0008544f33c672e1af223e09ae29.tar.bz2 |
Improve the generation of HTML documentation in 8.6, allowing for contributed
packages whose non-version name parts are prefixes of others. Also ensure that
documentation builds are complete after distribution, and that we generate a
better error message when using the wrong tclsh version to do the build.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/tcltk-man2html.tcl | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index 665a1d4..270a774 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -1,6 +1,12 @@ #!/usr/bin/env tclsh -package require Tcl 8.6 +if {[catch {package require Tcl 8.6} msg]} { + puts stderr "ERROR: $msg" + puts stderr "If running this script from 'make html', set the\ + NATIVE_TCLSH environment\nvariable to point to an installed\ + tclsh8.6 (or the equivalent tclsh86.exe\non Windows)." + exit 1 +} # Convert Ousterhout format man pages into highly crosslinked hypertext. # @@ -16,7 +22,7 @@ package require Tcl 8.6 # Copyright (c) 1995-1997 Roger E. Critchlow Jr # Copyright (c) 2004-2010 Donal K. Fellows -regexp {\d+\.\d+} {$Revision: 1.49 $} ::Version +set ::Version "50/8.6" set ::CSSFILE "docs.css" ## @@ -454,16 +460,18 @@ proc plus-pkgs {type args} { } if {!$build_tcl} return set result {} + set pkgsdir $tcltkdir/$tcldir/pkgs foreach {dir name} $args { - set globpat $tcltkdir/$tcldir/pkgs/$dir*/doc/*.$type - if {![llength [glob -nocomplain $globpat]]} { + set globpat $pkgsdir/{$dir,$dir\[0-9\]*}/doc/*.$type + if {![llength [glob -type f -nocomplain $globpat]]} { # Fallback for manpages generated using doctools - set globpat $tcltkdir/$tcldir/pkgs/$dir*/doc/man/*.$type - if {![llength [glob -nocomplain $globpat]]} { + set globpat $pkgsdir/{$dir,$dir\[0-9\]*}/doc/man/*.$type + if {![llength [glob -type f -nocomplain $globpat]]} { continue } } - regexp "pkgs/${dir}(.*)/doc$" [glob $tcltkdir/$tcldir/pkgs/$dir*/doc] \ + regexp "pkgs/${dir}(.*)/doc$" \ + [lindex [glob -type d $pkgsdir/{$dir,$dir\[0-9\]*}/doc] 0] \ -> version switch $type { n { |