ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13047] New: - Support for <property environment> and <exec> on OS/400
Date Thu, 26 Sep 2002 21:04:47 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13047>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13047

Support for <property environment> and <exec> on OS/400

           Summary: Support for <property environment> and <exec> on OS/400
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: OS/400
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: brian_farrar@countrywide.com


The tags...
<property environment="osenv"/>
<exec executable="ls" />
do not work properly under OS/400.

The problem is that the output from the QSH commands is EBCDIC.  The output 
must be converted so it is appropriate for Java.

I have made the appropriate changes to the 1.5 release to accomplish this and 
request that these changes be reviewed and considered for placement into the 
product.

The files affected and the differences are attached.  I believe that there is 
also a bug in the org.apache.tools.ant.taskdefs.Execute.toString
(ByteArrayOutputStream bos) method.  It attempts to convert the byte array 
encoding for z/os, but does not actually return the encoded string.  This is a 
moot point because the encoding conversion belongs in a different place anyways 
(along with the os/400 encoding in the StreamPumper class.)

Source Differences:

diff -r ant/src/main/org/apache/tools/ant/taskdefs/Execute.java ant400/src/main/
org/apache/tools/ant/taskdefs/Execute.java
237a239,241
>         } else if (Os.isFamily("os/400")) {
>             String[] cmd = {"env"};
>             return cmd;
262,267d265
<         if (Os.isFamily("z/os")) {
<             try {
<                 bos.toString("Cp1047");
<             } catch (java.io.UnsupportedEncodingException e) {
<             }
<         }


diff -r ant/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java ant400/src/
main/org/apache/tools/ant/taskdefs/StreamPumper.java
59a60,61
> import java.io.ByteArrayOutputStream;
> import org.apache.tools.ant.taskdefs.condition.Os;
88a91,114
>     public static byte [] recode(byte [] buf, int length) {
>       byte [] rbuf = null;
>         if (Os.isFamily("z/os")) {
>             try {
>                 ByteArrayOutputStream bos = new ByteArrayOutputStream();
>                 bos.write(buf, 0, length);
>                 rbuf = (bos.toString("Cp1047")).getBytes();
>             } catch (java.io.UnsupportedEncodingException e) {
>             }
>         }
>         else if (Os.isFamily("os/400")) {
>             try {
>                 ByteArrayOutputStream bos = new ByteArrayOutputStream();
>                 bos.write(buf, 0, length);
>                 rbuf =  (bos.toString("Cp500")).getBytes();
>             } catch (java.io.UnsupportedEncodingException e) {
>             }
>         }
>       else
>       {
>            rbuf = buf;
>       }
>       return rbuf;
>     }
106c132,133
<                 os.write(buf, 0, length);
---
>               byte [] rbuf = recode(buf, length);
>                 os.write(rbuf, 0, length);




diff -r ant/src/main/org/apache/tools/ant/taskdefs/condition/Os.java ant400/src/
main/org/apache/tools/ant/taskdefs/condition/Os.java
102a103
>      *               <li>os/400</li>
216a218,219
>                 } else if (family.equals("os/400")) {
>                     isFamily = osName.indexOf("os/400") > -1;

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message