Lines of
xvfs-create
from check-in b8cca3a6b4
that are changed by the sequence of edits moving toward
check-in d80c88cee0:
1: #! /usr/bin/env tclsh
2:
3: set sourceDirectory [file dirname [file normalize [info script]]]
4:
5: lappend auto_path [file join $sourceDirectory lib]
6:
7: set template [file join $sourceDirectory xvfs.c.rvt]
8:
9: package require minirivet
10:
11: set mode "run"
12: if {[lindex $argv 0] == "--dump-tcl"} {
13: set mode "dump-tcl"
14: }
15:
16: switch -- $mode {
17: "run" {
18: ::minirivet::parse $template
19: }
20: "dump-tcl" {
21: set xvfs_tcl [file join $sourceDirectory lib xvfs xvfs.tcl]
22: set xvfs_core_h [file join $sourceDirectory xvfs-core.h]
23: set xvfs_core_c [file join $sourceDirectory xvfs-core.c]
24:
25: set cleanup {
26: "#include <xvfs-core.h>" ""
27: "#include <xvfs-core.c>" ""
28: }
29:
30: set core_header_data ""
31: append core_header_data [string map $cleanup [read [open $xvfs_core_h]]] "\n"
32: append core_header_data [string map $cleanup [read [open $xvfs_core_c]]] "\n"
33:
34: puts "#! /usr/bin/env tclsh"
35: puts ""
36: puts [read [open $xvfs_tcl]]
37: puts ""
38: puts [list puts -nonewline $core_header_data]
39: puts ""
40: puts [string map $cleanup [::minirivet::parseStringToCode [read [open $template]]]]
41: }
42: default {
43: puts stderr "error: Invalid mode: $mode"
44: exit 1
45: }
46: }