-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install
49 lines (38 loc) · 1.38 KB
/
Install
1
2
3
4
5
6
7
8
9
10
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
48
49
#!/usr/bin/tclsh
# ======================================================================
# Configurable items
# ======================================================================
# Install dir: ${destLib}/${packagename}
set destLib [file join /usr/lib/tcltk]
set packageName ZCT
# List of source/dest to install
set filesList {
pkgIndex.tcl
ZCT.tcl
}
# ======================================================================
# Determine the destination lib dir
# ======================================================================
if { [llength ${::argv}] == 1 } {
set destLib [lindex ${::argv} 0]
}
if { [lsearch ${auto_path} ${destLib} ] == -1} {
puts "ERROR: Invalid directory to install. Must be one of these:"
puts "[join ${auto_path} \n]"
exit 1
}
set destLib [file join ${destLib} ${packageName}]
file mkdir ${destLib}
# ======================================================================
# Install
# ======================================================================
foreach source ${filesList} {
set dest [file join ${destLib} ${source}]
puts "Installing ${dest}"
# Create destination dir if needed
set destDir [file dirname ${dest}]
if { ![file isdirectory ${destDir}] } { file mkdir ${destDir} }
# Copy
file copy ${source} ${dest}
}
puts "Done"