You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2008/07/10 17:57:56 UTC

svn commit: r675623 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/condition/Os.java

Author: bodewig
Date: Thu Jul 10 08:57:56 2008
New Revision: 675623

URL: http://svn.apache.org/viewvc?rev=675623&view=rev
Log:
properly detect MacOS X when running inside OpenJDK.  Bugzilla Issue 44889

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Os.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=675623&r1=675622&r2=675623&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Jul 10 08:57:56 2008
@@ -106,6 +106,10 @@
  * The <type> resource selector has had an "any" type added for better
    configurability.
 
+ * Ant should detect the OS as both a Mac and a Unix system when
+   running on OpenJDK.
+   Bugzilla Report 44889.
+
 Changes from Ant 1.7.0 TO Ant 1.7.1
 =============================================
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Os.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Os.java?rev=675623&r1=675622&r2=675623&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Os.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Os.java Thu Jul 10 08:57:56 2008
@@ -101,6 +101,13 @@
     public static final String FAMILY_OS400 = "os/400";
 
     /**
+     * OpenJDK is reported to call MacOS X "Darwin"
+     * @see https://issues.apache.org/bugzilla/show_bug.cgi?id=44889
+     * @see https://issues.apache.org/jira/browse/HADOOP-3318
+     */
+    private static final String DARWIN = "darwin";
+
+    /**
      * Default constructor
      *
      */
@@ -276,13 +283,15 @@
                 } else if (family.equals(FAMILY_DOS)) {
                     isFamily = PATH_SEP.equals(";") && !isFamily(FAMILY_NETWARE);
                 } else if (family.equals(FAMILY_MAC)) {
-                    isFamily = OS_NAME.indexOf(FAMILY_MAC) > -1;
+                    isFamily = OS_NAME.indexOf(FAMILY_MAC) > -1
+                        || OS_NAME.indexOf(DARWIN) > -1;
                 } else if (family.equals(FAMILY_TANDEM)) {
                     isFamily = OS_NAME.indexOf("nonstop_kernel") > -1;
                 } else if (family.equals(FAMILY_UNIX)) {
                     isFamily = PATH_SEP.equals(":")
                         && !isFamily(FAMILY_VMS)
-                        && (!isFamily(FAMILY_MAC) || OS_NAME.endsWith("x"));
+                        && (!isFamily(FAMILY_MAC) || OS_NAME.endsWith("x")
+                            || OS_NAME.indexOf(DARWIN) > -1);
                 } else if (family.equals(FAMILY_ZOS)) {
                     isFamily = OS_NAME.indexOf(FAMILY_ZOS) > -1
                         || OS_NAME.indexOf("os/390") > -1;