Author: reinhard Date: 2009-10-31 18:27:20 -0500 (Sat, 31 Oct 2009) New Revision: 10031
Removed: trunk/gnue-common/setup.cfg.in Modified: trunk/gnue-common/setup.py trunk/gnue-common/src/base/setup.py Log: Removed setup.cfg.in so GNUe honors the standard Python install scheme. Deleted: trunk/gnue-common/setup.cfg.in =================================================================== --- trunk/gnue-common/setup.cfg.in 2009-10-31 22:58:19 UTC (rev 10030) +++ trunk/gnue-common/setup.cfg.in 2009-10-31 23:27:20 UTC (rev 10031) @@ -1,28 +0,0 @@ -# GNU Enterprise - Setup configuration for default installation -# -# Copyright 2001-2003 Free Software Foundation -# -# This file is part of GNU Enterprise. -# -# GNU Enterprise is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either -# version 3, or (at your option) any later version. -# -# GNU Enterprise is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with program; see the file COPYING. If not, -# write to the Free Software Foundation, Inc., 59 Temple Place -# - Suite 330, Boston, MA 02111-1307, USA. - -[install] - -# base directory for the installation -home = /usr/local/gnue - -# we install the scripts in /usr/local/bin so they are in $PATH -install_scripts = /usr/local/bin Modified: trunk/gnue-common/setup.py =================================================================== --- trunk/gnue-common/setup.py 2009-10-31 22:58:19 UTC (rev 10030) +++ trunk/gnue-common/setup.py 2009-10-31 23:27:20 UTC (rev 10031) @@ -102,12 +102,13 @@ # build in that case. # ----------------------------------------------------------------------------- -def build_svnrev(filename): +def build_svnrev(filename, dry_run): log.info("building svnrev.py") - output = open(filename, 'w') - output.write('svnrev = %r' % version.get_svn_revision('src')) - output.close() + if not dry_run: + output = open(filename, 'w') + output.write('svnrev = %r' % version.get_svn_revision('src')) + output.close() # ----------------------------------------------------------------------------- @@ -160,39 +161,7 @@ print "-" * 70 sys.exit(1) -# ----------------------------------------------------------------------------- -# Find out whether or not to use our setup.cfg -# ----------------------------------------------------------------------------- -have_prefix = 0 - -for arg in sys.argv: - if arg == "--prefix" or arg[:9] == "--prefix=" or \ - arg == "--home" or arg[:7] == "--home=": - have_prefix = 1 - -# Was setup.cfg specified on the command line? -setupcfg = "setup.cfg.in" -have_setupcfg = 0 -try: - index = sys.argv.index('--setup-cfg') - setupcfg = sys.argv[index + 1] - sys.argv.pop(index) - sys.argv.pop(index) - have_setupcfg = 1 - -except ValueError: - pass - -if (os.name == "posix" and not have_prefix and "install" in sys.argv) \ - or have_setupcfg: - os.system("cp %s setup.cfg" % setupcfg) -else: - try: - os.remove("setup.cfg") - except: - pass - # ============================================================================= # sdist: build files to be distributed first # ============================================================================= @@ -206,7 +175,7 @@ def make_release_tree(self, base_dir, files): distutils.command.sdist.sdist.make_release_tree(self, base_dir, files) self.__process_templates(base_dir) - build_svnrev(os.path.join(base_dir, 'src', 'svnrev.py')) + build_svnrev(os.path.join(base_dir, 'src', 'svnrev.py'), self.dry_run) def __process_templates(self, target): @@ -267,7 +236,7 @@ distutils.command.build.build.run(self) if not os.path.isfile("PKG-INFO"): build_svnrev(os.path.join(self.build_lib, 'gnue', 'common', - 'svnrev.py')) + 'svnrev.py'), self.dry_run) # ============================================================================= @@ -510,12 +479,4 @@ # Override certain command classes with our own ones cmdclass = {"sdist": sdist, "build": build, - "install": install, - }) - -# ----------------------------------------------------------------------------- -# Clean up -# ----------------------------------------------------------------------------- - -if os.path.isfile("setup.cfg"): - os.remove("setup.cfg") + "install": install}) Modified: trunk/gnue-common/src/base/setup.py =================================================================== --- trunk/gnue-common/src/base/setup.py 2009-10-31 22:58:19 UTC (rev 10030) +++ trunk/gnue-common/src/base/setup.py 2009-10-31 23:27:20 UTC (rev 10031) @@ -220,7 +220,8 @@ distutils.command.sdist.sdist.make_release_tree(self, base_dir, files) self.__process_templates(base_dir) - SETUP.build_svnrev(os.path.join(base_dir, 'src', 'svnrev.py')) + SETUP.build_svnrev(os.path.join(base_dir, 'src', 'svnrev.py'), + self.dry_run) # ------------------------------------------------------------------------- @@ -324,7 +325,7 @@ if not os.path.isfile("PKG-INFO"): SETUP.build_svnrev(os.path.join(self.build_lib, 'gnue', - SETUP.name[5:].lower(), 'svnrev.py')) + SETUP.name[5:].lower(), 'svnrev.py'), self.dry_run) # ============================================================================= @@ -519,7 +520,7 @@ # Create the svnrev.py file # ------------------------------------------------------------------------- - def build_svnrev(self, filename): + def build_svnrev(self, filename, dry_run): """ Create the file 'svnrev.py' which contains the current Subversion revision. @@ -528,9 +529,10 @@ """ log.info("building svnrev.py") - output = open(filename, 'w') - output.write('svnrev = %r' % version.get_svn_revision('src')) - output.close() + if not dry_run: + output = open(filename, 'w') + output.write('svnrev = %r' % version.get_svn_revision('src')) + output.close() # ------------------------------------------------------------------------- _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue