From dlr@finemaltcoding.com Fri Jul 21 00:58:00 2000 Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 42971 invoked from network); 21 Jul 2000 00:58:00 -0000 Received: from c855439-a.pinol1.sfba.home.com (HELO despot.finemaltcoding.com) (24.14.147.74) by locus.apache.org with SMTP; 21 Jul 2000 00:58:00 -0000 Received: from finemaltcoding.com (localhost.localdomain [127.0.0.1]) by despot.finemaltcoding.com (8.9.3/8.9.3) with ESMTP id RAA07055 for ; Thu, 20 Jul 2000 17:58:04 -0700 Sender: dlr@finemaltcoding.com Message-ID: <3977A01C.B5DB5866@finemaltcoding.com> Date: Thu, 20 Jul 2000 17:58:04 -0700 From: "Daniel L. Rall" Organization: "Fine Malt Coding" X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.17pre10 i686) X-Accept-Language: en MIME-Version: 1.0 To: Ant Development Subject: PATCH: buildAnt Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Added some precondition checks for environment variables. Index: buildAnt =================================================================== RCS file: /home/cvspublic/jakarta-ant/buildAnt,v retrieving revision 1.1 diff -u -u -r1.1 buildAnt --- buildAnt 2000/04/27 20:26:10 1.1 +++ buildAnt 2000/07/21 00:54:57 @@ -25,9 +25,33 @@ # - To execute the "install" target, you must be running on the Jakarta # server, as part of group "jakarta". # -# Author: Craig R. McClanahan -# Version: $Revision: 1.1 $ $Date: 2000/04/27 20:26:10 $ +# Authors: Craig R. McClanahan +# Daniel Rall +# Version: $Id: $ # ----------------------------------------------------------------------------- -. ~/.antrc -ant -buildfile buildAnt.xml -Djaxp.home=$JAXP_HOME "$@" +# Get any user-specific Ant configuration. +ANT_RC=~/.antrc +if [ -r ${ANT_RC} ]; then . ${ANT_RC}; fi + +# Checks for the existance of the specified environment variables. If one of +# the listed variables is not found, exits with error message and status. +function check_env_vars() +{ + failed='' + for var in ${@}; do + var="\$${var}" + if [ -z "`eval echo -n ${var}`" ]; then + echo "$0: set your ${var} environment variable" + failed='t' + fi + done + if [ ${failed} ]; then exit 1; fi +} + +# Assure that the environment is setup properly. +check_env_vars JAXP_HOME ANT_HOME + +# Update and build Ant. +ant -buildfile buildAnt.xml -Djaxp.home=${JAXP_HOME} "$@" +exit 0 -- Daniel Rall