diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-15 04:24:46 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-15 04:26:42 -0400 |
commit | d2b333881fc40e713a34d34b79ff66f5aaf3d027 (patch) | |
tree | f0a3c2619df22aa817ce4628113217136a1e80e1 /acprep | |
parent | fa263e729c65e073950a15db11c149ebacba0937 (diff) | |
download | fork-ledger-d2b333881fc40e713a34d34b79ff66f5aaf3d027.tar.gz fork-ledger-d2b333881fc40e713a34d34b79ff66f5aaf3d027.tar.bz2 fork-ledger-d2b333881fc40e713a34d34b79ff66f5aaf3d027.zip |
Version information is now based on version.m4
Diffstat (limited to 'acprep')
-rwxr-xr-x | acprep | 26 |
1 files changed, 7 insertions, 19 deletions
@@ -633,17 +633,13 @@ class PrepareBuild(CommandLineApp): def current_version(self): if not self.current_ver: - if self.git_working_tree(): - #date = self.get_stdout('git', 'log', '--format=%ci', '-1', 'HEAD') - #date = re.sub(" [-+][0-9][0-9][0-9][0-9]$", "", date) - #when = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S") - #self.current_ver = when.strftime("%Y%m%d_%H%M%S") - #commit = self.get_stdout('git', 'log', '--format=%h', 'HEAD^..HEAD') - #self.current_ver += "_" + commit - tag = self.get_stdout('git', 'describe', '--all', '--long') - self.current_ver = re.sub('heads/', '', tag) - else: - self.current_ver = "no-git" + version_m4 = open('version.m4', 'r') + for line in version_m4.readlines(): + match = re.match('m4_define\(\[VERSION_NUMBER\], \[([0-9.]+[-abgrc0-9]*)\]\)', + line) + assert(match) + self.current_ver = match.group(1) + version_m4.close() return self.current_ver def need_to_prepare_autotools(self): @@ -726,13 +722,6 @@ class PrepareBuild(CommandLineApp): POTFILES_in.write('\n') POTFILES_in.close() - def phase_version(self, *args): - self.log.info('Executing phase: version') - version_m4 = open('version.m4', 'w') - version_m4.write("m4_define([VERSION_NUMBER], [%s])\n" % - self.current_version()) - version_m4.close() - def copytimes(self, src, dest): os.utime(dest, (os.stat(src)[ST_ATIME], os.stat(src)[ST_MTIME])) @@ -766,7 +755,6 @@ class PrepareBuild(CommandLineApp): reason = self.need_to_prepare_autotools() if reason: self.log.info('autogen.sh must be run ' + reason) - self.phase_version() self.phase_autogen() self.phase_gettext() self.phase_aclocal() |