0N/A#!/usr/bin/perl
0N/A#
809N/A# Licensed to the Apache Software Foundation (ASF) under one or more
809N/A# contributor license agreements. See the NOTICE file distributed with
809N/A# this work for additional information regarding copyright ownership.
809N/A# The ASF licenses this file to You under the Apache License, Version 2.0
809N/A# (the "License"); you may not use this file except in compliance with
809N/A# the License. You may obtain a copy of the License at
0N/A#
0N/A# http://www.apache.org/licenses/LICENSE-2.0
0N/A#
0N/A# Unless required by applicable law or agreed to in writing, software
0N/A# distributed under the License is distributed on an "AS IS" BASIS,
0N/A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0N/A# See the License for the specific language governing permissions and
0N/A# limitations under the License.
0N/A#
0N/A#######################################################################
0N/A#
0N/A# antRun.pl
0N/A#
0N/A# wrapper script for invoking commands on a platform with Perl installed
0N/A# this is akin to antRun.bat, and antRun the SH script
0N/A#
0N/A# created: 2001-10-18
0N/A# author: Jeff Tulley jtulley@novell.com
0N/A#######################################################################
0N/A#be fussy about variables
0N/Ause strict;
0N/A
0N/A#turn warnings on during dev; generates a few spurious uninitialised var access warnings
0N/A#use warnings;
0N/A
0N/A#and set $debug to 1 to turn on trace info (currently unused)
0N/Amy $debug=1;
0N/A
0N/A#######################################################################
0N/A# change drive and directory to "%1"
0N/Amy $ANT_RUN_CMD = @ARGV[0];
0N/A
0N/A# assign current run command to "%2"
0N/Achdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
0N/Aif ($^O eq "NetWare") {
0N/A # There is a bug in Perl 5 on NetWare, where chdir does not
0N/A # do anything. On NetWare, the following path-prefixed form should
0N/A # always work. (afaict)
0N/A $ANT_RUN_CMD .= "/".@ARGV[1];
0N/A}
0N/Aelse {
0N/A $ANT_RUN_CMD = @ARGV[1];
0N/A}
0N/A
0N/A# dispose of the first two arguments, leaving only the command's args.
0N/Ashift;
0N/Ashift;
0N/A
0N/A# run the command
0N/Amy $returnValue = system $ANT_RUN_CMD, @ARGV;
0N/Aif ($returnValue eq 0) {
0N/A exit 0;
0N/A}
0N/Aelse {
0N/A # only 0 and 1 are widely recognized as exit values
0N/A # so change the exit value to 1
0N/A exit 1;
0N/A}