From 317efb1c7493b1e9198d040ada01e729e2bf03f2 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Mon, 14 Dec 2009 21:57:48 +0000 Subject: [PATCH] Avoid copying emacs and cvs temporary files into the vfs. git-svn-id: svn://svn.equi4.com/kitgen/trunk@4737 9e558909-932a-0410-a563-af77432da1eb --- setupvfs.tcl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/setupvfs.tcl b/setupvfs.tcl index 73b9237..803c3dd 100644 --- a/setupvfs.tcl +++ b/setupvfs.tcl @@ -306,6 +306,11 @@ proc vfscopy {argv} { global vfs versmap foreach f $argv { + # avoid emacs and cvs temporary files. + if {[string match "*~" $f] || [string match ".#*" $f]} { + puts "skipping file '$f'" + continue + } set f [string map $versmap $f] set d $vfs/[file dirname $f] @@ -315,7 +320,21 @@ proc vfscopy {argv} { set src [locatefile $f] set dest $vfs/$f + + # If the source is a directory, recurse. + if {[file isdir $src]} { + set contents {} + foreach ff [glob -nocomplain -directory $src -tails *] { + lappend contents $f/$ff + } + vfscopy $contents + continue + } + if {$::debugOpt} { + puts " $f \[$src\] ==> \$vfs/$f" + } + switch -- [file extension $src] { .tcl - .txt - .msg - .test { # get line-endings right for text files - this is crucial for boot.tcl @@ -454,3 +473,9 @@ vfs::unmount $vfs if {$debugOpt} { puts "\nDone with [info script]" } + +# Local variables: +# mode: tcl +# indent-tabs-mode: nil +# tcl-indent-level: 2 +# End: -- 2.23.0