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 8702] New: - runant.pl needs some NetWare specific code
Date Wed, 01 May 2002 16:18:51 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=8702>.
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=8702

runant.pl needs some NetWare specific code

           Summary: runant.pl needs some NetWare specific code
           Product: Ant
           Version: 1.5Beta1
          Platform: Other
        OS/Version: Netware
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Wrapper scripts
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: jtulley@novell.com


One of my submissions for Ant on NetWare was missed or I missed submitting it.  
runant.pl needs some NetWare-specific code.  It is a major thing for NetWare, 
since it will be the way in which to run Ant on NetWare.  The patch does two 
things:  1) sets the path separator to ";" on NetWare (the same as on dos, 
cygwin, and MSWin32)    2) Deals with some command-line length limitations on 
NetWare by leaving the classpath unexpanded.  If the classpath is passed in as 
simply a variable, Java will expand it, and the final total length can be 
greater than 512 characters.  With a perl-based expansion of the classpath, 
this limit is quite often surpassed, making the command fail.

Here is the diff -u patch:

Index: runant.pl
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/script/runant.pl,v
retrieving revision 1.4
diff -u -r1.4 runant.pl
--- runant.pl	10 Jan 2002 14:18:42 -0000	1.4
+++ runant.pl	30 Apr 2002 23:40:01 -0000
@@ -55,11 +55,18 @@
 my $JAVACMD = $ENV{JAVACMD};
 $JAVACMD = "java" if $JAVACMD eq "";
 
+my $onnetware = 0;
+if ($^O eq "NetWare")
+{
+  $onnetware = 1;
+}
+
 #ISSUE: what java wants to split up classpath varies from platform to platform 
 #and perl is not too hot at hinting which box it is on.
-#here I assume ":" 'cept on win32 and dos. Add extra tests here as needed.
+#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as 
needed.
 my $s=":";
-if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin"))
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin") ||
+   ($onnetware == 1))
         {
         $s=";";
         }
@@ -71,6 +78,13 @@
         print "warning: no initial classpath\n" if ($debug);
         $localpath="";
         }
+if ($onnetware == 1)
+{
+# avoid building a command line bigger than 512 characters - make localpath
+# only include the "extra" stuff, and add in the system classpath as an 
expanded
+# variable. 
+  $localpath="";
+} 
 
 #add jar files. I am sure there is a perl one liner to do this.
 my $jarpattern="$HOME/lib/*.jar";
@@ -117,7 +131,18 @@
 
 #construct arguments to java
 my @ARGS;
-push @ARGS, "-classpath", "$localpath", "-Dant.home=$HOME";
+if ($onnetware == 1)
+{
+# make classpath literally $CLASSPATH; and then the contents of $localpath
+# this is to avoid pushing us over the 512 character limit
+# even skip the ; - that is already in $localpath
+  push @ARGS, "-classpath", "\$CLASSPATH$localpath";
+}
+else
+{
+  push @ARGS, "-classpath", "$localpath";
+}
+push @ARGS, "-Dant.home=$HOME";
 push @ARGS, @ANT_OPTS;
 push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS;
 push @ARGS, @ARGV;

--
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