antRun.pl revision 0
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# Copyright 2001,2003-2004 The Apache Software Foundation
9541e63de5a0e8de81d8f741de795a458ce0cbdeLaszlo Hordos# Licensed under the Apache License, Version 2.0 (the "License");
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# you may not use this file except in compliance with the License.
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# You may obtain a copy of the License at
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# Unless required by applicable law or agreed to in writing, software
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# distributed under the License is distributed on an "AS IS" BASIS,
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# See the License for the specific language governing permissions and
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# limitations under the License.
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos#######################################################################
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# wrapper script for invoking commands on a platform with Perl installed
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# this is akin to antRun.bat, and antRun the SH script
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# created: 2001-10-18
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos# author: Jeff Tulley jtulley@novell.com
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan#######################################################################
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan#be fussy about variables
89770737c72ebabf6e5a7610f398eeffa653b05fBrendan Mmiller#turn warnings on during dev; generates a few spurious uninitialised var access warnings
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan#use warnings;
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan#and set $debug to 1 to turn on trace info (currently unused)
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos#######################################################################
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos# change drive and directory to "%1"
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos# assign current run command to "%2"
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordoschdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordosif ($^O eq "NetWare") {
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos # There is a bug in Perl 5 on NetWare, where chdir does not
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos # do anything. On NetWare, the following path-prefixed form should
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos # always work. (afaict)
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos# dispose of the first two arguments, leaving only the command's args.
29b501990ace032d7b959ac1afd1ec75533e8baePaul Bryan# run the command
bf3adaa7953ef4d249670fa82f2a0f7f17ee4b7bLaszlo Hordos # only 0 and 1 are widely recognized as exit values
bf3adaa7953ef4d249670fa82f2a0f7f17ee4b7bLaszlo Hordos # so change the exit value to 1