Пример #1
0
def __install(app,
              app_name,
              app_version,
              install_directory,
              cache_directory,
              download_url,
              arguments):
    log.info('installing %s-%s' % (app_name, app_version))
    app_directory = '%s/%s' % (install_directory, app_name)
    if not os.path.exists(app_directory):
        os.makedirs(app_directory)

    final_directory = '%s/%s' % (app_directory, app_version)

    if os.path.exists(final_directory):
        raise Exception('%s-%s already installed' % (app_name, app_version))

    out_directory = '%s/%s' % (cache_directory, app_name)
    if os.path.exists(out_directory):
        shutil.rmtree(out_directory)
    os.makedirs(out_directory)

    retrieve(download_url, cache_directory, out_directory)

    final_directory = '%s/%s' % (app_directory, app_version)
    app.install(out_directory, final_directory, arguments)
Пример #2
0
    def install(self, download_directory, install_directory, arguments):
        AutoconfRecipe.install(self, download_directory, install_directory, arguments)
        
        # shall we install setuptools ? 
        if arguments.with_setuptools:
            fromurl = "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz"
            output_directory = '%s/setuptools' % download_directory
            retrieve(fromurl, download_directory, output_directory)

            os.chdir(output_directory)
            self.run('install', ['%s/bin/python' % install_directory,
                                 'setup.py',
                                 'install'])