From 8e67850ad66cf55fb693bbe2375b64ce96a38459 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 27 Sep 2002 08:18:51 +0000 Subject: [PATCH] Add and support for OS/400. PR: 13047 Submitted by: Brian Farrar git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273380 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 7 +++++++ docs/manual/CoreTasks/conditions.html | 1 + src/main/org/apache/tools/ant/taskdefs/Execute.java | 9 +++++++-- src/main/org/apache/tools/ant/taskdefs/condition/Os.java | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 36fb9b1d5..86e69357e 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -37,6 +37,11 @@ Fixed bugs: * created an empty junit-noframes.html if no format had been specified. +* would remove more than it should if the file name + contained more than one dot. + +* now works on OS/400. + Other changes: -------------- @@ -81,6 +86,8 @@ Other changes: * The SOS and VSS tasks will no longer unconditionally prepend a $ to vsspath or projectpath. +* OS/400 now gets detected by the os condition. + Changes from Ant 1.5beta3 to Ant 1.5 ==================================== diff --git a/docs/manual/CoreTasks/conditions.html b/docs/manual/CoreTasks/conditions.html index 78a68db1f..6d0bc0124 100644 --- a/docs/manual/CoreTasks/conditions.html +++ b/docs/manual/CoreTasks/conditions.html @@ -94,6 +94,7 @@ the tests succeed.
  • os/2 (for OS/2)
  • win9x for Microsoft Windows 95 and 98
  • z/os for z/OS and OS/390
  • +
  • os/400 for OS/400
  • equals

    diff --git a/src/main/org/apache/tools/ant/taskdefs/Execute.java b/src/main/org/apache/tools/ant/taskdefs/Execute.java index 8359cc07d..1efe9f06b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Execute.java +++ b/src/main/org/apache/tools/ant/taskdefs/Execute.java @@ -238,7 +238,7 @@ public class Execute { // Alternatively one could use: /bin/sh -c env String[] cmd = {"/usr/bin/env"}; return cmd; - } else if (Os.isFamily("netware")) { + } else if (Os.isFamily("netware") || Os.isFamily("os/400")) { String[] cmd = {"env"}; return cmd; } else { @@ -259,7 +259,12 @@ public class Execute { public static String toString(ByteArrayOutputStream bos) { if (Os.isFamily("z/os")) { try { - bos.toString("Cp1047"); + return bos.toString("Cp1047"); + } catch (java.io.UnsupportedEncodingException e) { + } + } else if (Os.isFamily("os/400")) { + try { + return bos.toString("Cp500"); } catch (java.io.UnsupportedEncodingException e) { } } diff --git a/src/main/org/apache/tools/ant/taskdefs/condition/Os.java b/src/main/org/apache/tools/ant/taskdefs/condition/Os.java index 2e9aee499..b21c9c0b3 100644 --- a/src/main/org/apache/tools/ant/taskdefs/condition/Os.java +++ b/src/main/org/apache/tools/ant/taskdefs/condition/Os.java @@ -99,6 +99,7 @@ public class Os implements Condition { *
  • windows
  • *
  • win9x
  • *
  • z/os
  • + *
  • os/400
  • * */ public void setFamily(String f) {family = f.toLowerCase(Locale.US);} @@ -224,6 +225,8 @@ public class Os implements Condition { } 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 \""