示例#1
0
文件: cli.py 项目: mrvicadai/ubrew
def install(app, app_name, app_version, install_directory, cache_directory, arguments):
    available = app.available()
    versions = available.keys()
    versions = sort_versions(versions)
    
    if app_version == 'all':
        failed = False
        # lets attempt to install every available version
        for version in versions:
            download_url = available[version]['url']
            try:
                __install(app, app_name, version, install_directory, cache_directory, download_url, arguments)
            except Exception as e:
                failed = True
                log.error(str(e))
                pass

        if failed:
            sys.exit(1)

    elif app_version in versions:
        download_url = available[app_version]['url']
        __install(app, app_name, app_version, install_directory, cache_directory, download_url, arguments)
    else:
        print('version %s is unavailable.' % app_version)
        sys.exit(1)
示例#2
0
文件: app.py 项目: mrvicadai/ubrew
 def error(self, stepname, message):
     log.error(' %s: %s' % (stepname, message))