Skip to contents

These functions should be used after a Bioconductor Release. They ensure that the local repositories are in sync with Bioconductor. For convenience, the singular update_local_repo function will update a single local repository on the user's system. The function checks repositories against the available.packages() in the Bioconductor owned BiocManager::repositories().

Usage

update_local_repos(
  repos_dir,
  release = bioc_release_yaml(),
  username,
  org = username,
  set_upstream = "origin/devel",
  restart_from = character(0L),
  BPPARAM = NULL
)

update_local_repo(
  repo_dir,
  release,
  set_upstream = "origin/devel",
  org = "Bioconductor"
)

Arguments

repos_dir

character(1) The base directory where all packages / repositories exist for the user

release

character(1) The Bioconductor release version, as "RELASE_X_Y", to use for updating the local repositories. By default, the value of bioc_release_yaml(). In update_local_repo, the release branch is only created locally when release is provided.

username

character(1) (optional) The GitHub username used in the query to check default packages

org

character(1) The organization for which to extract the names of the repositories on GitHub (default "Bioconductor").

set_upstream

character(1) The remote location that will be tracked by the local branch, either "origin/devel" (default) or "upstream/devel"

restart_from

character(1) The name of a package found in repos_dir that should be used as the starting point for updating the local repos in case that the process was interrupted due to merge conflicts etc. Default character(0L).

BPPARAM

BiocParallelParam An optional BiocParallelParam instance defining the parallel back-end to be used during evaluation. Default NULL.

repo_dir

character(1) The full path to a single package / repository whose default branch should be updated

Details

The update_local_repos function will update all local repositories in the repos_dir directory that are found in either the users or organization's GitHub repository. The function syncs the devel and current release branches from both the origin (GH) and upstream (Bioconductor) remotes. If a upstream remote is not set, the function will set it to the Bioconductor git server. Finally, the function sets origin/devel as the remote branch to track with the set_upstream argument. Fetches use the command-line git client with SSH connection and keep-alive timeouts, and are retried up to 3 times; merges are local and stop on conflicts.

Examples

if (interactive()) {
    ## add PAT credentials
    gitcreds::gitcreds_set()
    ## update multiple packages at a time
    update_local_repos(
        repos_dir = "~/bioc/",
        org = "Bioconductor",
        release = "RELEASE_3_20"
    )

    ## update a single package
    update_local_repo(
        "~/bioc/AnnotationHub",
        release = bioc_release_yaml(),
        org = "Bioconductor"
    )
    setwd("~/bioc/AnnotationHub")
    update_local_repo(
        ".",
        release = bioc_release_yaml(),
        org = "Bioconductor"
    )
}