This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
work around cygwin tcl 8.4 problem
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Tue, 11 Feb 2003 22:36:20 +0000 (GMT)
- Subject: work around cygwin tcl 8.4 problem
In the current Tcl 8.4 release for cygwin the "file copy" and "file
rename" operations are broken, see
http://sources.redhat.com/ml/insight/2003-q1/msg00079.html
The problem has already been fixed in cygwin tcl cvs, but there is no
updated package yet. This is a serious problem for eCos since libcdl
uses "file rename" internally. Currently it is impossible to
even generate a build tree.
This patch bypasses the problem. There is a risk - under certain
circumstances the rename operation really could fail and that failure
would no longer be detected. However the file being renamed is one
that has just been generated by libcdl, so we know that we have write
access to the relevant directory and hence the chances of a rename
failure are pretty slim.
Bart
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.
Index: build.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/libcdl/build.cxx,v
retrieving revision 1.7
diff -u -u -r1.7 build.cxx
--- build.cxx 21 Sep 2002 22:05:08 -0000 1.7
+++ build.cxx 11 Feb 2003 22:13:58 -0000
@@ -1992,7 +1992,7 @@
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 @@
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\
";