11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
set kitfile [lindex $argv 0]
set vfsdir [lindex $argv 1]
if {[lindex $argv 2] != ""} {
set opt_compression [lindex $argv 2]
}
# Determine what storage mechanism is being used
## This logic must be duplicated from "kitInit.c"
set fd [open Makefile r]
set data [read $fd]
close $fd
if {[string match "*KIT_STORAGE_ZIP*" $data]} {
set tclKitStorage zip
}
if {[string match "*KIT_STORAGE_MK4*" $data]} {
set tclKitStorage mk4
}
if {[string match "*KIT_STORAGE_CVFS*" $data]} {
set tclKitStorage cvfs
}
if {![info exists tclKitStorage]} {
if {[string match "*KIT_INCLUDES_MK4TCL*" $data]} {
set tclKitStorage mk4
} else {
set tclKitStorage zip
}
}
# Define procedures
proc copy_file {srcfile destfile} {
switch -glob -- $srcfile {
"*.tcl" - "*.txt" {
set ifd [open $srcfile r]
set ofd [open $destfile w]
|
<
<
<
<
<
<
<
<
<
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
set kitfile [lindex $argv 0]
set vfsdir [lindex $argv 1]
if {[lindex $argv 2] != ""} {
set opt_compression [lindex $argv 2]
}
# Determine what storage mechanism is being used
set fd [open Makefile r]
set data [read $fd]
close $fd
if {[string match "*KIT_STORAGE_ZIP*" $data]} {
set tclKitStorage zip
}
if {[string match "*KIT_STORAGE_MK4*" $data]} {
set tclKitStorage mk4
}
if {[string match "*KIT_STORAGE_CVFS*" $data]} {
set tclKitStorage cvfs
}
# Define procedures
proc copy_file {srcfile destfile} {
switch -glob -- $srcfile {
"*.tcl" - "*.txt" {
set ifd [open $srcfile r]
set ofd [open $destfile w]
|
116
117
118
119
120
121
122
123
124
|
if {[catch {
close $zipfd
} err]} {
puts stderr "Error while updating executable: $err"
exit 1
}
}
}
|
>
>
|
>
|
107
108
109
110
111
112
113
114
115
116
117
118
|
if {[catch {
close $zipfd
} err]} {
puts stderr "Error while updating executable: $err"
exit 1
}
}
"cvfs" {
# No-op
}
}
|