Comment 4 for bug 538883

Revision history for this message
Kees Cook (kees) wrote :

My use-case is "download the build for Lucid's 'foo' package":

def get_build_url(pkg, release):
    series = ubuntu.getSeries(name_or_version=release)
    source = archive.getPublishedSources(status='Published', distro_series=series, pocket='Release', exact_match=True, source_name=pkg)
    for build in source_item.getBuilds():
        if build.arch_tag == arch:
            return build.build_log_url

This ends up not working, and instead I need to walk all publications in order to find the first time there is actually a build record:

    for src in archive.getPublishedSources(status='Published', exact_match=True, source_name=source.source_package_name):
        if src.source_package_version == source_item.source_package_version:
            for build in src.getBuilds():
                if build.arch_tag == arch:
                    return build.build_log_url

I guess this might be "by design", but that means that when prior releases vanish, so do the build records? Anyway, it's just wishlist really, since I can work around it; I was just hoping to speed up the queries.