At 10:07 12/4/01 +1000, Conor MacNeill wrote: >Hmmm, > >Not sure I like the use of floats in this. Perhaps we should be parsing out >major and minor version numbers as ints.
Probably - does anyone with access to Mac know if they use more than two levels (ie 1.2.3 or something similar) ???? >> -----Original Message----- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> Sent: Thursday, 12 April 2001 8:44 AM >> To: [EMAIL PROTECTED] >> Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs >> Execute.java >> >> >> donaldp 01/04/11 15:44:20 >> >> Modified: src/main/org/apache/tools/ant/taskdefs Execute.java >> Log: >> Updated ant to get environment from MacOS X >> >> Submitted By: Archit Shah <[EMAIL PROTECTED]> >> >> Revision Changes Path >> 1.15 +12 -0 >> jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java >> >> Index: Execute.java >> =================================================================== >> RCS file: >> /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execu >> te.java,v >> retrieving revision 1.14 >> retrieving revision 1.15 >> diff -u -r1.14 -r1.15 >> --- Execute.java 2001/02/18 13:44:42 1.14 >> +++ Execute.java 2001/04/11 22:44:19 1.15 >> @@ -179,6 +179,18 @@ >> String osname = System.getProperty("os.name").toLowerCase(); >> if ( osname.indexOf("mac os") >= 0 ) { >> // Mac >> + // Determine if we are running under OS X >> + try { >> + float version = >> Float.parseFloat(System.getProperty("os.version")); >> + if (version >= 10.0) { >> + // OS X - just line UNIX >> + String[] cmd = {"/usr/bin/env"}; >> + return cmd; >> + } >> + } catch (NumberFormatException e) { >> + // fall through to OS 9 >> + } >> + // OS 9 and previous >> // TODO: I have no idea how to get it, someone must fix it >> String[] cmd = null; >> return cmd; >> >> >> >> > > Cheers, Pete *-----------------------------------------------------* | "Faced with the choice between changing one's mind, | | and proving that there is no need to do so - almost | | everyone gets busy on the proof." | | - John Kenneth Galbraith | *-----------------------------------------------------*
