~gary/zc.buildout/python-support-6-egg-control

« back to all changes in this revision

Viewing changes to src/zc/buildout/buildout.py

  • Committer: gary
  • Date: 2010-02-10 14:15:47 UTC
  • Revision ID: svn-v4:62d5b8a3-27da-0310-9561-8e5933582275:zc.buildout/branches/gary-2:108899
merge of gary-2-bootstrap-changes into trunk, resolving lots of conflicts with the distribute changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
338
338
 
339
339
        self._setup_directories()
340
340
 
 
341
        options = self['buildout']
 
342
 
 
343
        # Get a base working set for our distributions that corresponds to the
 
344
        # stated desires in the configuration.
 
345
        distributions = ['setuptools', 'zc.buildout']
 
346
        if options.get('offline') == 'true':
 
347
            ws = zc.buildout.easy_install.working_set(
 
348
                distributions, options['executable'],
 
349
                [options['develop-eggs-directory'], options['eggs-directory']]
 
350
                )
 
351
        else:
 
352
            ws = zc.buildout.easy_install.install(
 
353
                distributions, options['eggs-directory'],
 
354
                links=self._links,
 
355
                index=options.get('index'),
 
356
                executable=options['executable'],
 
357
                path=[options['develop-eggs-directory']],
 
358
                newest=self.newest,
 
359
                allow_hosts=self._allow_hosts
 
360
                )
 
361
 
341
362
        # Now copy buildout and setuptools eggs, and record destination eggs:
342
363
        entries = []
343
364
        for name in 'setuptools', 'zc.buildout':
344
365
            r = pkg_resources.Requirement.parse(name)
345
 
            dist = pkg_resources.working_set.find(r)
 
366
            dist = ws.find(r)
346
367
            if dist.precedence == pkg_resources.DEVELOP_DIST:
347
368
                dest = os.path.join(self['buildout']['develop-eggs-directory'],
348
369
                                    name+'.egg-link')
362
383
        ws = pkg_resources.WorkingSet(entries)
363
384
        ws.require('zc.buildout')
364
385
        zc.buildout.easy_install.scripts(
365
 
            ['zc.buildout'], ws, sys.executable,
366
 
            self['buildout']['bin-directory'])
 
386
            ['zc.buildout'], ws, options['executable'],
 
387
            options['bin-directory'])
367
388
 
368
389
    init = bootstrap
369
390