summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwylite <twylite@crypt.co.za>2013-01-07 13:16:12 (GMT)
committertwylite <twylite@crypt.co.za>2013-01-07 13:16:12 (GMT)
commitce0fd7d272a2797c752e4c8c328573db60ee1963 (patch)
tree941bee187ed1a7fbec94d0eba937a75577d52a2b
parent7acea3af7b9aead1af0702058bb8fca92ab11449 (diff)
downloadtcl-ce0fd7d272a2797c752e4c8c328573db60ee1963.zip
tcl-ce0fd7d272a2797c752e4c8c328573db60ee1963.tar.gz
tcl-ce0fd7d272a2797c752e4c8c328573db60ee1963.tar.bz2
FRQ-3599786: add command line option --pkgdir to tcltk-man2html.tcl to specify the directory under which package sources can be found (default tcldir/pkgs).
-rwxr-xr-xtools/tcltk-man2html.tcl27
1 files changed, 20 insertions, 7 deletions
diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl
index f392bce..1028ae5 100755
--- a/tools/tcltk-man2html.tcl
+++ b/tools/tcltk-man2html.tcl
@@ -36,13 +36,14 @@ proc parse_command_line {} {
# These variables determine where the man pages come from and where
# the converted pages go to.
- global tcltkdir tkdir tcldir webdir build_tcl build_tk verbose
+ global tcltkdir tkdir tcldir webdir pkgsDir build_tcl build_tk verbose
# Set defaults based on original code.
set tcltkdir ../..
set tkdir {}
set tcldir {}
set webdir ../html
+ set pkgsDir {}
set build_tcl 0
set build_tk 0
set verbose 0
@@ -69,6 +70,7 @@ proc parse_command_line {} {
puts " --version print version number, then exit"
puts " --srcdir=DIR find tcl and tk source below DIR"
puts " --htmldir=DIR put generated HTML in DIR"
+ puts " --pkgdir=DIR find package sources below DIR"
puts " --tcl build tcl help"
puts " --tk build tk help"
puts " --useversion version of tcl/tk to search for"
@@ -85,6 +87,11 @@ proc parse_command_line {} {
# length of "--htmldir=" is 10
set webdir [string range $option 10 end]
}
+
+ --pkgdir=* {
+ # length of "--pkgdir=" is 9
+ set pkgsDir [string range $option 9 end]
+ }
--useversion=* {
# length of "--useversion=" is 13
@@ -136,6 +143,12 @@ proc parse_command_line {} {
}
puts "using Tk source directory $tkdir"
}
+
+ if { $pkgsDir eq {} } {
+ # Use default packages dir.
+ set pkgsDir [file join $tcltkdir $tcldir pkgs]
+ }
+ puts "using Packages source directory $pkgsDir"
puts "verbose messages are [expr {$verbose ? {on} : {off}}]"
@@ -454,18 +467,17 @@ proc plus-base {var root glob name dir desc} {
## Helper for assembling the descriptions of contributed packages.
##
proc plus-pkgs {type args} {
- global build_tcl tcltkdir tcldir
+ global build_tcl tcltkdir tcldir pkgsDir
if {$type ni {n 3}} {
error "unknown type \"$type\": must be 3 or n"
}
if {!$build_tcl} return
set result {}
- set pkgsdir $tcltkdir/$tcldir/pkgs
foreach {dir name version} $args {
- set globpat $pkgsdir/$dir/doc/*.$type
+ set globpat $pkgsDir/$dir/doc/*.$type
if {![llength [glob -type f -nocomplain $globpat]]} {
# Fallback for manpages generated using doctools
- set globpat $pkgsdir/$dir/doc/man/*.$type
+ set globpat $pkgsDir/$dir/doc/man/*.$type
if {![llength [glob -type f -nocomplain $globpat]]} {
continue
}
@@ -651,7 +663,6 @@ try {
# When building docs for Tcl, try to build docs for bundled packages too
set packageBuildList {}
if {$build_tcl} {
- set pkgsDir [file join $tcltkdir $tcldir pkgs]
set subdirs [glob -nocomplain -types d -tails -directory $pkgsDir *]
foreach dir [lsort $subdirs] {
@@ -672,7 +683,9 @@ try {
break
}
}
- } finally {
+ } trap {POSIX ENOENT} {e} {
+ puts stderr "warning: no 'configure.in' in '[file nativename [file join $pkgsDir $dir]]'"
+ } finally {
catch {close $f; unset f}
}