Changeset 709 for branches


Ignore:
Timestamp:
Oct 26, 2007 10:44:28 PM (12 years ago)
Author:
jpfasano
Message:

Added function to get the number of the latest release version of a project in the svn repository.

Location:
branches/testScripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBsvnCommand.py

    r700 r709  
    4343  r=r'<li><a href="(\d*\.\d*)/">(\d*\.\d*)/</a></li>'
    4444  findResult=re.findall(r,html)
     45  if len(findResult)==0: return False
    4546  latestStableVersionRepeated2Times = findResult[-1:][0]
    4647  latestStableVersion=latestStableVersionRepeated2Times[0]
    4748  return latestStableVersion
     49
     50#------------------------------------------------------------------------
     51# Function which returns the latest release version of a project
     52# If there isn't a release version then False is returned
     53#------------------------------------------------------------------------
     54def latestReleaseVersion(project) :
     55  url='https://projects.coin-or.org/svn/'+project+'/releases'
     56  handle=urllib2.urlopen(url)
     57  html=handle.read()
     58  handle.close()
     59
     60  # In html code find the latest version number
     61  #   <li><a href="1.6.0/">1.6.0/</a></li>
     62  r=r'<li><a href="(\d*\.\d*.\d*)/">(\d*\.\d*.\d*)/</a></li>'
     63  findResult=re.findall(r,html)
     64  if len(findResult)==0: return False
     65  latestReleaseVersionRepeated2Times = findResult[-1:][0]
     66  latestReleaseVersion=latestReleaseVersionRepeated2Times[0]
     67  return latestReleaseVersion
     68
    4869
    4970#------------------------------------------------------------------------
  • branches/testScripts/nightlyBuild.py

    r702 r709  
    8888      sys.exit(1)
    8989    if bc['SvnVersion']=='latestStable' :
    90       configuration['svnVersion']='stable/'+NBsvnCommand.latestStableVersion(p)
     90      lsv=NBsvnCommand.latestStableVersion(p)
     91      if not lsv :
     92        print 'Error. BUILDS configured to use lastest stable svn version'
     93        print '       Project does not have a stable version'
     94        print '       Project is '+p
     95        print '       BuildConfig is '+str(bc)
     96        sys.exit(1)
     97      configuration['svnVersion']='stable/'+lsv
     98    elif bc['SvnVersion']=='latestRelease' :
     99      lrv=NBsvnCommand.latestReleaseVersion(p)
     100      if not lrv :
     101        print 'Error. BUILDS configured to use lastest release svn version'
     102        print '       Project does not have a release version'
     103        print '       Project is '+p
     104        print '       BuildConfig is '+str(bc)
     105        sys.exit(1)
     106      configuration['svnVersion']='releases/'+lrv
    91107    else:
    92108      configuration['svnVersion']=bc['SvnVersion']
Note: See TracChangeset for help on using the changeset viewer.