You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

antRun.pl 1.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/perl
  2. #
  3. # Copyright (c) 2001,2003 The Apache Software Foundation. All rights
  4. # reserved.
  5. #
  6. #######################################################################
  7. #
  8. # antRun.pl
  9. #
  10. # wrapper script for invoking commands on a platform with Perl installed
  11. # this is akin to antRun.bat, and antRun the SH script
  12. #
  13. # created: 2001-10-18
  14. # author: Jeff Tulley jtulley@novell.com
  15. #######################################################################
  16. #be fussy about variables
  17. use strict;
  18. #turn warnings on during dev; generates a few spurious uninitialised var access warnings
  19. #use warnings;
  20. #and set $debug to 1 to turn on trace info (currently unused)
  21. my $debug=1;
  22. #######################################################################
  23. # change drive and directory to "%1"
  24. my $ANT_RUN_CMD = @ARGV[0];
  25. # assign current run command to "%2"
  26. chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
  27. if ($^O eq "NetWare") {
  28. # There is a bug in Perl 5 on NetWare, where chdir does not
  29. # do anything. On NetWare, the following path-prefixed form should
  30. # always work. (afaict)
  31. $ANT_RUN_CMD .= "/".@ARGV[1];
  32. }
  33. else {
  34. $ANT_RUN_CMD = @ARGV[1];
  35. }
  36. # dispose of the first two arguments, leaving only the command's args.
  37. shift;
  38. shift;
  39. # run the command
  40. my $returnValue = system $ANT_RUN_CMD, @ARGV;
  41. if ($returnValue eq 0) {
  42. exit 0;
  43. }
  44. else {
  45. # only 0 and 1 are widely recognized as exit values
  46. # so change the exit value to 1
  47. exit 1;
  48. }