From: <ap...@vh...> - 2005-09-23 12:34:19
|
Author: apevec Date: 2005-09-23 14:24:31 +0200 (Fri, 23 Sep 2005) New Revision: 922 Modified: releases/1.0.3/tools/misc/build-all.sh Log: merge r920 build-all.sh dependecy fix Modified: releases/1.0.3/tools/misc/build-all.sh =================================================================== --- releases/1.0.3/tools/misc/build-all.sh 2005-09-23 12:22:38 UTC (rev 921) +++ releases/1.0.3/tools/misc/build-all.sh 2005-09-23 12:24:31 UTC (rev 922) @@ -157,7 +157,17 @@ then echo " Found only: $output, check $APPS_FILE and $CCM_APP/$CCM_APP/application.xml" else - echo " Application $app_name not built at all, check order of apps in $APPS_FILE" + echo + echo -n " Application $app_name not built at all" + if echo " ${APPS} " | grep -F " ${app_name} " > /dev/null + then + : + else + echo -n ", please add it to $APPS_FILE" + fi + echo + echo " Restart the build process with '-r $app_name'" + echo fi exit 1 @@ -265,15 +275,29 @@ display_usage fi +# get rid of newlines +apps=$(echo $(cat $APPS_FILE)) + APPS="" +# First, reorder the supplied list of apps in proper dependency order +app_build_order=$(grep ccm:requires */*/application.xml | sed 's!^\(ccm-[^/]*\)/.*name="\([^"]*\)".*!\2 \1!' | tsort) +for app in $app_build_order +do + if echo " ${apps} " | grep -F " ${app} " > /dev/null + then + APPS="$APPS $app" + fi +done + + BUILD_APPS="" BOOTSTRAP=1 -for app in `cat $APPS_FILE`; do - APPS="$APPS $app"; +for app in $APPS +do if [ "x$RESTART_FOUND" = "x1" -o "x$RESTART_FROM" = "x$app" ]; then - RESTART_FOUND=1; - BOOTSTRAP=0 - BUILD_APPS="$BUILD_APPS $app"; + RESTART_FOUND=1; + BOOTSTRAP=0 + BUILD_APPS="$BUILD_APPS $app"; fi done @@ -281,13 +305,14 @@ BUILD_APPS=$APPS fi + if [ ! -z $RESTART_FROM ] && [ -z $RESTART_FOUND ] && [ $DO_BUILD = 1 ]; then echo "$RESTART_FROM not found in app list"; display_usage fi -echo "Processing apps: $APPS" -echo "Building apps: $BUILD_APPS" +echo "Processing apps: $apps" +echo "Building apps in order: $BUILD_APPS" BUILD_HOME=`pwd` VIRTUAL_ROOT=$BUILD_HOME/root @@ -553,7 +578,7 @@ ( set -e set_application_properties $i - $RPM $RPM_ARGS --noscripts --relocate /usr=$VIRTUAL_ROOT --relocate /etc=$VIRTUAL_ROOT/etc -ivh $HOMERPMDIR/$APP_NAME-$APP_VERSION-$RELEASE.noarch.rpm + $RPM $RPM_ARGS --force --noscripts --relocate /usr=$VIRTUAL_ROOT --relocate /etc=$VIRTUAL_ROOT/etc -Uvh $HOMERPMDIR/$APP_NAME-$APP_VERSION-$RELEASE.noarch.rpm ) || exit $? done |