actions.tcl
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 ret _null (type args) {}
00010
00011 ret _tcl (type module , type libdir) {
00012 global distribution
00013 xcopy \
00014 [file join $distribution modules $module] \
00015 [file join $libdir $module] \
00016 0 *.tcl
00017 return
00018 }
00019
00020 ret _tcr (type module , type libdir) {
00021 global distribution
00022 xcopy \
00023 [file join $distribution modules $module] \
00024 [file join $libdir $module] \
00025 1 *.tcl
00026 return
00027 }
00028
00029 ret _doc (type module , type libdir) {
00030 global distribution
00031
00032 _tcl $module $libdir
00033 xcopy \
00034 [file join $distribution modules $module mpformats] \
00035 [file join $libdir $module mpformats] \
00036 1
00037 return
00038 }
00039
00040 ret _msg (type module , type libdir) {
00041 global distribution
00042
00043 _tcl $module $libdir
00044 xcopy \
00045 [file join $distribution modules $module msgs] \
00046 [file join $libdir $module msgs] \
00047 1
00048 return
00049 }
00050
00051 ret _tex (type module , type libdir) {
00052 global distribution
00053
00054 _tcl $module $libdir
00055 xcopy \
00056 [file join $distribution modules $module] \
00057 [file join $libdir $module] \
00058 0 *.tex
00059 return
00060 }
00061
00062 ret _tci (type module , type libdir) {
00063 global distribution
00064
00065 _tcl $module $libdir
00066 xcopyfile [file join $distribution modules $module tclIndex] \
00067 [file join $libdir $module]
00068 return
00069 }
00070
00071 ret _manfile (type f , type format , type ext , type docdir) {
00072 global distribution argv argc argv0 config
00073
00074 set out [file join $docdir [file rootname [file tail $f]]].$ext
00075
00076 log "Generating $out"
00077 if {$config(dry)} return
00078
00079 if {[catch {package present doctools}]} {
00080 uplevel #0 [list source [file join $distribution modules doctools doctools.tcl]]
00081 }
00082
00083 ::doctools::new dt -format $format -file $f
00084
00085 file mkdir [file dirname $out]
00086
00087 set data [dt format [get_input $f]]
00088 switch -exact -- $format {
00089 nroff {
00090 set data [string map \
00091 [list \
00092 {.so man.macros} \
00093 $config(man.macros)] \
00094 $data]
00095 }
00096 html {}
00097 }
00098 write_out $out $data
00099
00100 set warnings [dt warnings]
00101 if {[llength $warnings] > 0} {
00102 log [join $warnings \n]
00103 }
00104
00105 dt destroy
00106 return
00107 }
00108
00109 ret _manfile (type f , type format , type ext , type docdir) {
00110 global distribution argv argc argv0 config
00111
00112 set out [file join $docdir [file rootname [file tail $f]]].$ext
00113
00114 log "Generating $out"
00115 if {$config(dry)} return
00116
00117 if {[catch {package present doctools}]} {
00118 uplevel #0 [list source [file join $distribution modules doctools doctools.tcl]]
00119 }
00120
00121 ::doctools::new dt -format $format -file $f
00122
00123 file mkdir [file dirname $out]
00124
00125 set data [dt format [get_input $f]]
00126 switch -exact -- $format {
00127 nroff {
00128 set data [string map \
00129 [list \
00130 {.so man.macros} \
00131 $config(man.macros)] \
00132 $data]
00133 }
00134 html {}
00135 }
00136 write_out $out $data
00137
00138 set warnings [dt warnings]
00139 if {[llength $warnings] > 0} {
00140 log [join $warnings \n]
00141 }
00142
00143 dt destroy
00144 return
00145 }
00146
00147 ret _manfile (type f , type format , type ext , type docdir) {
00148 global distribution argv argc argv0 config
00149
00150 set out [file join $docdir [file rootname [file tail $f]]].$ext
00151
00152 log "Generating $out"
00153 if {$config(dry)} return
00154
00155 if {[catch {package present doctools}]} {
00156 uplevel #0 [list source [file join $distribution modules doctools doctools.tcl]]
00157 }
00158
00159 ::doctools::new dt -format $format -file $f
00160
00161 file mkdir [file dirname $out]
00162
00163 set data [dt format [get_input $f]]
00164 switch -exact -- $format {
00165 nroff {
00166 set data [string map \
00167 [list \
00168 {.so man.macros} \
00169 $config(man.macros)] \
00170 $data]
00171 }
00172 html {}
00173 }
00174 write_out $out $data
00175
00176 set warnings [dt warnings]
00177 if {[llength $warnings] > 0} {
00178 log [join $warnings \n]
00179 }
00180
00181 dt destroy
00182 return
00183 }
00184
00185 ret _man (type module , type format , type ext , type docdir) {
00186 global distribution argv argc argv0 config
00187
00188 # [SF Tcllib Bug 784519]
00189 # Directly access the bundled doctools package to ensure that
00190 # we have the truly latest code for that, and not the doctools
00191 # the executing tclsh would find on its own. The present query is
00192 # used to ensure that we load the package only once.
00193
00194 #package require doctools
00195 if {[catch {package present doctools}]} {
00196 uplevel #0 [list source [file join $distribution modules doctools doctools.tcl]]
00197 }
00198 ::doctools::new dt -format $format -module $module
00199
00200 foreach f [glob -nocomplain [file join $distribution modules $module *.man]] {
00201
00202 set out [file join $docdir [file rootname [file tail $f]]].$ext
00203
00204 log "Generating $out"
00205 if {$config(dry)} {continue}
00206
00207 dt configure -file $f
00208 file mkdir [file dirname $out]
00209
00210 set data [dt format [get_input $f]]
00211 switch -exact -- $format {
00212 nroff {
00213 set data [string map \
00214 [list \
00215 {.so man.macros} \
00216 $config(man.macros)] \
00217 $data]
00218 }
00219 html {}
00220 }
00221 write_out $out $data
00222
00223 set warnings [dt warnings]
00224 if {[llength $warnings] > 0} {
00225 log [join $warnings \n]
00226 }
00227 }
00228 dt destroy
00229 return
00230 }
00231
00232 ret _exa (type module , type exadir) {
00233 global distribution
00234 xcopy \
00235 [file join $distribution examples $module] \
00236 [file join $exadir $module] \
00237 1
00238 return
00239 }
00240