1
0
Fork 0
forked from len0rd/rockbox

deploy.py: insert version number into sources.

After downloading the sources insert the number of the revision checked out
into the code. Results in the Rockbox Utility about dialog showing the actual
revision instead of the one of the last change to version.h. Only applied when
building from trunk for now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29684 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2011-04-06 20:17:29 +00:00
parent 3184cbe10a
commit 2c297760df
3 changed files with 20 additions and 1 deletions

View file

@ -563,6 +563,22 @@ def deploy():
tempclean(workfolder, cleanup and not keeptemp)
sys.exit(1)
# replace version strings. Only done when building from trunk
if tag == "":
print "Updating version information in sources"
for f in regreplace:
infile = open(sourcefolder + "/" + f, "r")
incontents = infile.readlines()
infile.close()
outfile = open(sourcefolder + "/" + f, "w")
for line in incontents:
# replacements made on the replacement string:
# %REVISION% is replaced with the revision number
replacement = re.sub("%REVISION%", str(trunk), regreplace[f][1])
outfile.write(re.sub(regreplace[f][0], replacement, line))
outfile.close()
if source == True:
tf = tarfile.open(archivename, mode='w:bz2')
tf.add(sourcefolder, os.path.basename(re.subn('/$', '', sourcefolder)[0]))