changeset 588:4c4d0af923f7

Work around problem with current cygwin tcl 8.4 release
author bartv
date Tue, 11 Feb 2003 22:38:20 +0000
parents 98fc8f919755
children 9c80c9229b84
files host/libcdl/ChangeLog host/libcdl/build.cxx
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/host/libcdl/ChangeLog
+++ b/host/libcdl/ChangeLog
@@ -1,3 +1,9 @@
+2003-02-11  Bart Veer  <bartv@ecoscentric.com>
+
+	* build.cxx (compare_and_copy):
+	Work around problem with cygwin tclsh84 - "file rename" may
+	spuriously report failure.
+
 2003-02-03  John Dallaway  <jld@ecoscentric.com>
 
 	* cdl.dsp: Call tclsh rather than cygtclsh80 in custom build rule.
--- a/host/libcdl/build.cxx
+++ b/host/libcdl/build.cxx
@@ -10,7 +10,7 @@
 //####COPYRIGHTBEGIN####
 //                                                                          
 // ----------------------------------------------------------------------------
-// Copyright (C) 2002 Bart Veer
+// Copyright (C) 2002, 2003 Bart Veer
 // Copyright (C) 1999, 2000, 2001 Red Hat, Inc.
 //
 // This file is part of the eCos host tools.
@@ -1992,7 +1992,7 @@ compare_and_copy(CdlInterpreter interp, 
 
     static char compare_and_copy_script[] = "\
 if {[file exists \"$::cdl_compare_and_copy_file2\"] == 0} {                                   \n\
-    file rename -- \"$::cdl_compare_and_copy_file1\" \"$::cdl_compare_and_copy_file2\"        \n\
+    catch { file rename -- $::cdl_compare_and_copy_file1 $::cdl_compare_and_copy_file2}       \n\
     return                                                                                    \n\
 }                                                                                             \n\
 set fd [open \"$::cdl_compare_and_copy_file1\" r]                                             \n\
@@ -2004,7 +2004,7 @@ close $fd                               
 if {$data1 == $data2} {                                                                       \n\
     file delete \"$::cdl_compare_and_copy_file1\"                                             \n\
 } else {                                                                                      \n\
-    file rename -force -- \"$::cdl_compare_and_copy_file1\" \"$::cdl_compare_and_copy_file2\" \n\
+    catch { file rename -force -- $::cdl_compare_and_copy_file1 $::cdl_compare_and_copy_file2 } \n\
 }                                                                                             \n\
 ";