Ejemplo n.º 1
0
def install_contents(dn, contents=None):
    ''' Install contents (recursively) into dn['sandbox'] '''

    if contents is None:
        contents = dn.get('contents', [])

    log(dn, 'Installing contents\n', contents, verbose=True)

    shuffle(contents)
    for it in contents:
        item = app.defs.get(it)
        if os.path.exists(
                os.path.join(dn['sandbox'], 'baserock',
                             item['name'] + '.meta')):
            # content has already been installed
            log(dn, 'Already installed', item['name'], verbose=True)
            continue

        for i in item.get('contents', []):
            install_contents(dn, [i])

        if item.get('build-mode', 'staging') != 'bootstrap':
            if not get_cache(item):
                compose(item)
            sandbox.install(dn, item)

    if config.get('log-verbose'):
        log(dn, 'Added contents\n', contents)
        sandbox.list_files(dn)
Ejemplo n.º 2
0
def install_dependencies(defs, component):
    '''Install recursed dependencies of component into component's sandbox.'''

    def install(defs, component, dependencies):
        shuffle(dependencies)
        for it in dependencies:
            dependency = defs.get(it)
            if os.path.exists(os.path.join(component['sandbox'], 'baserock',
                                           dependency['name'] + '.meta')):
                # dependency has already been installed
                if app.config.get('log-verbose'):
                    app.log(component, 'Already installed', dependency['name'])
                continue

            install(defs, component, dependency.get('build-depends', []))
            if (it in component['build-depends']) or \
                (dependency.get('build-mode', 'staging') ==
                    component.get('build-mode', 'staging')):
                compose(defs, dependency)
                if dependency.get('contents'):
                    install(defs, component, dependency.get('contents'))
                sandbox.install(defs, component, dependency)

    component = defs.get(component)
    dependencies = component.get('build-depends', [])
    if app.config.get('log-verbose'):
        app.log(component, 'Installing dependencies\n', dependencies)
    install(defs, component, dependencies)
    if app.config.get('log-verbose'):
        sandbox.list_files(component)
Ejemplo n.º 3
0
def install_dependencies(dn, dependencies=None):
    '''Install recursed dependencies of dn into dn's sandbox.'''

    if dependencies is None:
        dependencies = dn.get('build-depends', [])

    log(dn, 'Installing dependencies\n', dependencies, verbose=True)
    shuffle(dependencies)
    for it in dependencies:
        dependency = app.defs.get(it)
        if os.path.exists(
                os.path.join(dn['sandbox'], 'baserock',
                             dependency['name'] + '.meta')):
            # dependency has already been installed
            log(dn, 'Already did', dependency['name'], verbose=True)
            continue

        install_dependencies(dn, dependency.get('build-depends', []))
        if (it in dn['build-depends']) or \
            (dependency.get('build-mode', 'staging') ==
                dn.get('build-mode', 'staging')):
            compose(dependency)
            if dependency.get('contents'):
                install_dependencies(dn, dependency['contents'])
            sandbox.install(dn, dependency)
    if config.get('log-verbose'):
        sandbox.list_files(dn)
Ejemplo n.º 4
0
def install_contents(defs, component):
    '''Install recursed contents of component into component's sandbox.'''

    def install(defs, component, contents):
        shuffle(contents)
        for it in contents:
            content = defs.get(it)
            if os.path.exists(os.path.join(component['sandbox'], 'baserock',
                                           content['name'] + '.meta')):
                # content has already been installed
                if app.config.get('log-verbose'):
                    app.log(component, 'Already installed', content['name'])
                continue
            install(defs, component, content.get('contents', []))
            compose(defs, content)
            if content.get('build-mode', 'staging') != 'bootstrap':
                sandbox.install(defs, component, content)

    component = defs.get(component)
    contents = component.get('contents', [])
    if app.config.get('log-verbose'):
        app.log(component, 'Installing contents\n', contents)
    install(defs, component, contents)
    if app.config.get('log-verbose'):
        sandbox.list_files(component)
Ejemplo n.º 5
0
def install_contents(dn, contents=None):
    ''' Install contents (recursively) into dn['sandbox'] '''

    if contents is None:
        contents = dn.get('contents', [])

    log(dn, 'Installing contents\n', contents, verbose=True)

    shuffle(contents)
    for it in contents:
        item = app.defs.get(it)
        if os.path.exists(os.path.join(dn['sandbox'],
                                       'baserock', item['name'] + '.meta')):
            # content has already been installed
            log(dn, 'Already installed', item['name'], verbose=True)
            continue

        for i in item.get('contents', []):
            install_contents(dn, [i])

        if item.get('build-mode', 'staging') != 'bootstrap':
            if not get_cache(item):
                compose(item)
            sandbox.install(dn, item)

    if config.get('log-verbose'):
        log(dn, 'Added contents\n', contents)
        sandbox.list_files(dn)
Ejemplo n.º 6
0
def install_dependencies(dn, dependencies=None):
    '''Install recursed dependencies of dn into dn's sandbox.'''

    if dependencies is None:
        dependencies = dn.get('build-depends', [])

    log(dn, 'Installing dependencies\n', dependencies, verbose=True)
    shuffle(dependencies)
    for it in dependencies:
        dependency = app.defs.get(it)
        if os.path.exists(os.path.join(dn['sandbox'], 'baserock',
                                       dependency['name'] + '.meta')):
            # dependency has already been installed
            log(dn, 'Already did', dependency['name'], verbose=True)
            continue

        install_dependencies(dn, dependency.get('build-depends', []))
        if (it in dn['build-depends']) or \
            (dependency.get('build-mode', 'staging') ==
                dn.get('build-mode', 'staging')):
            compose(dependency)
            if dependency.get('contents'):
                install_dependencies(dn, dependency['contents'])
            sandbox.install(dn, dependency)
    if config.get('log-verbose'):
        sandbox.list_files(dn)
Ejemplo n.º 7
0
def install_contents(defs, component, contents=None):
    ''' Install contents (recursively) into component['sandbox'] '''

    component = defs.get(component)
    if contents is None:
        contents = component.get('contents', [])

    log(component, 'Installing contents\n', contents, verbose=True)

    shuffle(contents)
    for it in contents:
        this = defs.get(it)
        if os.path.exists(
                os.path.join(component['sandbox'], 'baserock',
                             this['name'] + '.meta')):
            # content has already been installed
            log(component, 'Already installed', this['name'], verbose=True)
            continue

        if component.get('kind', 'chunk') == 'system':
            artifacts = []
            for content in component['contents']:
                if content.keys()[0] == this['path']:
                    artifacts = content[this['path']]
                    break

            if artifacts != [] or config.get('default-splits', []) != []:
                compose(defs, this)
                install_split_artifacts(defs, component, this, artifacts)
                continue

        for i in this.get('contents', []):
            install_contents(defs, component, [i])

        if this.get('build-mode', 'staging') != 'bootstrap':
            if not get_cache(defs, this):
                compose(defs, this)
            sandbox.install(defs, component, this)

    if config.get('log-verbose'):
        log(component, 'Added contents\n', contents)
        sandbox.list_files(component)
Ejemplo n.º 8
0
def install_contents(defs, component, contents=None):
    ''' Install contents (recursively) into component['sandbox'] '''

    component = defs.get(component)
    if contents is None:
        contents = component.get('contents', [])

    log(component, 'Installing contents\n', contents, verbose=True)

    shuffle(contents)
    for it in contents:
        this = defs.get(it)
        if os.path.exists(os.path.join(component['sandbox'],
                                       'baserock', this['name'] + '.meta')):
            # content has already been installed
            log(component, 'Already installed', this['name'], verbose=True)
            continue

        if component.get('kind', 'chunk') == 'system':
            artifacts = []
            for content in component['contents']:
                if content.keys()[0] == this['path']:
                    artifacts = content[this['path']]
                    break

            if artifacts != [] or config.get('default-splits', []) != []:
                compose(defs, this)
                install_split_artifacts(defs, component, this, artifacts)
                continue

        for i in this.get('contents', []):
            install_contents(defs, component, [i])

        if this.get('build-mode', 'staging') != 'bootstrap':
            if not get_cache(defs, this):
                compose(defs, this)
            sandbox.install(defs, component, this)

    if config.get('log-verbose'):
        log(component, 'Added contents\n', contents)
        sandbox.list_files(component)