Exemple #1
0
def all_sources(spec, topdir, check_package_names):
    """
    Get all sources defined in the spec file
    """
    spec = planex.spec.Spec(spec, topdir=topdir, check_package_name=check_package_names)
    urls = [urlparse.urlparse(url) for url in spec.source_urls()]
    return zip(spec.source_paths(), urls)
Exemple #2
0
def sources_from_spec(spec_path):
    """
    Extracts all source URLS from the spec file at spec_path.

    Returns a list of source URLs with RPM macros expanded.
    """
    spec = planex.spec.Spec(spec_path)
    return spec.source_urls()
def sources_from_spec(spec_path):
    """
    Extracts all source URLS from the spec file at spec_path.

    Returns a list of source URLs with RPM macros expanded.
    """
    spec = planex.spec.Spec(spec_path)
    return spec.source_urls()
Exemple #4
0
def sources_from_spec(spec_path, config):
    """
    Extracts all source URLS from the spec file at spec_path.

    Returns a list of source URLs with RPM macros expanded.
    """
    name_check = not config.no_package_name_check
    spec = planex.spec.Spec(spec_path, check_package_name=name_check)
    return spec.source_urls()
Exemple #5
0
def write_manifest(spec_fh, spec, link):
    """
    Record the URLs of all remote sources in the spec file
    """
    branch = link.get('branch')
    spec_fh.write("### manifest start\n")
    spec_fh.write("# %s\n" % link['URL'])

    for url in spec.source_urls():
        if '://' in url:
            if branch:
                url = url.replace("%{branch}", branch)
            spec_fh.write("# %s\n" % url)

    spec_fh.write("### manifest end\n")
Exemple #6
0
def checkout_remote_source(topdir, specname, dryrun):
    """
    Clone the respositories referred to in the source URLs
    """
    repos = []
    spec = planex.spec.Spec(specname, check_package_name=False)
    for url_str in spec.source_urls():
        url = urlparse.urlparse(url_str)
        if url.netloc != '':
            repo = planex.repository.Repository(url_str)
            if dryrun:
                print repo
            else:
                repo.clone(topdir)
            repos.append(repo)
    return repos