Esempio n. 1
0
                tarf = repo.get(src_package_name)
                if tarf == None:
                    utils.print_warning(
                        "warning: could not find package (%s)" %
                        src_package_name)
                dst_package = Package(dst_domain, src_package_name)
                try:
                    dst_package.install(tarf, None, None, False)
                except:
                    utils.print_warning(
                        "warning: could not install package (%s)" %
                        src_package_name)

        if clone_published:
            # populate with published
            for publish_platform in src_domain.get_published_platforms():
                src_published_map = src_domain.get_packages_with_state(
                    "published", publish_platform)
                for src_package_name, src_package in src_published_map.items():
                    if alt_src_domain:
                        # publish from alt src domain
                        src_package = Package(alt_src_domain, src_package_name)
                        utils.print_verbose(
                            "publishing package (%s) from alt src domain (%s)"
                            % (src_package_name, alt_src_domain.path))
                        if not src_package.exists():
                            utils.print_warning(
                                "warning: cannot find package in alternate source domain"
                            )
                            continue
                    elif src_package.domain.path == src_domain.path:
Esempio n. 2
0
                            domain_home, domain.get_label())

                    if output_type == "long":
                        for path in paths:
                            if find_type == "package":
                                package_name = path[len(domain_home) +
                                                    1:].split("/", 1)[0]
                                print "%s" % (package_name, )
                            else:
                                print "%s" % (path, )
                        if paths:
                            print
                    elif output_type == "summary":
                        fmt = "%-2s %-30s"
                        lines = []
                        published_platforms = domain.get_published_platforms()
                        for package_name in package_names:
                            package = Package(domain, package_name)
                            if package.platform in published_platforms:
                                for publish_platform in published_platforms:
                                    state = domain.get_package_state(
                                        package_name, publish_platform)
                                    if state in ["", "I"]:
                                        continue
                                    if package.platform == publish_platform:
                                        lines.append(fmt %
                                                     (state, package_name))
                                    else:
                                        lines.append(
                                            fmt %
                                            (state, "%s (%s)" %