def do(args):
    """ Convert a binary archive into a qiBuild package. """
    name = args.name
    interactive = args.interactive
    package_path = args.package_path
    if args.conan:
        shared = None
        if args.shared or args.static:
            msg = "--conan-shared and --conan-static are mutualy exlusive, please remove one of them."
            assert args.shared != args.static, msg
        if args.shared is True:
            shared = True
        if args.static is True:
            shared = False
        conan = Conan(args.name, args.version, args.channels, shared)
        if not conan_json_exists(package_path):
            package_path = conan.create()
        ui.info("Converting Conan package", package_path,
                "into a qiBuild package")
        res = convert_from_conan(package_path, name, args.version)
    else:
        ui.info("Converting", package_path, "into a qiBuild package")
        res = convert_package(package_path, name, interactive=interactive)
    message = """Conversion succeeded.\n\nqiBuild package:\n  {0}\n
You can add this qiBuild package to a toolchain using:
  qitoolchain add-package -c <config name> {0}
  or
  qitoolchain add-package -t <toolchain name> {0}""".format(res)

    qisys.ui.info(message)
    return res
Example #2
0
def do(args):
    """ Import a binary package into a toolchain

    - Convert the binary package into a qiBuild package
    - Add the qiBuild package to the cache
    - Add the qiBuild package from cache to toolchain

    """
    name = args.name
    package_path = args.package_path
    converted_package_path = convert_package(package_path,
                                             name,
                                             interactive=args.interactive)
    toolchain = qitoolchain.parsers.get_toolchain(args)
    tc_packages_path = qitoolchain.toolchain.get_default_packages_path(
        toolchain.name)
    message = """
Importing '{1}' in the toolchain {0} ...
""".format(toolchain.name, package_path)
    qisys.ui.info(message)
    # installation of the qiBuild package
    package_dest = os.path.join(tc_packages_path, name)
    qisys.sh.rm(package_dest)
    with qisys.sh.TempDir() as tmp:
        extracted = qisys.archive.extract(converted_package_path,
                                          tmp,
                                          quiet=True,
                                          strict_mode=False)
        qisys.sh.install(extracted, package_dest, quiet=True)
    qibuild_package = qitoolchain.qipackage.QiPackage(name, path=package_dest)
    toolchain.add_package(qibuild_package)
    ui.info("done")
Example #3
0
def do(args):
    """ Import a binary package into a toolchain

    - Convert the binary package into a qiBuild package
    - Add the qiBuild package to the cache
    - Add the qiBuild package from cache to toolchain

    """
    name = args.name
    package_path = args.package_path
    converted_package_path = convert_package(package_path, name,
                                             interactive=args.interactive)
    toolchain = qitoolchain.parsers.get_toolchain(args)
    tc_packages_path = qitoolchain.toolchain.get_default_packages_path(toolchain.name)
    message = """
Importing '{1}' in the toolchain {0} ...
""".format(toolchain.name, package_path)
    qisys.ui.info(message)
    # installation of the qiBuild package
    package_dest = os.path.join(tc_packages_path, name)
    qisys.sh.rm(package_dest)
    with qisys.sh.TempDir() as tmp:
        extracted = qisys.archive.extract(converted_package_path, tmp, quiet=True,
                                          strict_mode=False)
        qisys.sh.install(extracted, package_dest, quiet=True)
    qibuild_package = qitoolchain.qipackage.QiPackage(name, path=package_dest)
    toolchain.add_package(qibuild_package)
    ui.info("done")
Example #4
0
def do(args):
    """Convert a binary archive into a qiBuild package.

    """
    name = args.name
    package_path = args.package_path
    ui.info("Converting", package_path, "into a qiBuild package")
    res = convert_package(package_path, name, interactive=True)
    message = """\
Conversion succeeded.

qiBuild package:
  {1}

You can add this qiBuild package to a toolchain using:
  qitoolchain add-package -c <toolchain name> {0} {1}\
""".format(name, res)
    qisys.ui.info(message)
Example #5
0
def do(args):
    """Convert a binary archive into a qiBuild package.

    """
    name = args.name
    interactive = args.interactive
    package_path = args.package_path
    ui.info("Converting", package_path, "into a qiBuild package")
    res = convert_package(package_path, name, interactive=interactive)
    message = """\
Conversion succeeded.

qiBuild package:
  {0}

You can add this qiBuild package to a toolchain using:
  qitoolchain add-package -c <toolchain name> {0}\
""".format(res)
    qisys.ui.info(message)
    return res