Exemplo n.º 1
0
def diff_in(ctx, working, path, **kwds):
    shed_target_source = kwds.get("shed_target_source", None)

    label_a = "_%s_" % (shed_target_source if shed_target_source else "local")
    shed_target = kwds.get("shed_target", "B")
    if "/" in shed_target:
        shed_target = "custom_shed"
    label_b = "_%s_" % shed_target

    mine = os.path.join(working, label_a)
    other = os.path.join(working, label_b)

    tsi = shed.tool_shed_client(ctx, read_only=True, **kwds)
    shed.download_tarball(
        ctx,
        tsi,
        path,
        destination=other,
        clean=True,
        **kwds
    )

    if shed_target_source:
        new_kwds = kwds.copy()
        new_kwds["shed_target"] = shed_target_source
        tsi = shed.tool_shed_client(ctx, read_only=True, **new_kwds)
        shed.download_tarball(
            ctx,
            tsi,
            path,
            destination=mine,
            clean=True,
            **new_kwds
        )
    else:
        tar_path = shed.build_tarball(path)
        cmd_template = 'mkdir "%s"; tar -xzf "%s" -C "%s"; rm -rf %s'
        shell(cmd_template % (mine, tar_path, mine, tar_path))

    cmd = 'cd "%s"; diff -r %s %s' % (working, label_a, label_b)
    if kwds["output"]:
        cmd += "> '%s'" % kwds["output"]
    shell(cmd)
Exemplo n.º 2
0
 def download(realized_repository):
     return shed.download_tarball(ctx, shed_context, realized_repository, **kwds)
Exemplo n.º 3
0
def cli(ctx, path, **kwds):
    """Download a tool repository as a tarball from the tool shed and extract
    to the specified directory.
    """
    tsi = shed.tool_shed_client(ctx, read_only=True, **kwds)
    shed.download_tarball(ctx, tsi, path, **kwds)
Exemplo n.º 4
0
 def download(realized_repository):
     return shed.download_tarball(ctx, shed_context, realized_repository,
                                  **kwds)
Exemplo n.º 5
0
def cli(ctx, path, **kwds):
    """Download a tool repository as a tarball from the tool shed and extract
    to the specified directory.
    """
    tsi = shed.tool_shed_client(ctx, read_only=True, **kwds)
    shed.download_tarball(ctx, tsi, path, **kwds)