You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Henri Gomez <hg...@apache.org> on 2002/11/07 18:15:05 UTC
MacOS/X
Till we're speaking of symlink, how does macos/x report itself ?
as mac or unix ?
Regards
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MacOS/X
Posted by Henri Gomez <hg...@apache.org>.
Stefan Bodewig wrote:
> On Fri, 08 Nov 2002, Henri Gomez <hg...@apache.org> wrote:
>
>
>>The path separator on AS/400 is : so symlinks should works on it ?
>
>
> Without any patches, yes.
Great !!!
What I like with these 2 threads, is that we speak of iSeries under
MacOS/X subject and Linux/test under iSeries support ;)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MacOS/X
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 08 Nov 2002, Henri Gomez <hg...@apache.org> wrote:
> The path separator on AS/400 is : so symlinks should works on it ?
Without any patches, yes.
Stefan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MacOS/X
Posted by Henri Gomez <hg...@apache.org>.
Stefan Bodewig wrote:
> On Fri, 08 Nov 2002, Henri Gomez <hg...@apache.org> wrote:
>
>
>>What about adding the same for as/400 which is very similar to unix
>>on it's IFS file system (just to avoid making duplicate checks for
>>chmod/chgrp/symlinks....)
>
>
> If the path separator is : on AS/400, it should already return true in
> Os.isFamily("unix"). If the path separator is not :, you better don't
> tell Ant it was a Unix like system.
The path separator on AS/400 is : so symlinks should works on it ?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MacOS/X
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 08 Nov 2002, Henri Gomez <hg...@apache.org> wrote:
> What about adding the same for as/400 which is very similar to unix
> on it's IFS file system (just to avoid making duplicate checks for
> chmod/chgrp/symlinks....)
If the path separator is : on AS/400, it should already return true in
Os.isFamily("unix"). If the path separator is not :, you better don't
tell Ant it was a Unix like system.
Stefan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MacOS/X
Posted by Henri Gomez <hg...@apache.org>.
Paul Cantrell wrote:
> I double-checked what Stefan said; he is indeed correct. The following
> is on OS X 10.2.1:
>
> $ ant -version
> Apache Ant version 1.5 compiled on July 9 2002
> $ bsh -cp /usr/local/java/jakarta/jakarta-ant/lib/ant.jar
> BeanShell 1.2b42 - by Pat Niemeyer
> bsh % show();
> <true>
> bsh % org.apache.tools.ant.taskdefs.condition.Os.isFamily("mac");
> <true>
> bsh % org.apache.tools.ant.taskdefs.condition.Os.isFamily("unix");
> <true>
> bsh % System.getProperty("os.name");
> <Mac OS X>
>
> I know that's not the most up-to-date version of Ant (or BeanShell, for
> that matter), but I doubt that the results have changed.
>
> Paul
What about adding the same for as/400 which is very similar to unix
on it's IFS file system (just to avoid making duplicate checks for
chmod/chgrp/symlinks....)
public static boolean isOs(String family, String name, String arch,
String version) {
boolean retValue = false;
if (family != null || name != null || arch != null
|| version != null) {
boolean isFamily = true;
boolean isName = true;
boolean isArch = true;
boolean isVersion = true;
if (family != null) {
if (family.equals("windows")) {
isFamily = osName.indexOf("windows") > -1;
} else if (family.equals("os/2")) {
isFamily = osName.indexOf("os/2") > -1;
} else if (family.equals("netware")) {
isFamily = osName.indexOf("netware") > -1;
} else if (family.equals("dos")) {
isFamily = pathSep.equals(";") && !isFamily("netware");
} else if (family.equals("mac")) {
isFamily = osName.indexOf("mac") > -1;
} else if (family.equals("unix")) {
if (osName.indexOf("mac") > -1)
isFamily = pathSep.equals(":")
&& (!isFamily("mac") ||
osName.endsWith("x"));
else
isFamily = (osName.indexOf("as/400") > -1);
} else if (family.equals("win9x")) {
isFamily = isFamily("windows") &&
!(osName.indexOf("nt") >= 0 ||
osName.indexOf("2000") >= 0 ||
osName.indexOf("xp") >= 0);
} else if (family.equals("z/os")) {
isFamily = osName.indexOf("z/os") > -1
|| osName.indexOf("os/390") > -1;
} else if (family.equals("os/400")) {
isFamily = osName.indexOf("os/400") > -1;
} else {
throw new BuildException(
"Don\'t know how to detect os family \""
+ family + "\"");
}
}
if (name != null) {
isName = name.equals(osName);
}
if (arch != null) {
isArch = arch.equals(osArch);
}
if (version != null) {
isVersion = version.equals(osVersion);
}
retValue = isFamily && isName && isArch && isVersion;
}
return retValue;
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MacOS/X
Posted by Paul Cantrell <ca...@pobox.com>.
I double-checked what Stefan said; he is indeed correct. The following
is on OS X 10.2.1:
$ ant -version
Apache Ant version 1.5 compiled on July 9 2002
$ bsh -cp /usr/local/java/jakarta/jakarta-ant/lib/ant.jar
BeanShell 1.2b42 - by Pat Niemeyer
bsh % show();
<true>
bsh % org.apache.tools.ant.taskdefs.condition.Os.isFamily("mac");
<true>
bsh % org.apache.tools.ant.taskdefs.condition.Os.isFamily("unix");
<true>
bsh % System.getProperty("os.name");
<Mac OS X>
I know that's not the most up-to-date version of Ant (or BeanShell, for
that matter), but I doubt that the results have changed.
Paul
On Friday, November 8, 2002, at 01:56 AM, Stefan Bodewig wrote:
> On Thu, 07 Nov 2002, Henri Gomez <hg...@apache.org> wrote:
>
>> Till we're speaking of symlink, how does macos/x report itself ?
>
> Dunno exactly (would have to boot my iBook to be sure, let me know if
> you need the exact details). I know that the symlink test passes (and
> does something) on that machine 8-)
>
>> as mac or unix ?
>
> I think os.name is something like "MacOS X".
>
> Os.isFamily("mac") and Os.isFamily("unix") will both return true.
>
> Stefan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MacOS/X
Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 07 Nov 2002, Henri Gomez <hg...@apache.org> wrote:
> Till we're speaking of symlink, how does macos/x report itself ?
Dunno exactly (would have to boot my iBook to be sure, let me know if
you need the exact details). I know that the symlink test passes (and
does something) on that machine 8-)
> as mac or unix ?
I think os.name is something like "MacOS X".
Os.isFamily("mac") and Os.isFamily("unix") will both return true.
Stefan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>