bodewig     01/03/16 02:17:32

  Modified:    src/script runant.pl
  Log:
  pass through the exit value from Ant
  
  PR: 314
  Submitted by: [EMAIL PROTECTED] (Sigurd Knippenberg)
  
  Remove tabs.
  
  Change /usr/local/bin/perl to /usr/bin/perl. All other Perl scripts on
  my box assumed there was at least a symlink to Perl in /usr/bin - and
  Perl recommends to put one there when you install it.
  
  Revision  Changes    Path
  1.2       +44 -35    jakarta-ant/src/script/runant.pl
  
  Index: runant.pl
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/script/runant.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- runant.pl 2001/01/23 05:10:39     1.1
  +++ runant.pl 2001/03/16 10:17:30     1.2
  @@ -1,4 +1,4 @@
  -#!/usr/local/bin/perl
  +#!/usr/bin/perl
   #######################################################################
   #
   # runant.pl
  @@ -44,9 +44,9 @@
   
   my $HOME = $ENV{ANT_HOME};
   if ($HOME eq "")
  -     {
  +        {
       die "\n\nANT_HOME *MUST* be set!\n\n";
  -     }
  +        }
   
   my $JAVACMD = $ENV{JAVACMD};
   $JAVACMD = "java" if $JAVACMD eq "";
  @@ -56,17 +56,17 @@
   #here I assume ":" 'cept on win32 and dos. Add extra tests here as needed.
   my $s=":";
   if(($^O eq "MSWin32") || ($^O eq "dos"))
  -     {
  -     $s=";";
  -     }
  +        {
  +        $s=";";
  +        }
   
   #build up standard classpath
   my $localpath=$ENV{CLASSPATH};
   if ($localpath eq "")
  -     {
  -     print "warning: no initial classpath\n" if ($debug);
  -     $localpath="";
  -     }
  +        {
  +        print "warning: no initial classpath\n" if ($debug);
  +        $localpath="";
  +        }
   
   #add jar files. I am sure there is a perl one liner to do this.
   my $jarpattern="$HOME/lib/*.jar";
  @@ -74,39 +74,39 @@
   print "[EMAIL PROTECTED]" if ($debug);
   my $jar;
   foreach $jar (@jarfiles )
  -     {
  -     $localpath.="$s$jar";
  -     }
  +        {
  +        $localpath.="$s$jar";
  +        }
   
   #if Java home is defined, look for tools.jar & classes.zip and add to 
classpath
   my $JAVA_HOME = $ENV{JAVA_HOME};
   if ($JAVA_HOME ne "")
  -     {
  -     my $tools="$JAVA_HOME/lib/tools.jar";
  -     if (-e "$tools")
  -             {
  -             $localpath .= "$s$tools";
  -             }
  -     my $classes="$JAVA_HOME/lib/classes.zip";
  -     if (-e $classes)
  -             {
  -             $localpath .= "$s$classes";
  -             }
  -     }
  +        {
  +        my $tools="$JAVA_HOME/lib/tools.jar";
  +        if (-e "$tools")
  +                {
  +                $localpath .= "$s$tools";
  +                }
  +        my $classes="$JAVA_HOME/lib/classes.zip";
  +        if (-e $classes)
  +                {
  +                $localpath .= "$s$classes";
  +                }
  +        }
   else
  -     {
  +        {
       print "\n\nWarning: JAVA_HOME environment variable is not set.\n".
  -             "If the build fails because sun.* classes could not be found\n".
  -             "you will need to set the JAVA_HOME environment variable\n".
  -             "to the installation directory of java\n";
  -     }
  +                "If the build fails because sun.* classes could not be 
found\n".
  +                "you will need to set the JAVA_HOME environment variable\n".
  +                "to the installation directory of java\n";
  +        }
   
   #jikes
   my @ANT_OPTS=split $ENV{ANT_OPTS};
   if($ENV{JIKESPATH} ne "")
  -     {
  -     push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
  -     }
  +        {
  +        push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
  +        }
   
   #construct arguments to java
   
  @@ -117,6 +117,15 @@
   push @ARGS, @ARGV;
   
   print "\n $JAVACMD @ARGS\n\n" if ($debug);
  -system $JAVACMD, @ARGS;
   
  -
  +my $returnValue = system $JAVACMD, @ARGS;
  +if ($returnValue eq 0)
  +        {
  +        exit 0;
  +        }
  +else
  +        {
  +        # only 0 and 1 are widely recognized as exit values
  +        # so change the exit value to 1
  +        exit 1;
  +        }
  
  
  

Reply via email to