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 + '".')
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())
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')
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')
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)