diff --git a/utils/common/deploy-rbutil.py b/utils/common/deploy-rbutil.py index dea9f328ee..a94dfdae20 100755 --- a/utils/common/deploy-rbutil.py +++ b/utils/common/deploy-rbutil.py @@ -52,6 +52,9 @@ deploy.progexe = { "darwin" : "RockboxUtility.app", "linux2" : "RockboxUtility" } +deploy.regreplace = { + "rbutil/rbutilqt/version.h" : ["SVN \$.*\$", "SVN $Revision: %REVISION% $"] +} # OS X 10.6 defaults to gcc 4.2. Building universal binaries that are # compatible with 10.4 requires using gcc-4.0. deploy.qmakespec = { @@ -72,4 +75,3 @@ deploy.programfiles = [ ] deploy.nsisscript = "" deploy.deploy() - diff --git a/utils/common/deploy-themeeditor.py b/utils/common/deploy-themeeditor.py index 4569052e97..8b66e5aef4 100755 --- a/utils/common/deploy-themeeditor.py +++ b/utils/common/deploy-themeeditor.py @@ -35,6 +35,7 @@ deploy.progexe = { "darwin" : "rbthemeeditor.app", "linux2" : "rbthemeeditor" } +deploy.regreplace = {} # OS X 10.6 defaults to gcc 4.2. Building universal binaries that are # compatible with 10.4 requires using gcc-4.0. deploy.qmakespec = { diff --git a/utils/common/deploy.py b/utils/common/deploy.py index 44635c851d..1e48f8a56f 100755 --- a/utils/common/deploy.py +++ b/utils/common/deploy.py @@ -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]))