예제 #1
0
def unpack_tarballs(sourcepackage, source, version, component_tarballs, options):
    tmpdir = tempfile.mkdtemp(dir='../')
    if not source.is_dir():  # Unpack main tarball
        source.unpack(tmpdir, options.filters)
        gbp.log.debug("Unpacked '%s' to '%s'" % (source.path, source.unpacked))

    if orig_needs_repack(source, options):
        gbp.log.debug("Filter pristine-tar: repacking '%s' from '%s'" % (source.path, source.unpacked))
        (source, tmpdir) = repack_upstream(source, sourcepackage, version, tmpdir, options.filters)

    if not source.is_dir():  # Unpack component tarballs
        for (component, tarball) in component_tarballs:
            unpack_component_tarball(source.unpacked, component, tarball, options.filters)
    return (source, tmpdir)
예제 #2
0
def unpack_tarballs(name, sources, version, options):
    tmpdir = tempfile.mkdtemp(dir='../')
    if not sources[0].is_dir():  # Unpack main tarball
        sources[0].unpack(tmpdir, options.filters)
        gbp.log.debug("Unpacked '%s' to '%s'" %
                      (sources[0].path, sources[0].unpacked))

    if orig_needs_repack(sources[0], options):
        gbp.log.debug("Filter pristine-tar: repacking '%s' from '%s'" %
                      (sources[0].path, sources[0].unpacked))
        # FIXME: we should repack the other tarballs here too (See #860457)
        # for that we better move around sources instead of source[0]
        (source, tmpdir) = repack_upstream(sources[0], name, version, tmpdir,
                                           options.filters)
        sources[0] = source

    if not sources[0].is_dir():  # Unpack component tarballs
        for s in sources[1:]:
            s.unpack(sources[0].unpacked, options.filters)
    return (sources, tmpdir)
예제 #3
0
def unpack_tarballs(repo, name, sources, version, options):
    tmpdir = tempfile.mkdtemp(dir='../')
    if not sources[0].is_dir():  # Unpack main tarball
        sources[0].unpack(tmpdir, options.filters)
        gbp.log.debug("Unpacked '%s' to '%s'" % (sources[0].path, sources[0].unpacked))

    try:
        postunpack_hook(repo, tmpdir, sources, options)
    except gbpc.CommandExecFailed:
        raise GbpError()  # The hook already printed an error message

    if orig_needs_repack(sources[0], options):
        gbp.log.debug("Filter pristine-tar: repacking '%s' from '%s'" % (sources[0].path,
                                                                         sources[0].unpacked))
        # FIXME: we should repack the other tarballs here too (See #860457)
        # for that we better move around sources instead of source[0]
        (source, tmpdir) = repack_upstream(sources[0], name, version, tmpdir, options.filters)
        sources[0] = source

    if not sources[0].is_dir():  # Unpack component tarballs
        for s in sources[1:]:
            s.unpack(sources[0].unpacked, options.filters)
    return (sources, tmpdir)