From f6a4b61d144191f436fb117e4d32d8ac61633027 Mon Sep 17 00:00:00 2001 From: Toshio くらとみ Date: Dec 02 2008 06:12:24 +0000 Subject: - Fix cheetah enough that it will pass its unittests on python-2.6. This has actually been broken since py-2.5 and this fix is only a workaround. --- diff --git a/cheetah-testing.patch b/cheetah-testing.patch deleted file mode 100644 index 03efa99..0000000 --- a/cheetah-testing.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: Cheetah-2.0.1/src/ImportManager.py -=================================================================== ---- Cheetah-2.0.1.orig/src/ImportManager.py -+++ Cheetah-2.0.1/src/ImportManager.py -@@ -407,7 +407,14 @@ class ImportManager: - __builtin__.__import__ = self.importHook - __builtin__.reload = self.reloadHook - -- def importHook(self, name, globals=None, locals=None, fromlist=None): -+ def importHook(self, name, globals=None, locals=None, fromlist=None, other=None): -+ log = open('/tmp/cheetah.log', 'a') -+ log.write( '**************\nimportHook: name:%s\n' % [name]) -+ log.write( 'importHook: globals:%s\n' % [globals]) -+ log.write( 'importHook: locals:%s\n' % [locals]) -+ log.write( 'importHook: fromlist:%s\n' % [fromlist]) -+ log.write( 'importHook: other:%s\n\n' % [other]) -+ log.close() - # first see if we could be importing a relative name - #print "importHook(%s, %s, locals, %s)" % (name, globals['__name__'], fromlist) - _sys_modules_get = sys.modules.get diff --git a/python-cheetah-import.patch b/python-cheetah-import.patch new file mode 100644 index 0000000..c0e5fa4 --- /dev/null +++ b/python-cheetah-import.patch @@ -0,0 +1,19 @@ +Index: Cheetah-2.0.1/src/ImportManager.py +=================================================================== +--- Cheetah-2.0.1.orig/src/ImportManager.py ++++ Cheetah-2.0.1/src/ImportManager.py +@@ -407,7 +407,13 @@ class ImportManager: + __builtin__.__import__ = self.importHook + __builtin__.reload = self.reloadHook + +- def importHook(self, name, globals=None, locals=None, fromlist=None): ++ def importHook(self, name, globals=None, locals=None, fromlist=None, level=None): ++ ### FIXME: We need to do something with the level argument instead of ++ # accepting it and not changing behaviour. ++ # Level decides whether to do relative, absolute, or both styles of ++ # import. See this for an explanation of values: ++ # http://www.python.org/doc/2.5.2/lib/built-in-funcs.html ++ + # first see if we could be importing a relative name + #print "importHook(%s, %s, locals, %s)" % (name, globals['__name__'], fromlist) + _sys_modules_get = sys.modules.get diff --git a/python-cheetah.spec b/python-cheetah.spec index aebf50f..ba062e9 100644 --- a/python-cheetah.spec +++ b/python-cheetah.spec @@ -9,7 +9,7 @@ Group: Development/Libraries License: MIT URL: http://cheetahtemplate.org/ Source: http://download.sourceforge.net/cheetahtemplate/Cheetah-%{version}.tar.gz -Patch0: cheetah-testing.patch +Patch0: python-cheetah-import.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -34,13 +34,12 @@ export CHEETAH_USE_SETUPTOOLS=1 %install rm -rf %{buildroot} export CHEETAH_USE_SETUPTOOLS=1 -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%{__python} setup.py install --skip-build --root %{buildroot} %check export PATH="%{buildroot}/%{_bindir}:$PATH" export PYTHONPATH="%{buildroot}/%{python_sitearch}" %{__python} %{buildroot}/%{python_sitearch}/Cheetah/Tests/Test.py -cat /tmp/cheetah.log %clean rm -rf %{buildroot} @@ -96,7 +95,9 @@ rm -rf %{buildroot} %changelog * Mon Dec 1 2008 Toshio Kuratomi - 2.0.1-4 -* +- Fix cheetah enough that it will pass its unittests on python-2.6. This has + actually been broken since py-2.5 and this fix is only a workaround. + * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.0.1-3 - Rebuild for Python 2.6