Changeset b50b5af2 in mainline for tools/config.py


Ignore:
Timestamp:
2009-08-22T10:48:00Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
04803bf
Parents:
1ea99cc (diff), a71c158 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config.py

    r1ea99cc rb50b5af2  
    3434import os
    3535import re
    36 import commands
     36import time
     37import subprocess
    3738import xtui
    3839
     
    225226        "Create output configuration"
    226227       
    227         revision = commands.getoutput('svnversion . 2> /dev/null')
    228         timestamp = commands.getoutput('date "+%Y-%m-%d %H:%M:%S"')
     228        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
     229        version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].split(':')
     230       
     231        if (len(version) == 3):
     232                revision = version[1]
     233                if (version[0] != 1):
     234                        revision += 'M'
     235                revision += ' (%s)' % version[2]
     236        else:
     237                revision = None
    229238       
    230239        outmk = file(mkname, 'w')
     
    266275                        outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default))
    267276       
    268         outmk.write('REVISION = %s\n' % revision)
     277        if (revision is not None):
     278                outmk.write('REVISION = %s\n' % revision)
     279                outmc.write('#define REVISION %s\n' % revision)
     280                outdf.write(' "-DREVISION=%s"' % revision)
     281       
    269282        outmk.write('TIMESTAMP = %s\n' % timestamp)
    270        
    271         outmc.write('#define REVISION %s\n' % revision)
    272283        outmc.write('#define TIMESTAMP %s\n' % timestamp)
    273        
    274         outdf.write(' "-DREVISION=%s" "-DTIMESTAMP=%s"\n' % (revision, timestamp))
     284        outdf.write(' "-DTIMESTAMP=%s"\n' % timestamp)
    275285       
    276286        outmk.close()
Note: See TracChangeset for help on using the changeset viewer.