Changeset fd210de in mainline for tools/config.py
- Timestamp:
- 2009-08-13T17:26:25Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8344d0a
- Parents:
- 75a2dc08 (diff), 64cbf94 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/config.py
r75a2dc08 rfd210de 34 34 import os 35 35 import re 36 import commands 36 import time 37 import subprocess 37 38 import xtui 38 39 … … 225 226 "Create output configuration" 226 227 227 revision = commands.getoutput('bzr version-info --custom --template="{revision_id}" 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 229 238 230 239 outmk = file(mkname, 'w') … … 266 275 outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default)) 267 276 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 269 282 outmk.write('TIMESTAMP = %s\n' % timestamp) 270 271 outmc.write('#define REVISION %s\n' % revision)272 283 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) 275 285 276 286 outmk.close()
Note:
See TracChangeset
for help on using the changeset viewer.