[Zope-Checkins] SVN: Zope/branches/2.9/ Zope 2's version.txt will from now on reside on the Zope2 package.

Philipp von Weitershausen philikon at philikon.de
Tue Dec 6 10:00:13 EST 2005


Log message for revision 40592:
  Zope 2's version.txt will from now on reside on the Zope2 package.
  The reason for that is because zpkg and distutils can't deal with arbitrary
  data files that don't belong to a certain package.
  

Changed:
  U   Zope/branches/2.9/inst/Makefile.in
  _U  Zope/branches/2.9/lib/python/
  UU  Zope/branches/2.9/lib/python/App/tests/test_version_txt.py
  UU  Zope/branches/2.9/lib/python/App/version_txt.py

-=-
Modified: Zope/branches/2.9/inst/Makefile.in
===================================================================
--- Zope/branches/2.9/inst/Makefile.in	2005-12-06 14:51:33 UTC (rev 40591)
+++ Zope/branches/2.9/inst/Makefile.in	2005-12-06 15:00:13 UTC (rev 40592)
@@ -45,7 +45,7 @@
            ${DISTUTILS_OPTS} build_ext ${BUILD_FLAGS}
 
 # install:     Install a software home.
-install: version_txt
+install:
 	${PYTHON} "${BASE_DIR}/setup.py" ${DISTUTILS_OPTS} \
 	   build_ext ${BUILD_FLAGS} \
 	   install --home="${PREFIX}" ${INSTALL_FLAGS}
@@ -91,10 +91,10 @@
 # version_txt: create a version file in lib/python/version.txt
 version_txt:
 	printf "Zope ${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}" >\
-          "${BASE_DIR}/lib/python/version.txt"
+          "${BASE_DIR}/lib/python/Zope2/version.txt"
 
 # Building a source distribution requires that zpkg be available:
-sdist:
+sdist: version_txt
 	${ZPKG} -C ${BASE_DIR}/releases/Zope2.cfg
 
 # clobber:     Make the source tree 'pristine' again.


Property changes on: Zope/branches/2.9/lib/python
___________________________________________________________________
Name: svn:ignore
   - *so
*.pyc
version.txt
build

   + *so
*.pyc
build


Modified: Zope/branches/2.9/lib/python/App/tests/test_version_txt.py
===================================================================
--- Zope/branches/2.9/lib/python/App/tests/test_version_txt.py	2005-12-06 14:51:33 UTC (rev 40591)
+++ Zope/branches/2.9/lib/python/App/tests/test_version_txt.py	2005-12-06 15:00:13 UTC (rev 40592)
@@ -11,23 +11,19 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+"""Tests of the version number extraction.
 
-"""Tests of the version number extraction."""
-
+$Id$
+"""
 import os
 import unittest
-
-import App.config
+import Zope2
 import App.version_txt
 
-
 class VersionTextTestCase(unittest.TestCase):
 
     def setUp(self):
-        self.cfg = App.config.getConfiguration()
-        self.old_swhome = self.cfg.softwarehome
-        self.cfg.softwarehome = os.path.dirname(__file__)
-        self.fn = os.path.join(self.cfg.softwarehome, "version.txt")
+        self.fn = os.path.join(os.path.dirname(Zope2.__file__), "version.txt")
         App.version_txt._test_reset()
 
     def tearDown(self):
@@ -35,8 +31,6 @@
             os.unlink(self.fn)
         except OSError:
             pass
-        self.cfg.softwarehome = self.old_swhome
-        App.config.setConfiguration(self.cfg)
 
     def writeVersion(self, s):
         f = open(self.fn, 'w')


Property changes on: Zope/branches/2.9/lib/python/App/tests/test_version_txt.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope/branches/2.9/lib/python/App/version_txt.py
===================================================================
--- Zope/branches/2.9/lib/python/App/version_txt.py	2005-12-06 14:51:33 UTC (rev 40591)
+++ Zope/branches/2.9/lib/python/App/version_txt.py	2005-12-06 15:00:13 UTC (rev 40592)
@@ -10,11 +10,13 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##############################################################################
+"""Extract Zope 2 version information
 
-import os,sys,re
+$id$
+"""
+import os, sys, re
+import Zope2
 
-from App.config import getConfiguration
-
 _version_string = None
 _zope_version = None
 
@@ -29,8 +31,7 @@
     if _version_string is None:
         v = sys.version_info
         pyver = "python %d.%d.%d, %s" % (v[0], v[1], v[2], sys.platform)
-        cfg = getConfiguration()
-        fn = os.path.join(cfg.softwarehome, 'version.txt')
+        fn = os.path.join(os.path.dirname(Zope2.__file__), 'version.txt')
         expr = re.compile(
             r'(?P<product>[A-Za-z0-9]+) +(?P<major>[0-9]+)'
             '\.(?P<minor>[0-9]+)\.(?P<micro>[0-9]+)'


Property changes on: Zope/branches/2.9/lib/python/App/version_txt.py
___________________________________________________________________
Name: svn:keywords
   + Id



More information about the Zope-Checkins mailing list