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 | |
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
-rw-r--r-- | .gitignore | 72 | ||||
-rwxr-xr-x | acprep | 26 | ||||
-rw-r--r-- | tools/Makefile.am | 12 | ||||
-rw-r--r-- | tools/excludes | 1 | ||||
-rw-r--r-- | version.m4 | 1 |
5 files changed, 49 insertions, 63 deletions
@@ -1,58 +1,38 @@ -.timestamp +*.[oa] *.backup *.elc +*.l[oa] *.pyc *~ +.timestamp +/*.tar.bz2 +/*.tar.gz +/.deps/ +/.libs/ /ABOUT-NLS +/BaselineTests +/Doxyfile.gen +/Makefile /Makefile.am /Makefile.in +/PyUnitTests +/RegressionTests /TAGS /acconf.h.in /aclocal.m4 /autogen.sh /autom4te.cache/ /config.guess +/config.h /config.h.in +/config.log /config.rpath +/config.status /config.sub /configure /configure.ac -/depcomp -/elisp-comp -/install-sh -/intl/ -/ledger -/ltmain.sh -/m4/ -/make.sh -/missing -/po/ -/py-compile -/src/system.hh.gch -/texinfo.tex -/version.m4 - -*.[oa] -*.l[oa] -/*.tar.bz2 -/*.tar.gz -/.deps/ -/.libs/ -/BaselineTests -/Doxyfile.gen -/Makefile -/PyUnitTests -/RegressionTests -/config.h -/config.log -/config.status /data_tests -/doc/.dirstamp -/doc/html/ -/doc/latex/ -/doc/ledger.info -/doc/refman.pdf -/doc/report/ +/depcomp /doc/*.aux /doc/*.cp /doc/*.fn @@ -63,15 +43,33 @@ /doc/*.toc /doc/*.tp /doc/*.vr +/doc/.dirstamp +/doc/html/ +/doc/latex/ +/doc/ledger.info +/doc/refman.pdf +/doc/report/ +/elisp-comp /expr_tests +/install-sh +/intl/ +/ledger /libtool +/ltmain.sh +/m4/ +/make.sh /math_tests +/missing +/mkinstalldirs +/po/ +/py-compile /report_tests /shave /shave-libtool +/src/system.hh.gch /stamp-h1 /test/python/ +/texinfo.tex /tmpcvs*/ /tmpwrk*/ /util_tests -/mkinstalldirs @@ -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() diff --git a/tools/Makefile.am b/tools/Makefile.am index 5a6e2fdc..1ca0a6a7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,4 +1,4 @@ -VERSION = 3.0.0 +LIBVERSION = $(shell echo $(PACKAGE_VERSION) | sed 's/[-abgrc].*//') ACLOCAL_AMFLAGS = -I m4 dist_man_MANS = doc/ledger.1 SUBDIRS = po intl @@ -25,7 +25,7 @@ libledger_util_la_SOURCES = \ lib/sha1.cpp libledger_util_la_CPPFLAGS = $(lib_cppflags) -libledger_util_la_LDFLAGS = -release $(VERSION) +libledger_util_la_LDFLAGS = -release $(LIBVERSION) libledger_math_la_SOURCES = \ src/balance.cc \ @@ -36,7 +36,7 @@ libledger_math_la_SOURCES = \ src/amount.cc libledger_math_la_CPPFLAGS = $(lib_cppflags) -libledger_math_la_LDFLAGS = -release $(VERSION) +libledger_math_la_LDFLAGS = -release $(LIBVERSION) libledger_expr_la_SOURCES = \ src/option.cc \ @@ -51,7 +51,7 @@ libledger_expr_la_SOURCES = \ src/value.cc libledger_expr_la_CPPFLAGS = $(lib_cppflags) -libledger_expr_la_LDFLAGS = -release $(VERSION) +libledger_expr_la_LDFLAGS = -release $(LIBVERSION) libledger_data_la_SOURCES = \ src/lookup.cc \ @@ -68,7 +68,7 @@ libledger_data_la_SOURCES = \ src/item.cc libledger_data_la_CPPFLAGS = $(lib_cppflags) -libledger_data_la_LDFLAGS = -release $(VERSION) +libledger_data_la_LDFLAGS = -release $(LIBVERSION) libledger_report_la_SOURCES = \ src/stats.cc \ @@ -87,7 +87,7 @@ libledger_report_la_SOURCES = \ src/session.cc libledger_report_la_CPPFLAGS = $(lib_cppflags) -libledger_report_la_LDFLAGS = -release $(VERSION) +libledger_report_la_LDFLAGS = -release $(LIBVERSION) pkginclude_HEADERS = \ src/utils.h \ diff --git a/tools/excludes b/tools/excludes index dc56eacc..d914099f 100644 --- a/tools/excludes +++ b/tools/excludes @@ -44,4 +44,3 @@ src/system.hh.gch stamp-h1 texinfo.tex util_tests -version.m4 diff --git a/version.m4 b/version.m4 new file mode 100644 index 00000000..611c8282 --- /dev/null +++ b/version.m4 @@ -0,0 +1 @@ +m4_define([VERSION_NUMBER], [3.0.0]) |