Ejemplo n.º 1
0
                raise Exception()
    except SystemExit:
        raise
    except:
        if globls.debug:
            traceback.print_exc()
        utils.print_exit("error: bad/missing argument(s)")

    if not package_name:
        utils.print_exit("error: missing package name")

    try:
        domain = Domain(domain_home)
        if not domain.is_compatible():
            utils.print_exit(MSG_INCOMPATIBLE_DOMAIN)
        package = Package(domain, package_name)
        if publish_platform == None:
            _, _, publish_platform = package.name.split("_", 2)
        if not domain.is_published(package_name, publish_platform) and not globls.force:
            utils.print_exit("error: package not published")
        domain.unpublish_package(package, publish_platform)
    except SystemExit:
        raise
    except utils.SSMExitException, detail:
        utils.print_exit(detail)
    except:
        if globls.debug:
            traceback.print_exc()
        utils.print_exit("error: operation failed")
    sys.exit(0)
Ejemplo n.º 2
0
                        # same domain
                        utils.print_verbose(
                            "publishing package (%s) from src domain (%s)" %
                            (src_package_name, src_domain.path))
                        dst_package = Package(dst_domain, src_package_name)
                    else:
                        # other domain
                        utils.print_verbose(
                            "publishing package (%s) from alt src domain (%s)"
                            % (src_package_name, src_package.domain.path))
                        dst_package = src_package

                    if dst_domain.is_published(src_package_name,
                                               publish_platform):
                        if republish:
                            dst_domain.unpublish_package(
                                dst_package, published_platform)
                        else:
                            utils.print_warning(
                                "warning: skipping published package (%s)" %
                                (src_package_name, ))
                            continue
                    dst_domain.publish_package(dst_package, publish_platform)

        # set frozen?
        if src_domain.is_frozen():
            utils.print_verbose("freezing domain (%s)" % dst_domain_home)
            dst_domain.freeze()
    except SystemExit:
        raise
    except utils.SSMExitException, detail:
        utils.print_exit(detail)
Ejemplo n.º 3
0
            utils.print_exit("error: cannot find domain (%s)" % publish_domain)
        package = Package(domain, package_name)
        publish_platform = publish_platform or package.platform

        # check for package
        if not package.domain.is_installed(package_name):
            utils.print_exit("error: cannot find package (%s)" % package_name)

        # unpublish named package if necessary
        if publish_domain.is_published(package_name, publish_platform):
            if skip_on_published:
                utils.print_exit("skipping published package", 0)
            if not globls.force and not globls.auto_yes:
                if utils.prompt("unpublish current package (y/n)?").lower() not in ["y"]:
                    utils.print_exit("operation aborted")
            publish_domain.unpublish_package(package, publish_platform)

        # unpublish "similar" package
        for pp_path in publish_domain.get_published(publish_platform):
            pp_name = os.path.basename(pp_path)
            if package.is_similar(pp_name):
                publish_domain.unpublish_package(Package(domain, pp_name), publish_platform)

        # ready to publish
        publish_domain.publish_package(package, publish_platform)
    except SystemExit:
        raise
    except utils.SSMExitException, detail:
        utils.print_exit(detail)
    except:
        if globls.debug: