ajack       2004/04/05 12:03:35

  Modified:    .        gumpy.bat gumpy.sh
  Log:
  Gut gumpy.sh and gumpy.bat and call gumpy.py (once env set).
  
  Revision  Changes    Path
  1.5       +1 -181    gump/gumpy.bat
  
  Index: gumpy.bat
  ===================================================================
  RCS file: /home/cvs/gump/gumpy.bat,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- gumpy.bat 29 Feb 2004 19:03:39 -0000      1.4
  +++ gumpy.bat 5 Apr 2004 19:03:35 -0000       1.5
  @@ -29,187 +29,7 @@
   SET HOST_LOCAL_ENV="local-env-py-%GUMP_HOST%.sh"

   IF EXIST  %HOST_LOCAL_ENV% CALL %HOST_LOCAL_ENV%

   

  -IF NOT "%GUMP%" == "" GOTO hasGumpEnv

  -     ECHO Set the GUMP variable to your gump install.

  -     goto end

  -:hasGumpEnv

  -

  -IF NOT "%GUMP_WS%" == "" GOTO hasGumpWSEnv

  -     ECHO Set the GUMP_WS variable to your gump working area.

  -     goto end

  -:hasGumpWSEnv

  -

  -IF NOT "%GUMP_LOG_DIR%" == "" GOTO hasGumpLogDirEnv

  -     ECHO Set the GUMP_LOG_DIR variable to your gump WWW directory.

  -     goto end

  -:hasGumpLogDirEnv

  -

  -SET GUMP_TARGET=all

  -IF NOT "" == "%1" SET GUMP_TARGET=%1

  -

  -REM

  -REM Calculated

  -REM

  -SET GUMPY_VERSION="1.0.6"

  -SET GUMP_PYTHON=%GUMP%\python

  -SET GUMP_TMP=%GUMP%\tmp

  -SET GUMP_WS_TMP=%GUMP_WS%\tmp

  -SET GUMP_LOG=%GUMP_LOG_DIR%\gumpy.html

  -SET GUMP_PROFILE_LOG_DIR=%GUMP_LOG_DIR%\myprofile

  -

  -IF "" == "%GUMP_WORKSPACE%" SET GUMP_WORKSPACE=%GUMP_HOST%

  -

  -SET SEPARATOR=------------------------------------------------------- G U M P Y

  -

  -REM

  -REM Ensure directory structure to write into 

  -REM

  -cd %GUMP%

  -IF NOT EXIST %GUMP_LOG_DIR% MKDIR %GUMP_LOG_DIR%; 

  -IF EXIST %GUMP_LOG_DIR% goto hasLogDir:

  -     ECHO "Failed to find/create the directory GUMP_LOG_DIR=%GUMP_LOG_DIR%, can't 
continue."

  -     goto end

  -:hasLogDir

  -

  -REM

  -REM Generate gumpy.html from this (into the WWW site)

  -REM

  -ECHO "<XMP>" > %GUMP_LOG%

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -ECHO "Gump run on %GUMP_HOST% >> %GUMP_LOG%

  -ECHO "" >> %GUMP_LOG%

  -ECHO "GUMP TARGET : %GUMP_TARGET%" >> %GUMP_LOG%

  -ECHO "" >> %GUMP_LOG%

  -ECHO "GUMP        : %GUMP%" >> %GUMP_LOG%

  -ECHO "GUMP W/S    : %GUMP_WS%" >> %GUMP_LOG%

  -ECHO "GUMP LOG    : %GUMP_LOG_DIR%" >> %GUMP_LOG%

  -ECHO "" >> %GUMP_LOG%

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -ECHO "GUMPY.sh version %GUMPY_VERSION%" >> %GUMP_LOG%

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -ECHO "" >> %GUMP_LOG%

  -

  -REM

  -REM Store the profile (into a myprofile dir)

  -REM

  -

  -IF NOT EXIST %GUMP_PROFILE_LOG_DIR% MKDIR %GUMP_PROFILE_LOG_DIR% 

  -

  -IF EXIST %GUMP_PROFILE_LOG_DIR% GOTO hasProfileLogDir

  -     ECHO "Profile log directory doesn't exists [%GUMP_PROFILE_LOG_DIR%"

  -     goto end

  -:hasProfileLogDir

  -

  -COPY /Y %GUMP%\gumpy.sh %GUMP_PROFILE_LOG_DIR%

  -COPY /Y %GUMP_HOST%.xml  %GUMP_PROFILE_LOG_DIR%

  -IF EXIST %LOCAL_ENV% COPY /Y %LOCAL_ENV% %GUMP_PROFILE_LOG_DIR%

  -IF EXIST %HOST_LOCAL_ENV% COPY /Y %HOST_LOCAL_ENV% %GUMP_PROFILE_LOG_DIR%

  -

  -REM  :TODO:  cp -R `grep profile %GUMP_HOST%.xml  | cut -d\" -f2` 
%GUMP_PROFILE_LOG_DIR%

  -

  -REM

  -REM

  -REM Preliminary cleanup

  -REM

  -

  -REM Gump-level tmp

  -IF EXIST %GUMP_TMP% DEL /Q %GUMP_TMP%\*.txt

  -

  -REM Gump work tmp

  -IF EXIST %GUMP_WS_TMP% DEL /Q %GUMP_WS_TMP%\*.txt

  -

  -REM Clear the forrest build area...

  -IF EXIST %GUMP_WS%\forrest\build\ DEL /Q %GUMP_WS%\forrest\build\

  -

  -REM

  -REM Do a CVS update

  -REM

  -IF NOT "" == "%GUMP_WITHOUT_CVS_UPDATE" GOTO skipCVSUpdate

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -CD %GUMP%

  -ECHO "Update Gump from CVS" >> %GUMP_LOG%

  -cvs -q update -dP >> %GUMP_LOG% 2>&1 

  -REMOVE -f .timestamp

  -:skipCVSUpdate

  -

  -REM

  -REM Set the PYTHONPATH

  -REM

  -SET PYTHONPATH=%GUMP_PYTHON%

  -

  -REM

  -REM Capture environment

  -REM

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -SET >> %GUMP_LOG%

  -REM Capture Python Version

  -python -V >> %GUMP_LOG% 2>&1

  -

  -REM

  -REM

  -REM

  -cd %GUMP_PYTHON%

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -ECHO "Clean *.pyc files." >> %GUMP_LOG%

  -REM find %GUMP_PYTHON% -name '*.pyc' -exec rm {} \;

  -

  -REM

  -REM Do the integration run

  -REM

  -cd %GUMP_PYTHON%

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -ECHO "Integrate using -w ..\%GUMP_WORKSPACE%.xml %GUMP_TARGET% %2 %3 %4 %5 %6" >> 
%GUMP_LOG%

  -python gump\integrate.py -w ..\%GUMP_WORKSPACE%.xml %GUMP_TARGET% %2 %3 %4 %5 %6 >> 
%GUMP_LOG% 

  -IF ERRORLEVEL == 0 GOTO integratedOk         

  -        ECHO "Failed to integrate, exited with error, exiting..." >> %GUMP_LOG%

  -        ECHO "Failed to integrate, exited with error, exiting..."

  -        goto end

  -:integratedOk

  -

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -ECHO >> %GUMP_LOG%

  -

  -REM 

  -CD %GUMP_TMP%

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -IF NOT EXIST check_forrest.txt GOTO noCheckForrest

  -     TYPE check_forrest.txt >> %GUMP_LOG%

  -     COPY /Y check_forrest.txt %GUMP_LOG_DIR%

  -     GOTO checkedForrest

  -:noCheckForrest:

  -     ECHO "No Forrest Output file @ %GUMP_TMP%\check_forrest.txt" >> %GUMP_LOG%

  -:checkedForrest

  -

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -

  -IF NOT EXIST forrest.txt GOTO noForrestOutput

  -     TYPE forrest.txt >> %GUMP_LOG%

  -     COPY /Y forrest.txt %GUMP_LOG_DIR%

  -     GOTO forrested

  -:noForrestOutput

  -     ECHO "No Forrest Output file @ %GUMP_TMP%\forrest.txt" >> %GUMP_LOG%

  -:forrested

  -

  -ECHO %SEPARATOR% >> %GUMP_LOG%

  -

  -IF NOT EXIST %GUMP_WS%\forrest\build\tmp\brokenlinks.txt GOTO noBrokenLinks

  -     ECHO %SEPARATOR% >> %GUMP_LOG%

  -     TYPE %GUMP_WS%\forrest\build\tmp\brokenlinks.txt >> %GUMP_LOG%

  -     ECHO %SEPARATOR% >> %GUMP_LOG%

  -     COPY /Y %GUMP_WS%\forrest\build\tmp\brokenlinks.txt %GUMP_LOG_DIR%

  -:noBrokenLinks

  -

  -:end

  -

  -REM Just in case...

  -IF "" == "%GUMP%" GOTO endedWithoutGump

  -     CD %GUMP%

  -:endedWithoutGump

  -

  -IF "" == "%GUMP_LOG%" GOTO endedWithoutLog

  -     ECHO "</XMP>" >> %GUMP_LOG%

  -:endedWithoutLog

  +python gumpy.py %1 %2 %3 %4 %5

   

   if "%OS%"=="Windows_NT" @ENDLOCAL

   

  @@ -218,8 +38,8 @@
   REM _ J A K A R T A  G U M P _ J A K A R T A  G U M P _ J A K A R T A  G U M P _ 

   REM

   REM $Log$
  -REM Revision 1.4  2004/02/29 19:03:39  ajack
  -REM Tweaks for Gump migration to TLP changes.
  +REM Revision 1.5  2004/04/05 19:03:35  ajack
  +REM Gut gumpy.sh and gumpy.bat and call gumpy.py (once env set).
   REM

   REM

   REM _ J A K A R T A  G U M P _ J A K A R T A  G U M P _ J A K A R T A  G U M P _ 

  
  
  
  1.34      +6 -204    gump/gumpy.sh
  
  Index: gumpy.sh
  ===================================================================
  RCS file: /home/cvs/gump/gumpy.sh,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- gumpy.sh  1 Apr 2004 20:38:39 -0000       1.33
  +++ gumpy.sh  5 Apr 2004 19:03:35 -0000       1.34
  @@ -32,220 +32,22 @@
   if [ -e  $HOST_LOCAL_ENV ] ; then
        . $HOST_LOCAL_ENV
   fi
  -if [ ! $GUMP ] ; then
  -     echo "Set the \$GUMP variable to your gump install (e.g. /opt/gump)"
  -     exit 1
  -fi
  -
  -if [ ! $GUMP_WS ] ; then
  -     echo "Set the \$GUMP_WS variable to your gump working area (e.g. /var/gump)"
  -     exit 1
  -fi
  -
  -if [ ! $GUMP_LOG_DIR ] ; then
  -     echo "Set the \$GUMP_LOG_DIR variable to your gump WWW diredtory (e.g. 
/var/www/html/gump)"
  -     exit 1
  -fi
  -
  -if [ -n "$1" ] ; then
  -     export GUMP_TARGET=$1
  -else
  -     export GUMP_TARGET=all
  -fi
  -
  -#
  -# Calculated
  -#
  -export GUMPY_VERSION="1.0.6"
  -export GUMP_PYTHON=$GUMP/python
  -export GUMP_TMP=$GUMP/tmp
  -export GUMP_WS_TMP=$GUMP_WS/tmp
  -export GUMP_DATE=`date`
  -export GUMP_LOG=$GUMP_WS_TMP/gumpy.html
  -export GUMP_FINAL_LOG=$GUMP_LOG_DIR/gumpy.html
  -export GUMP_PROFILE_LOG_DIR=$GUMP_LOG_DIR/myprofile
  -
  -if [ -z "$GUMP_WORKSPACE" ] ; then
  -     export GUMP_WORKSPACE=${GUMP_HOST}
  -fi
  -
  -export SEPARATOR='------------------------------------------------------- G U M P Y'
  -
  -#
  -# Ensure directory structure to write into 
  -#
  -cd $GUMP
  -if [ ! -d $GUMP_LOG_DIR ] ; then
  -     mkdir $GUMP_LOG_DIR; 
  -fi
  -if [ ! -d $GUMP_LOG_DIR ] ; then
  -     echo "Failed to create the directory \$GUMP_LOG_DIR variable, can't continue."
  -     exit 1
  -fi
  -
  -if [ ! -d $GUMP_WS_TMP ] ; then
  -     mkdir -p $GUMP_WS_TMP;
  -fi
  -if [ ! -d $GUMP_WS_TMP ] ; then
  -     echo "Failed to create the directory \$GUMP_WS_TMP variable, can't continue."
  -     exit 1
  -fi
  -
  -
  -#
  -# Generate gumpy.html from this (into the WWW site)
  -#
  -umask 002
  -echo \<XMP\> > $GUMP_LOG
  -
  -echo $SEPARATOR >> $GUMP_LOG
  -echo $SEPARATOR >> $GUMP_LOG
  -echo "Gump run on $GUMP_HOST at $GUMP_DATE" >> $GUMP_LOG
  -echo >> $GUMP_LOG
  -echo "GUMP TARGET : $GUMP_TARGET" >> $GUMP_LOG
  -echo >> $GUMP_LOG
  -echo "GUMP        : $GUMP" >> $GUMP_LOG
  -echo "GUMP W/S    : $GUMP_WS" >> $GUMP_LOG
  -echo "GUMP LOG    : $GUMP_LOG_DIR" >> $GUMP_LOG
  -echo >> $GUMP_LOG
  -echo $SEPARATOR >> $GUMP_LOG
  -echo "GUMPY.sh version $GUMPY_VERSION" >> $GUMP_LOG
  -echo $SEPARATOR >> $GUMP_LOG
  -echo >> $GUMP_LOG
  -
  -#
  -# Store the profile (into a myprofile dir)
  -#
  -
  -if [ ! -d $GUMP_PROFILE_LOG_DIR ] ; then
  -     mkdir $GUMP_PROFILE_LOG_DIR; 
  -fi
  -if [ ! -d $GUMP_PROFILE_LOG_DIR ] ; then
  -     echo \</XMP\> >> $GUMP_LOG
  -     cp $GUMP_LOG $GUMP_FINAL_LOG
  -     exit 1
  -fi
  -
  -cp $GUMP/gumpy.sh $GUMP_PROFILE_LOG_DIR
  -cp $GUMP_HOST.xml  $GUMP_PROFILE_LOG_DIR
  -if [ -e $LOCAL_ENV ] ; then
  -     cp $LOCAL_ENV $GUMP_PROFILE_LOG_DIR
  -fi
  -if [ -e $HOST_LOCAL_ENV ] ; then
  -     cp $HOST_LOCAL_ENV $GUMP_PROFILE_LOG_DIR
  -fi
  -
  -cp -R `grep profile $GUMP_HOST.xml  | cut -d\" -f2` $GUMP_PROFILE_LOG_DIR
  -
  -#
  -##########################################################
  -#
  -# Preliminary cleanup
  -#
  -
  -# Gump-level tmp
  -if [ -d $GUMP_TMP ] ; then
  -     rm -f $GUMP_TMP/*.txt
  -fi
  -# Gump work tmp
  -if [ -d $GUMP_WS_TMP ] ; then
  -     rm -f $GUMP_WS_TMP/*.txt
  -fi
  -# Clear the forrest build area...
  -if [ -d $GUMP_WS/forrest/build/ ] ; then
  -     rm -rf $GUMP_WS/forrest/build/
  -fi
  -
  -#
  -###########################################################
  -# Do a CVS update
  -#
  -echo $SEPARATOR >> $GUMP_LOG
  -cd $GUMP
  -cvs -q update -dP >> $GUMP_LOG 2>&1 
  -rm -f .timestamp
  -
  -
  -#
  -# Set the PYTHONPATH
  -#
  -export PYTHONPATH=$GUMP_PYTHON
   
  -#
  -# Capture environment
  -#
  -echo $SEPARATOR >> $GUMP_LOG
  -export >> $GUMP_LOG
  -# Capture Python Version
  -python -V >> $GUMP_LOG 2>&1
   
   #
  +# Perform the run (passing on any arguments)
   #
  -#
  -cd $GUMP_PYTHON
  -echo $SEPARATOR >> $GUMP_LOG
  -echo "Clean *.pyc files." >> $GUMP_LOG
  -find $GUMP_PYTHON -name '*.pyc' -exec rm {} \;
  -
  -#
  -# Do the integration run
  -#
  -cd $GUMP_PYTHON
  -echo $SEPARATOR >> $GUMP_LOG
  -python gump/integrate.py -w ../${GUMP_WORKSPACE}.xml ${GUMP_TARGET}  "$@" >> 
$GUMP_LOG 2>&1 
  -export INTEGRATION_EXIT=$?
  -echo "Integration completed with exit code : " ${INTEGRATION_EXIT} >> $GUMP_LOG
  -if [ ${INTEGRATION_EXIT} -gt 0 ] ; then
  -        echo "Failed to integrate, exited with [${INTEGRATION_EXIT}], exiting..." 
>> $GUMP_LOG
  -        echo "Failed to integrate, exited with [${INTEGRATION_EXIT}], exiting..."
  -        # For cron to mail to owner...
  -        cat $GUMP_LOG        
  -             echo \</XMP\> >> $GUMP_LOG
  -             cp $GUMP_LOG $GUMP_FINAL_LOG
  -        exit 1
  -fi;
  -
  -echo >> $GUMP_LOG
  -
  -# 
  -cd $GUMP_TMP
  -echo $SEPARATOR >> $GUMP_LOG
  -if [ -f check_forrest.txt ] ; then
  -     cat check_forrest.txt >> $GUMP_LOG
  -     cp check_forrest.txt $GUMP_LOG_DIR
  -else
  -     echo "No Forrest Output file @ $GUMP_TMP/check_forrest.txt" >> $GUMP_LOG
  -fi
  -
  -echo $SEPARATOR >> $GUMP_LOG
  -
  -if [ -f forrest.txt ] ; then
  -     cat forrest.txt >> $GUMP_LOG
  -     cp forrest.txt $GUMP_LOG_DIR
  -else
  -     echo "No Forrest Output file @ $GUMP_TMP/forrest.txt" >> $GUMP_LOG
  -fi
  -echo $SEPARATOR >> $GUMP_LOG
  -
  -if [ -f $GUMP_WS/forrest/build/tmp/brokenlinks.txt ] ; then
  -     echo $SEPARATOR >> $GUMP_LOG
  -     cat $GUMP_WS/forrest/build/tmp/brokenlinks.txt >> $GUMP_LOG
  -     echo $SEPARATOR >> $GUMP_LOG
  -     cp $GUMP_WS/forrest/build/tmp/brokenlinks.txt $GUMP_LOG_DIR
  -fi
  -
  -# Just in case...
  -cd $GUMP
  -
  -echo \</XMP\> >> $GUMP_LOG
  -cp $GUMP_LOG $GUMP_FINAL_LOG
  +python gumpy.py $*
   
   #
   # Ensure nothing we started (directly) is left running after we end...
  +# :TODO: Shame we can't kill everything below us, including the indirects...
   #
  -pkill -KILL -P $$ 
  +if [ "" != "`which pkill`" ] ; then
  +     pkill -KILL -P $$ 
  +fi
   
   # $Log$
  -# Revision 1.33  2004/04/01 20:38:39  rubys
  -# Ensure $GUMP_WS_TMP exists
  +# Revision 1.34  2004/04/05 19:03:35  ajack
  +# Gut gumpy.sh and gumpy.bat and call gumpy.py (once env set).
   #
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to