forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <san...@temme.net>
Subject [PATCH] Pass through ant exit code
Date Tue, 01 Jul 2003 18:19:52 GMT
Dear list,

I want to call forrest, from my own script, to generate a static site. When
ant fails, for whatever reason, its exit code is not captured and the
forrest scripts exits cleanly with exit code 0. The following patch fixes
this:

Index: src/resources/forrest-shbat/bin/forrest
===================================================================
RCS file: 
/home/cvspublic/xml-forrest/src/resources/forrest-shbat/bin/forrest,v
retrieving revision 1.9
diff -u -r1.9 forrest
--- src/resources/forrest-shbat/bin/forrest     3 Jan 2003 08:34:44 -0000
1.9
+++ src/resources/forrest-shbat/bin/forrest     1 Jul 2003 18:14:30 -0000
@@ -58,6 +58,7 @@
 echo "Apache Forrest.  Run 'forrest -projecthelp' to list options"
 echo
 "$FORREST_HOME/ant/bin/ant" -buildfile "$ANTFILE" -Dbasedir="$PROJECT_HOME"
-Dproject.home="$PROJECT_HOME" -Dforrest.home="$FORREST_DOT_HOME" -emacs $@
+RES=$?
 
 # ---- Restore Classpath
 unset CLASSPATH
@@ -69,4 +70,4 @@
 ANT_HOME="$OLD_ANT_HOME"
 export ANT_HOME
 
-
+exit $RES

I have attached the same in a file because I know my mailer likes to wrap
lines. 

Tested on my Powerbook and a FreeBSD machine running JDK 1.3.1, by compiling
a site, testing $? for '0' after the build, breaking an xml document in the
xdocs and verifying that the forrest script exits with result code '1' after
the ant build fails.

S.

-- 
sander@temme.net                          http://www.temme.net/sander/
   PGP Fingerprint: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF


Mime
View raw message