Пример #1
0
def checkout(package):
    with tdir() as path:
        with cd(path):
            if package['type'] == "source":
                safe_run(["dget", "-u", "-d", package['source']['dsc_url']])
                yield package['source']['dsc_filename']
            elif package['type'] == "binary":
                files = []
                for deb in package['binary']['debs']:
                    files += [deb['filename']]
                    safe_run(["dget", "-u", "-d", deb['url']])
                yield files
            else:
                raise Exception
Пример #2
0
def checkout(package):
    with tdir() as path:
        with cd(path):
            if package['type'] == "source":
                safe_run(["dget", "-u", "-d", package['source']['dsc_url']])
                yield package['source']['dsc_filename']
            elif package['type'] == "binary":
                files = []
                for deb in package['binary']['debs']:
                    files += [deb['filename']]
                    safe_run(["dget", "-u", "-d", deb['url']])
                yield files
            else:
                raise Exception
Пример #3
0
def checkout(job, package):
    with tdir() as path:
        with cd(path):
            server_info = proxy.get_info()
            src = package["source"]
            archive = "{url}/{group}".format(url=server_info["repo"]["base"], group=src["group"])
            if package["type"] == "source":
                yield aget(archive, src["suite"], "main", src["name"], src["version"])
            elif package["type"] == "binary":
                arch = job["arch"]
                if arch == "all":
                    arch = "amd64"  # XXX: THIS IS A HACK. FIX THIS.
                yield bget(archive, src["suite"], "main", arch, src["name"], src["version"])
            else:
                raise Exception
Пример #4
0
def fetch_and_upload(dist, source, version, **kwargs):
    from . import DEFAULT_MIRROR
    confFile = "/etc/debile-rebuild.ini"
    config = configparser.ConfigParser({'mirror': DEFAULT_MIRROR})
    if not os.path.isfile(confFile):
        raise Exception("Could not find " + confFile)
    config.read([confFile])
    gpg = config.get('config', 'signing-key')
    target = config.get('config', 'dput-target')
    mirror = config.get('config', 'mirror')

    eversion = version
    if ":" in eversion:
        _, eversion = version.rsplit(":", 1)

    if "incoming.debian.org" == mirror:
        DSC_URL = (
            "http://{mirror}/{source}_{version}.dsc".format(
                source=source,
                version=eversion,
                mirror=mirror,
            ))
    else:
        path = pool_path(source)
        DSC_URL = (
            "http://{mirror}/debian/pool/main/"
            "{path}/{source}_{version}.dsc".format(
                path=path,
                source=source,
                version=eversion,
                mirror=mirror,
            ))

    with tdir() as pth:
        with cd(pth):
            _, err, ret = run_command(['dget', '-u', DSC_URL])
            if ret == 0:
                dsc = os.path.basename(DSC_URL)
                try:
                    changes = write_changes(dsc, dist, **kwargs)
                except MissingChangesFieldException as e:
                    print('Could not issue rebuild. Missing Changes'
                          'Field: {0}'.format(e.value))
                else:
                    out, err = run(['debsign', '-k%s' % gpg, changes])
                    out, err = run(['dput', target, changes])
            else:
                print('Could not download %s' % DSC_URL)
Пример #5
0
def checkout(job, package):
    with tdir() as path:
        with cd(path):
            src = package['source']
            archive = package['group']['repo_url']
            if package['type'] == "source":
                yield aget(archive, src['suite'], src['component'],
                           src['name'], src['version'])
            elif package['type'] == "binary":
                arch = job['arch']
                if arch == 'all':
                    arch = 'amd64'  # XXX: THIS IS A HACK. FIX THIS.
                yield bget(archive, src['suite'], src['component'],
                           arch, src['name'], src['version'])
            else:
                raise Exception
Пример #6
0
def checkout(job, package):
    with tdir() as path:
        with cd(path):
            src = package['source']
            archive = proxy.get_archive_location(src['group'])
            if package['type'] == "source":
                yield aget(archive, src['suite'], 'main',
                           src['name'], src['version'])
            elif package['type'] == "binary":
                arch = job['arch']
                if arch == 'all':
                    arch = 'amd64'  # XXX: THIS IS A HACK. FIX THIS.
                yield bget(archive, src['suite'], 'main',
                           arch, src['name'], src['version'])
            else:
                raise Exception
Пример #7
0
def fetch_and_upload(dist, source, version, **kwargs):
    from . import DEFAULT_MIRROR
    confFile = "/etc/debile-rebuild.ini"
    config = configparser.ConfigParser({'mirror': DEFAULT_MIRROR})
    if not os.path.isfile(confFile):
        raise Exception("Could not find " + confFile)
    config.read([confFile])
    gpg = config.get('config', 'signing-key')
    target = config.get('config', 'dput-target')
    mirror = config.get('config', 'mirror')

    eversion = version
    if ":" in eversion:
        _, eversion = version.rsplit(":", 1)

    if "incoming.debian.org" == mirror:
        DSC_URL = ("http://{mirror}/{source}_{version}.dsc".format(
            source=source,
            version=eversion,
            mirror=mirror,
        ))
    else:
        path = pool_path(source)
        DSC_URL = ("http://{mirror}/debian/pool/main/"
                   "{path}/{source}_{version}.dsc".format(
                       path=path,
                       source=source,
                       version=eversion,
                       mirror=mirror,
                   ))

    with tdir() as pth:
        with cd(pth):
            _, err, ret = run_command(['dget', '-u', DSC_URL])
            if ret == 0:
                dsc = os.path.basename(DSC_URL)
                try:
                    changes = write_changes(dsc, dist, **kwargs)
                except MissingChangesFieldException as e:
                    print('Could not issue rebuild. Missing Changes'
                          'Field: {0}'.format(e.value))
                else:
                    out, err = run(['debsign', '-k%s' % gpg, changes])
                    out, err = run(['dput', target, changes])
            else:
                print('Could not download %s' % DSC_URL)
Пример #8
0
def checkout(package):
    proxy = get_proxy()
    _type = package['type']
    if _type not in ['binary', 'source']:
        raise ValueError("type sucks")

    def source():
        url = proxy.get_dsc_url(package['source_id'])
        dsc = os.path.basename(url)
        dget(url)
        yield dsc

    def binary():
        url = proxy.get_deb_url(package['binary_id'])
        deb = os.path.basename(url)
        out, err, ret = run_command(['wget', url])
        if ret != 0:
            raise Exception("zomgwtf")
        yield deb

    with tdir() as where:
        with cd(where):
            for x in {"source": source, "binary": binary}[_type]():
                yield x