[tcljava-dev] patch for jacl and MacOS-X
Brought to you by:
mdejong
|
From: Maurice D. <di...@ma...> - 2002-05-13 19:11:56
|
Bonjour =E0 tous !
Here the patch for the Util.isMac() method.
It allows compiling jacl for MacOS-X (unix bsd like)
I tested (by hand) for the "file" and "exec" commands
They works partially : part of "file" subcommands are
not yet implemended and "exec" commands seems only accept
the basic feature (no &).
For the moment, this patch allows me to use
jacl the same way as for linux-ppc, so it's ok
for me.
As suggested by Shawn Boyce, I adapted the comment before
the method name (fell free to correct any typo!)
###########################
2002-05-07 Maurice Diamantini (or the real maintainer ???)=20
<di...@en...>
* src/jacl/tcl/lang/Util.java
Util.isMac() now return false if os is MacOS-X (which is an unix)
so that jacl commands like "exec" works.
###########################
Index: src/jacl/tcl/lang/Util.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/tcljava/tcljava/src/jacl/tcl/lang/Util.java,v
retrieving revision 1.9
diff -u -r1.9 Util.java
--- src/jacl/tcl/lang/Util.java 12 May 2001 23:13:16 -0000 1.9
+++ src/jacl/tcl/lang/Util.java 13 May 2002 06:51:21 -0000
@@ -1582,7 +1582,8 @@
*
* isMac --
*
- * Returns true if running on a Mac platform.
+ * Returns true if running on a Mac platform with MacOS-9 or =
earlier.
+ * MacOS-X and later will be treated as UNIX systems.
*
* Results:
* Returns a boolean.
@@ -1595,8 +1596,9 @@
final static boolean
isMac() {
- String os =3D System.getProperty("os.name");
- if (os.toLowerCase().startsWith("mac")) {
+ String os =3D System.getProperty("os.name").toLowerCase();
+ // if os is "Mac OS X": one should return false as for unix
+ if ( os.startsWith("mac") && !os.endsWith("x") ) {
return true;
}
return false;
####################################
|