Example #1
0
def get_conan_remotes(username, kwargs):
    remotes = None
    if "remotes" not in kwargs:
        remotes = os.getenv("CONAN_REMOTES")
        if remotes:
            remotes = remotes.split(',')
            for remote in reversed(remotes):
                if '@' in remote:
                    remote = RemotesManager._get_remote_from_str(
                        remote, var_name=remote)
        else:
            # While redundant, this moves upload remote to position 0.
            remotes = [get_conan_upload(username)]
            # Add bincrafters repository for other users, e.g. if the package would
            # require other packages from the bincrafters repo.
            bincrafters_user = BINCRAFTERS_USERNAME
            if username != bincrafters_user:
                remotes.append(get_conan_upload(bincrafters_user))

            # Force Bincrafters repo on remotes
            if BINCRAFTERS_REPO_URL not in remotes:
                remotes.append(BINCRAFTERS_REPO_URL)

    kwargs["remotes"] = remotes
    return kwargs
Example #2
0
def get_conan_remotes(configuration, username, kwargs):
    remotes = None
    if "remotes" not in kwargs:
        remotes = []
        remotes_env = os.getenv("CONAN_REMOTES")
        if remotes_env:
            remotes_env = remotes_env.split(',')
            for remote in reversed(remotes_env):
                if '@' in remote:
                    remotes.append(
                        RemotesManager._get_remote_from_str(remote,
                                                            var_name=remote))

        remotes.append(configuration["upload_remote"])
        for i in configuration["remotes"]:
            remotes.append(i)

    kwargs["remotes"] = remotes
    return kwargs