Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pcollar.tcl part of check-in [6625739eda] - cvs2fossil: add -nocomplain flag to glob to prevent an error if no files/dirs match by mjanssen on 2008-01-29 00:12:12. [view]

To:

File tools/cvs2fossil/lib/c2f_pcollar.tcl part of check-in [edc46651c7] - Moved the new case-sensitive file checking code into the misc package with descriptive command names, to recapture clarity of code at the calling places. by aku on 2008-01-29 04:05:10. [view]

@@ -23,8 +23,9 @@
 package require fileutil::traverse                  ; # Directory traversal.
 package require fileutil                            ; # File & path utilities.
 package require vc::tools::trouble                  ; # Error reporting.
 package require vc::tools::log                      ; # User feedback.
+package require vc::tools::misc                     ; # Local file utilities.
 package require vc::fossil::import::cvs::pass       ; # Pass management.
 package require vc::fossil::import::cvs::repository ; # Repository management.
 package require vc::fossil::import::cvs::state      ; # State storage
 
@@ -115,10 +116,10 @@
 		if {[IsSuperceded $base $rcs $usr $isattic]} continue
 
 		# XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX
 		if {
-		    [lsearch [glob -nocomplain -tail -types f -directory $base *] $usr] != -1 &&
-		    [lsearch [glob -nocomplain -tail -types d -directory $base *] $usr] != -1
+		    [fileexists_ci $base/$usr] &&
+		    [fileisdir_ci  $base/$usr]
 		} {
 		    trouble fatal "Directory name conflicts with filename."
 		    trouble fatal "Please remove or rename one of the following:"
 		    trouble fatal "    $base/$usr"
@@ -219,12 +220,10 @@
 
     proc IsSuperceded {base rcs usr isattic} {
 	::variable myignore
 
-	if {!$isattic}                   {return 0}
-
-	# use glob to account for case insensitive file systems
-	if {[lsearch [glob -nocomplain -tail -directory $base *] $usr,v] == -1} {return 0}
+	if {!$isattic}                     {return 0}
+	if {![fileexists_ci $base/$usr,v]} {return 0}
 
 	# We have a regular archive and an Attic archive refering to
 	# the same user visible file. Ignore the file in the Attic.
 	#
@@ -257,8 +256,9 @@
 	namespace import ::vc::fossil::import::cvs::repository
 	namespace import ::vc::fossil::import::cvs::state
 	namespace import ::vc::tools::trouble
 	namespace import ::vc::tools::log
+	namespace import ::vc::tools::misc::file*
 	log register collar
     }
 }