From 74db20592869396232ca35456f4e2c63c7d937b3 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 7 Aug 2013 13:32:22 -0700 Subject: Remove inferior package version, fix makefile format The problem with version is that it breaks remake without reconf. Version should instead be handled by the makefile. --- attoconf/_version.py | 2 +- attoconf/lib/install.py | 15 +++------------ attoconf/lib/make.py | 2 +- attoconf/types.py | 8 -------- demo-project/configure | 6 +++--- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/attoconf/_version.py b/attoconf/_version.py index 074f773..68a4244 100644 --- a/attoconf/_version.py +++ b/attoconf/_version.py @@ -7,7 +7,7 @@ major = 0 # Incremented for releases with compatible API additions. # This is the number that is usually incremented. -minor = 5 +minor = 6 # Incremented if there is a bugfix release. # Might not be contiguous. diff --git a/attoconf/lib/install.py b/attoconf/lib/install.py index 2bbc7c7..b32ebe0 100644 --- a/attoconf/lib/install.py +++ b/attoconf/lib/install.py @@ -20,15 +20,12 @@ from __future__ import print_function, division, absolute_import import os from ..classy import ClassyProject -from ..types import shell_word, version, filepath, quoted_string +from ..types import shell_word, filepath, quoted_string def package(build, PACKAGE): pass -def package_version(build, VERSION): - pass - def package_name(build, NAME): pass @@ -187,11 +184,10 @@ class Install(ClassyProject): @classmethod def slots(cls): return super(Install, cls).slots() + ( - 'package', 'package_version', 'package_name') + 'package', 'package_name') - def set_package(self, package, version, name): + def set_package(self, package, name): self.package = package - self.package_version = version self.package_name = name def general(self): @@ -200,11 +196,6 @@ class Install(ClassyProject): type=shell_word, check=package, help='Short name of this package (don\'t change!)', hidden=True) - self.add_option('--package-version', init=self.package_version, - type=version, check=package_version, - help='Version of this package (change in configure)', - hidden=True, - help_var='VERSION') self.add_option('--package-name', init=self.package_name, type=quoted_string, check=package_name, help='Long name of this package (don\'t change)', diff --git a/attoconf/lib/make.py b/attoconf/lib/make.py index ec03d1d..8bcd3b5 100644 --- a/attoconf/lib/make.py +++ b/attoconf/lib/make.py @@ -47,7 +47,7 @@ class MakeHook(object): out.write('\n') continue val, origin = build.vars[var] - out.write('%s = %s # %s\n' % (var, val, origin)) + out.write('# %s\n%s = %s\n' % (origin, var, val)) if self.infile is not None: out.write('# The rest was copied from %s\n' % self.infile) infile = os.path.join(build.project.srcdir, self.infile) diff --git a/attoconf/types.py b/attoconf/types.py index b2b5745..3e73d86 100644 --- a/attoconf/types.py +++ b/attoconf/types.py @@ -94,14 +94,6 @@ def quoted_string(s): return shell_quote(s) -def version(s): - if s.startswith('v'): - s = s[1:] - for b in s.split('.'): - int(b) - return s - - def filepath(s): s = trim_trailing_slashes(s) # must be absolute *and* canonical diff --git a/demo-project/configure b/demo-project/configure index ce2cc45..47022c2 100755 --- a/demo-project/configure +++ b/demo-project/configure @@ -22,8 +22,8 @@ from __future__ import print_function, division, absolute_import import os import sys -from attoconf.version import require_version, part_version -require_version(0, 5) +from attoconf.version import require_version +require_version(0, 6) from attoconf.classy import add_slots from attoconf.lib.c import C @@ -66,7 +66,7 @@ class Configuration(C, Install, ConfigHash, Make): def main(): proj = Configuration(os.path.dirname(sys.argv[0])) - proj.set_package('attoconf-demo', part_version, 'Demo project for attoconf') + proj.set_package('attoconf-demo', 'Demo project for attoconf') proj.jiggle() build = proj.build('.') build.configure(sys.argv[1:], os.environ) -- cgit v1.2.3-70-g09d2