예제 #1
0
def _log(slug):
    from libsw import build_index
    if not slug:
        slug = build_index.select_slug('Select a package to view')
    slug = slug.lower()
    if not build_index.view_log(slug):
        print('No log file found for "' + slug + '".')
예제 #2
0
def _version(slug):
    from libsw import build_index
    if not slug:
        slug = build_index.select_slug(
            "Select a package to print it's version")
    slug = slug.lower()
    builder = build_index.get_builder(slug)
    print(builder.version_reference())
예제 #3
0
def _unfreeze(slug):
    from libsw import builder, build_index
    if not slug:
        slug = build_index.select_slug('Select a package to unfreeze')
    if builder.unfreeze(slug):
        print(slug + ' is no longer frozen')
    else:
        print(slug + ' was not in the frozen list')
예제 #4
0
def _freeze(slug):
    from libsw import builder, build_index
    slug_list = build_index.registered_slugs()
    if not slug:
        slug = build_index.select_slug('Select a package to freeze')
    if slug not in slug_list:
        print('Not a valid slug')
    else:
        if builder.freeze(slug):
            print('Froze ' + slug)
        else:
            print(slug + ' already frozen')
예제 #5
0
def _install_prebuilt(slug, more):
    if not slug:
        print('Please specify slug being installed')
    if not more:
        print('Please specify version being installed')
    from libsw import build_index, logger
    if not slug:
        slug = build_index.select_slug("Select a package to (re)install it")
    slug = slug.lower()
    builder = build_index.get_builder(slug)
    builder.source_version = more[0]
    with open(builder.log_name(), 'w+') as log_output:
        log = logger.Log(log_output)
        builder.install(log)