Author: jfrederic.clere(a)jboss.com
Date: 2007-12-17 09:19:28 -0500 (Mon, 17 Dec 2007)
New Revision: 1226
Modified:
trunk/build/unix/build.sh
trunk/build/unix/buildbin.rhel-httpd.sh
Log:
Improve the handling of return codes.
Modified: trunk/build/unix/build.sh
===================================================================
--- trunk/build/unix/build.sh 2007-12-17 14:18:16 UTC (rev 1225)
+++ trunk/build/unix/build.sh 2007-12-17 14:19:28 UTC (rev 1226)
@@ -327,14 +327,14 @@
shift
echo "Running ${basedir}/$run $@"
${basedir}/$run $@
- if [ $? -eq 2 ]; then
+ ret=$?
+ if [ ${ret} -eq 2 ]; then
echo "$run not supported on this platform"
- exit 0
+ return 0
+ elif [ ${ret} -ne 0 ]; then
+ echo "$run returned ${ret}"
+ return 1
fi
- if [ $? -eq 1 ]; then
- echo "$run failed"
- exit 1
- fi
}
# Download the sources. It guess how to do it.
@@ -682,41 +682,45 @@
dst_dir=$1
if $has_zlib; then
- buildzlib srclib/zlib-${zlib_version} false
+ buildzlib srclib/zlib-${zlib_version} false || return 1
if $has_static ; then
- builzlib srclib/zlib-${zlib_version} true
+ builzlib srclib/zlib-${zlib_version} true || return 1
fi
fi
# apr-util has a --with-openssl=DIR so we must be build openssl before apu.
ls srclib | grep openssl >/dev/null
if [ $? -eq 0 ]; then
- buildopenssl srclib/openssl-${ssl_version} false
+ buildopenssl srclib/openssl-${ssl_version} false || return 1
if $has_static ; then
- buildopenssl srclib/openssl-${ssl_version} false
+ buildopenssl srclib/openssl-${ssl_version} false || return 1
fi
fi
if $has_apr; then
- buildapr srclib/apr-${apr_version} false
+ buildapr srclib/apr-${apr_version} false || return 1
if $has_static ; then
- buildapr srclib/apr-${apr_version} true
+ buildapr srclib/apr-${apr_version} true || return 1
fi
if $build_api; then
- buildapi srclib/apr-iconv-${api_version} false
+ buildapi srclib/apr-iconv-${api_version} false || return 1
if $has_static ; then
- buildapi srclib/apr-iconv-${api_version} true
+ buildapi srclib/apr-iconv-${api_version} true || return 1
fi
fi
if $has_apu; then
- buildapu srclib/apr-util-${apu_version} false
+ buildapu srclib/apr-util-${apu_version} false || return 1
if $has_static ; then
- buildapu srclib/apr-util-${apu_version} true
+ buildapu srclib/apr-util-${apu_version} true || return 1
fi
fi
fi
# Do our specific part.
override ${package_src_dir}/buildbin.${PACKAGE}.sh ${build_common_dir}
${package_dist_dir} ${package_output_dir} $has_openssl $has_static
+ if [ $? -ne 0 ]; then
+ echo "${package_src_dir}/buildbin.${PACKAGE}.sh failed"
+ return 1
+ fi
# General part
cp JBossORG-EULA.txt ${package_output_dir}
@@ -724,10 +728,18 @@
# mod_jk
if $has_jk; then
override ${package_src_dir}/buildbin.asf-jk.sh ${build_common_dir}
${package_dist_dir} ${package_output_dir} $has_openssl $has_static
+ if [ $? -ne 0 ]; then
+ echo "${package_src_dir}/buildbin.asf-jk.sh failed"
+ return 1
+ fi
fi
# Build the binary distribution tarball
buildtar ${package_output_dir} "*" ${dst_dir} ${package_build_name}
+ if [ $? -ne 0 ]; then
+ echo "buildtar ${package_output_dir} failed"
+ return 1
+ fi
}
# Only buid binaries?
@@ -855,8 +867,12 @@
# Now build the binaries
(cd ${package_src_dir}
- buildbin $build_output_dir
+ buildbin $build_output_dir || exit 1
)
+if [ $? -ne 0 ]; then
+ echo "buildbin $build_output_dir failed"
+ exit 1
+fi
# generate a list of dependencies
override ${build_top}/util/builddep $build_output_dir
${PACKAGE}.${build_version}.${BUILD_SYS}.${BUILD_CPU}.depends ${build_working_dir}
Modified: trunk/build/unix/buildbin.rhel-httpd.sh
===================================================================
--- trunk/build/unix/buildbin.rhel-httpd.sh 2007-12-17 14:18:16 UTC (rev 1225)
+++ trunk/build/unix/buildbin.rhel-httpd.sh 2007-12-17 14:19:28 UTC (rev 1226)
@@ -74,9 +74,9 @@
--with-suexec-bin=${_sbindir}/suexec \
--with-suexec-uidmin=500 --with-suexec-gidmin=100 \
--with-pcre \
- $*
-make
-) || exit 1
+ $* || exit 1
+make || exit 1
+) || return 1
}
#
@@ -119,13 +119,23 @@
--enable-file-cache --enable-disk-cache \
--enable-cgid \
--enable-authn-anon --enable-authn-alias
+if [ $? -ne 0 ]; then
+ echo "mpmbuild prefork failed"
+ exit 1
+fi
# For the other MPMs, just build httpd and no optional modules
mpmbuild worker --enable-modules=none
+if [ $? -ne 0 ]; then
+ echo "mpmbuild worker failed"
+ exit 1
+fi
# Install it
RPM_BUILD_ROOT=$output_loc
(cd prefork
make DESTDIR=$RPM_BUILD_ROOT install
-) || exit 1
+)
install -m 755 worker/httpd ${RPM_BUILD_ROOT}/${_sbindir}/httpd.worker
+echo "Done"
+exit 0