it's a recipe factory not an egg factory.
the eggs are from freerange hens ;-)

On Mon, Apr 19, 2010 at 05:32:17PM +0200, Martin Bähr wrote:
> the recipe is attached. it does load all the eggs, so all those
> addArchive calls are working, but it seems PythonSetup is never called.
> 
> i'd appeciate any pointers on what's wrong or missing.

turns out the problem was that a recipe class can not access files in
the source component (i wonder why) but a factory can.

so the aparent solution is to create a factory that loads the
versions.cfg file and makes it available to the class.

according to the example here:
http://docs.rpath.com/conary/Conaryopedia/sect-create_your_own_factory.html

the factory does nothing special other than loading the file and then
let the class use it.

as a result i came up with the most simple factory i could think of.
(see attachment)

the bulk of the work is still in the actual recipe class because some of
it is version specific, and since only one recipe uses the superclass
from the factory, it should not really matter much. 

however, this still does not work.

the problem now is that the factory class is not found.

i have checked in the factory here: 
http://www.rpath.org/web/repos/embee/troveInfo?t=factory-zope:source;v=/embee.rpath....@fl:2-devel/1.000:1.0-3

the actual package was created with: cvc newpkg zope --factory=zope
but cvc complains: 

error: unable to load recipe file /home/mbaehr/conary/eMBee/zope/zope.recipe:
Error in recipe file "zope.recipe":
 Traceback (most recent call last):
  File "/home/mbaehr/conary/eMBee/zope/zope.recipe", line 7, in ?
    class Zope(ZopeRecipe):
NameError: name 'ZopeRecipe' is not defined

greetings, martin.
-- 
cooperative communication with sTeam      -     caudium, pike, roxen and unix
searching contract jobs:  programming, training and administration - anywhere
--
pike programmer      working in china                   community.gotpike.org
foresight developer  (open-steam|caudium).org              foresightlinux.org
unix sysadmin        iaeste.at                                     realss.com
Martin Bähr          http://www.iaeste.or.at/~mbaehr/            is.schon.org
import ConfigParser

class ZopeFactory(Factory):

    name = 'factory-zope'
    version = '1.0'

    def getRecipeClass(self):

        packages = ConfigParser.RawConfigParser()
        packages.optionxform = str
        packages.readfp(self.openSourceFile('versions.cfg'))

        class ZopeRecipe(CPackageRecipe):
            pass

        return ZopeRecipe
class Zope(ZopeRecipe):
    name = 'zope'
    version = '3.4.0'

    buildRequires = [ 'python:runtime', 'PIL:python', 'PyQt:python',
        'Pyrex:python', 'gnome-python:python', 'pycrypto:python',
        'pygtk:python', 'python-setuptools:python',
        'python-twisted:python',
        'python-zopeinterface:python', 'python:tk', 'wxPython:python',
        'python:devel' ]

    def setup(r):
        package = ('zope.proxy', 'zip')
        r.addArchive('http://pypi.python.org/packages/source/%s/%s/%s-%s.%s' % 
(package[0][0], package[0], package[0], packages.get('versions', package[0]), 
package[1]), dir='%(name)s-%(version)s')
        r.PythonSetup(dir='%(name)s-%(version)s/'+package[0]+'-'+package[1])
        packages.remove_option('versions', package[0])

        packages.remove_option('versions', 'setuptools')
        packages.remove_option('versions', 'docutils') # is on sourceforge
        packages.set('versions', 'mechanize', '0.1.10') # older version is on 
sourceforge

        
[r.addArchive('http://pypi.python.org/packages/source/%s/%s/%s-%s.tar.gz' % 
(item[0][0], item[0], item[0], item[1]), dir='%(name)s-%(version)s') for item 
in  packages.items('versions')]
        [r.PythonSetup(dir='%(name)s-%(version)s/'+item[0]+'-'+item[1]) for 
item in  packages.items('versions')]
_______________________________________________
Foresight-devel mailing list
Foresight-devel@lists.rpath.org
http://lists.rpath.org/mailman/listinfo/foresight-devel

Reply via email to