Changeset 771


Ignore:
Timestamp:
Nov 14, 2007 10:04:33 AM (12 years ago)
Author:
stefan
Message:

run configure only if last configure run was not ok OR svn update updated a configure or a *.in file

Location:
branches/testScripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBbuildConfig.py

    r770 r771  
    88import os
    99import sys
     10import re
    1011
    1112import NBlogMessages
     
    1920# subversion repository.
    2021#---------------------------------------------------------------------
    21 SVN_HISTORY = []
     22SVN_HISTORY = {}
    2223THIRD_PARTY_HISTORY = []
    2324
     
    184185  #---------------------------------------------------------------------
    185186  # Don't get source from subversion if previously done
    186   if projectCheckOutDir not in SVN_HISTORY :
     187  if not SVN_HISTORY.has_key(projectCheckOutDir) :
    187188    if not os.path.isdir(projectBaseDir) :
    188189      os.makedirs(projectBaseDir)
     
    193194           ' '+svnVersionFlattened
    194195      commandHistory+=[ svnCmd ]
    195       if NBsvnCommand.run(svnCmd,projectBaseDir,configuration['project'])!='OK' :
     196      svnResult=NBsvnCommand.run(svnCmd,projectBaseDir,configuration['project'])
     197      if svnResult['returnCode'] != 0 :
    196198        return
     199      runConfigure = True
    197200    else :
    198201      svnCmd='svn update'
    199202      commandHistory+=[ svnCmd ]
    200       if NBsvnCommand.run(svnCmd,projectCheckOutDir,configuration['project'])!='OK' :
     203      svnResult=NBsvnCommand.run(svnCmd,projectCheckOutDir,configuration['project'])
     204      if svnResult['returnCode'] != 0 :
    201205        return
    202     SVN_HISTORY.append(projectCheckOutDir)
     206      #check whether a *.in or configure file was updated
     207      r=r'(\S+\.in\s)|(configure\s)'
     208      findResult=re.findall(r,svnResult['stdout'])
     209      if len(findResult)!=0:
     210        runConfigure = True
     211      else :
     212        runConfigure = False
     213
     214    SVN_HISTORY[projectCheckOutDir]=runConfigure
    203215  else :
    204216    NBlogMessages.writeMessage('  "svn update" skipped. nightlyBuild has already updated for prior build configuration')
     217    runConfigure=SVN_HISTORY[projectCheckOutDir]
    205218
    206219  #---------------------------------------------------------------------
     
    281294
    282295    # If config was previously run, then no need to run again.
    283   #  if NBcheckResult.didConfigRunOK() :
    284   #    NBlogMessages.writeMessage("  configure previously ran. Not rerunning.")
    285   #  else :
    286     NBlogMessages.writeMessage("  "+configCmd)
    287     commandHistory+=[ configCmd ]
    288 
    289     # Finally run config
    290     result=NBosCommand.run(configCmd)
    291     writeResults(result,'config')
    292 
    293     # Check if configure worked
    294     if result['returnCode'] != 0 :
     296    if (not runConfigure) and NBcheckResult.didConfigRunOK() :
     297      NBlogMessages.writeMessage("  configure previously ran. Not rerunning.")
     298    else :
     299      NBlogMessages.writeMessage("  "+configCmd)
     300      commandHistory+=[ configCmd ]
     301
     302      # Finally run config
     303      result=NBosCommand.run(configCmd)
     304      writeResults(result,'config')
     305
     306      # Check if configure worked
     307      if result['returnCode'] != 0 :
    295308        error_msg = result
    296309        error_msg['configure flags']=configOptions
  • branches/testScripts/NBsvnCommand.py

    r753 r771  
    2121#  project: Coin project running the command (this is used to provide
    2222#           a better message if an error is detected
     23#  return: the result of the NBosCommand call;
     24#          return['returnCode'] is the return code of svn
    2325#------------------------------------------------------------------------
    2426def run(svnCmd,dir,project) :
    25   retVal='OK'
    2627  os.chdir(dir)
    2728  NBlogMessages.writeMessage('  cd '+dir)
     
    2930  result = NBosCommand.run(svnCmd)
    3031  if result['returnCode'] != 0 :
    31     NBemail.sendCmdMsgs(project,result,svnCmd)
    32     retVal='Error'
    33   return retVal
     32   NBemail.sendCmdMsgs(project,result,svnCmd)
     33  return result
    3434
    3535
  • branches/testScripts/nightlyBuild.py

    r769 r771  
    6060  if not os.path.isdir(dataDir) :
    6161    svnCmd='svn checkout https://projects.coin-or.org/svn/Data/releases/1.0.4/'+d+' '+d
    62     if NBsvnCommand.run(svnCmd,dataBaseDir,'Data')!='OK' :
     62    svnResult=NBsvnCommand.run(svnCmd,dataBaseDir,'Data')
     63    if svnResult['returnCode'] != 0 :
    6364      sys.exit(1)
    6465    result=NBosCommand.run('find '+d+' -name \*.gz -print | xargs gzip -d')
Note: See TracChangeset for help on using the changeset viewer.