diff options
author | nijtmans <nijtmans> | 2010-05-21 12:11:58 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-05-21 12:11:58 (GMT) |
commit | 9cb882ffefc858535b31f7da4b6e955d890ad7de (patch) | |
tree | edf8b1f82bc87c3f6a67ace6ca3f7d196091fbdf /tools/installData.tcl | |
parent | 24f9dad514d1496c92732307721f86fcd897e946 (diff) | |
download | tcl-9cb882ffefc858535b31f7da4b6e955d890ad7de.zip tcl-9cb882ffefc858535b31f7da4b6e955d890ad7de.tar.gz tcl-9cb882ffefc858535b31f7da4b6e955d890ad7de.tar.bz2 |
Make sure that copyDir only receives normalized paths, otherwise it might result in a crash on CYGWIN.
restyle according to the Tcl style guide
Diffstat (limited to 'tools/installData.tcl')
-rw-r--r-- | tools/installData.tcl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/installData.tcl b/tools/installData.tcl index 5bf0ad1..8f6bc2d 100644 --- a/tools/installData.tcl +++ b/tools/installData.tcl @@ -16,38 +16,38 @@ exec tclsh "$0" ${1+"$@"} # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: installData.tcl,v 1.2 2009/03/25 23:22:38 nijtmans Exp $ +# RCS: @(#) $Id: installData.tcl,v 1.3 2010/05/21 12:11:59 nijtmans Exp $ # #---------------------------------------------------------------------- -proc copyDir { d1 d2 } { +proc copyDir {d1 d2} { - puts [format {%*sCreating %s} [expr { 4 * [info level] }] {} \ + puts [format {%*sCreating %s} [expr {4 * [info level]}] {} \ [file tail $d2]] file delete -force -- $d2 file mkdir $d2 - + foreach ftail [glob -directory $d1 -nocomplain -tails *] { set f [file join $d1 $ftail] - if { [file isdirectory $f] && [string compare CVS $ftail] } { + if {[file isdirectory $f] && [string compare CVS $ftail]} { copyDir $f [file join $d2 $ftail] - } elseif { [file isfile $f] } { + } elseif {[file isfile $f]} { file copy -force $f [file join $d2 $ftail] - if { $::tcl_platform(platform) eq {unix} } { + if {$::tcl_platform(platform) eq {unix}} { file attributes [file join $d2 $ftail] -permissions 0644 } else { file attributes [file join $d2 $ftail] -readonly 1 } } } - - if { $::tcl_platform(platform) eq {unix} } { + + if {$::tcl_platform(platform) eq {unix}} { file attributes $d2 -permissions 0755 } else { file attributes $d2 -readonly 1 } -} - -copyDir [lindex $argv 0] [lindex $argv 1] +} + +copyDir [file normalize [lindex $argv 0]] [file normalize [lindex $argv 1]] |