From fabb2eb5d401efa7d6cd837681a5c6a33f32b24c Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Tue, 12 Feb 2013 12:05:18 +0000 Subject: Have a single obvious location for specifing the package version svn path=/projects/java-config-2/trunk/; revision=9197 --- make-release | 3 +-- setup.py | 8 +++++++- src/depend-java-query | 5 ++--- src/gjl | 3 +-- src/java-config-2 | 5 ++--- src/java_config_2/__init__.py | 6 +----- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/make-release b/make-release index 08ffe4a..04507aa 100755 --- a/make-release +++ b/make-release @@ -6,8 +6,7 @@ if [[ -z ${version} ]]; then fi svn up svn2cl --authors=AUTHORS -sed -i "s/version =.*/version = \'${version}\',/" setup.py -sed -i "s/__version__ =.*/__version__ = \'${version}\'/" src/java_config_2/__init__.py +sed -i "s/package_version =.*/package_version = \'${version}\',/" setup.py python setup.py sdist --force-manifest --formats=bztar cp -v dist/java-config-${version}.tar.bz2 $(portageq envvar DISTDIR) diff --git a/setup.py b/setup.py index 78a26de..b725cf3 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,9 @@ #!/usr/bin/env python +####################################### +package_version = '2.2.0' +####################################### + from distutils.command.build import build import fileinput, os, sys @@ -11,6 +15,8 @@ class my_build(build): eprefix = os.getenv('EPREFIX', '') for base, dirs, files in os.walk(self.build_base): for f in files: + for line in fileinput.input(os.path.join(base, f),inplace=True): + sys.stdout.write(line.replace('@PACKAGE_VERSION@', package_version)) for line in fileinput.input(os.path.join(base, f),inplace=True): sys.stdout.write(line.replace('@GENTOO_PORTAGE_EPREFIX@', eprefix)) @@ -20,7 +26,7 @@ from distutils.core import setup setup ( cmdclass={'build' : my_build}, name = 'java-config', - version = '2.1.12', + version = package_version, description = 'java enviroment configuration tool', long_description = \ """ diff --git a/src/depend-java-query b/src/depend-java-query index 6361522..a184be5 100755 --- a/src/depend-java-query +++ b/src/depend-java-query @@ -5,7 +5,6 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -from java_config_2 import __version__ from java_config_2.OutputFormatter import OutputFormatter from java_config_2.EnvironmentManager import EnvironmentManager from java_config_2.Errors import * @@ -17,7 +16,7 @@ import sys from optparse import OptionParser, make_option, OptionValueError def version(option, opt, value, parser): - printer._print("%H%BJava Dep Query Utility %GVersion " + str(__version__)) + printer._print("%H%BJava Dep Query Utility %GVersion @PACKAGE_VERSION@") raise SystemExit() def nocolor(option, opt, value, parser): @@ -69,7 +68,7 @@ if __name__ == '__main__': verman = VersionManager(manager) usage = "depend-java-query [options]\n\n" - usage += "Java Dep Query Utility Version " + str(__version__) + "\n" + usage += "Java Dep Query Utility Version @PACKAGE_VERSION@\n" usage += "Copyright 2004-2006 Gentoo Foundation\n" usage += "Distributed under the terms of the GNU General Public License v2\n" usage += "Please contact the Gentoo Java Herd with problems." diff --git a/src/gjl b/src/gjl index 8a9fd88..3988e1a 100755 --- a/src/gjl +++ b/src/gjl @@ -4,7 +4,6 @@ # Copyright 2004-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from java_config_2 import __version__ from java_config_2.OutputFormatter import * from java_config_2.EnvironmentManager import * from java_config_2.VersionManager import * @@ -85,7 +84,7 @@ def normpath(mypath): if __name__ == '__main__': usage = "%prog [options]\n\n" - usage += "Java Utility Version " + str(__version__) + "\n" + usage += "Java Utility Version @PACKAGE_VERSION@\n" usage += "Copyright 2004-2005 Gentoo Foundation\n" usage += "Distributed under the terms of the GNU General Public License v2\n" usage += "Please contact the Gentoo Java Herd with problems." diff --git a/src/java-config-2 b/src/java-config-2 index d26b045..8ad2539 100755 --- a/src/java-config-2 +++ b/src/java-config-2 @@ -5,7 +5,6 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -from java_config_2 import __version__ from java_config_2.OutputFormatter import OutputFormatter from java_config_2.EnvironmentManager import EnvironmentManager from java_config_2.Errors import * @@ -22,7 +21,7 @@ except ImportError: from optparse import OptionParser, OptionGroup def version(option, opt, value, parser): - printer._print("%H%BJava Configuration Utility %GVersion " + str(__version__)) + printer._print("%H%BJava Configuration Utility %GVersion @PACKAGE_VERSION@") raise SystemExit() def nocolor(option, opt, value, parser): @@ -321,7 +320,7 @@ if __name__ == '__main__': manager = EnvironmentManager(os.getenv('ROOT', ''), os.getenv('EPREFIX', '@GENTOO_PORTAGE_EPREFIX@')) usage = "java-config [options]\n\n" - usage += "Java Configuration Utility Version " + str(__version__) + "\n" + usage += "Java Configuration Utility Version @PACKAGE_VERSION@\n" usage += "Copyright 2004-2013 Gentoo Foundation\n" usage += "Distributed under the terms of the GNU General Public License v2\n" usage += "Please contact the Gentoo Java Herd with problems." diff --git a/src/java_config_2/__init__.py b/src/java_config_2/__init__.py index b2e50bf..b30192a 100644 --- a/src/java_config_2/__init__.py +++ b/src/java_config_2/__init__.py @@ -1,5 +1 @@ -''' -java-config support files -''' - -__version__ = '2.1.12' +__version__ = '@PACKAGE_VERSION@' -- cgit v1.2.3-65-gdbad