Пример #1
0
def cmd_list(package_name, category=None):
    bundle = LibBundle()
    bundle.load(config.global_config().current_bundle())
    
    files = bundle.list_files(package_name, category)
    for n in files:
        print(n)
Пример #2
0
def cmd_new(path, toolchain, arch):
    fpath = path.format(p=config.os_name(), t=toolchain, a=arch)
    if fpath.split(os.sep)[0] == fpath:
        fpath = os.path.join(config.global_config().root_dir(), fpath)

    bundle = LibBundle()
    bundle.create(fpath, config.os_name(), toolchain, arch)

    cmd_set(fpath)
Пример #3
0
def cmd_info():
    bundle = LibBundle()
    bundle.load(config.global_config().current_bundle())
    
    print("Bundle: " + bundle.path)
    print("Toolchain: " + bundle.toolchain)
    print("Architecture: " + bundle.arch)
    print("\nInstalled:")
    for info in sorted(bundle.list_installed()):
        print("{0:<15}{1:<10}".format(info[0], info[1]))
Пример #4
0
def cmd_install(formula_spec, options):
    bundle = LibBundle()
    bundle.load(config.global_config().current_bundle())

    builder = FormulaBuilder(bundle)
    
    if options.interactive:
        def _start_shell():
            print("Type 'exit' to continue with the installation, 'exit 1' to abort")
            try:
                system.shell()
            except exceptions.CalledProcessError:
                raise exceptions.AbortOperation
        
        builder.add_hook(builder.hooks.pre_build, _start_shell)
    
    try:
        builder.install(formula_spec, options)
    except exceptions.AbortOperation:
        print("Installation Aborted")
Пример #5
0
def cmd_uninstall(package_name, keep_dependent=False):
    bundle = LibBundle()
    bundle.load(config.global_config().current_bundle())
    builder = FormulaBuilder(bundle)
    
    builder.uninstall(package_name, keep_dependent)