ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dave...@shootinggallery.com (David Makower)
Subject Re: [Patch] Fix for Chmod on MacOS X & build location
Date Tue, 17 Oct 2000 15:09:38 GMT
Seems to me you probably want to consider MacOS X Server a valid UNIX 
as well.  Don't know what the value of "os.name" comes out to on 
MacOS X Server, but maybe this will work better:

      protected boolean isValidOs() {
          // XXX if OS=unix
          return System.getProperty("path.separator").equals(":") &&
             !(System.getProperty("os.name").startsWith("Mac") &&
               (System.getProperty("os.name").indexOf("X") < 0)) &&
              super.isValidOs();
      }

And perhaps this verbose version is more readable (or perhaps not):

      protected boolean isValidOs() {
          String osName = System.getProperty("os.name");
          String pathSeparator = System.getProperty("path.separator");

          boolean hasUnixPathSeparator =
              System.getProperty("path.separator").equals(":");

          boolean classicMacOS =
              osName.startsWith("Mac") && (osName.indexOf("X") < 0);

          return hasUnixPathSeparator && ! classicMacOS &&
              super.isValidOs();
      }

>Correcting my patching mistake, here is the same patch in unified format:
>
>
>Index: src/main/org/apache/tools/ant/taskdefs/Chmod.java
>===================================================================
>RCS file: 
>/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java,v
>retrieving revision 1.8
>diff -u -r1.8 Chmod.java
>--- src/main/org/apache/tools/ant/taskdefs/Chmod.java	2000/09/07 
>09:50:54	1.8
>+++ src/main/org/apache/tools/ant/taskdefs/Chmod.java	2000/10/17 11:49:14
>@@ -169,7 +169,7 @@
>      protected boolean isValidOs() {
>          // XXX if OS=unix
>          return System.getProperty("path.separator").equals(":") &&
>-            !System.getProperty("os.name").startsWith("Mac") &&
>+            !(System.getProperty("os.name").startsWith("Mac") && 
>!System.getProperty("os.name").endsWith("X")) &&
>              super.isValidOs();
>      }
>  }
>
>
>
>On Tuesday, October 17, 2000, at 12:11 PM, Stuart Roebuck wrote:
>
>>  Building Apache-James I've just noticed that the OS check on Chmod 
>>doesn't identify MacOS
>>  X as a valid Unix.  Here's a patch:
>> 
>
>-------------------------------------------------------------------------
>Stuart Roebuck, BSc, MBA        Tel.: 0131 228 4853 / Fax.: 0870 054 8322
>Managing Director                       Alpha Numeric Pager: 07654 588898
>ADOLOS                                             http://www.adolos.com/

-- 
+-------------------------------------------------------------------+
| Dave Makower                        <davemak@shootinggallery.com> |
| Director of Engineering                                           |
+--------------------------------+----------------------------------+
|  Shooting Gallery Interactive  |  tel: (212) 905-2200 x155        |
|  609 Greenwich St., 9th Floor  |  fax: (212) 905-2249             |
|  New York, NY  10014           |  http://www.shootinggallery.com/ |
+--------------------------------+----------------------------------+

Mime
View raw message