Skip to content

Commit

Permalink
better handle adding packages from regular repos
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhelmus committed Oct 19, 2023
1 parent 3f72688 commit 7dec95f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions utils/make_repos.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,20 @@ packageOrigRepos <- c(BiocManager::repositories())
packageDB <- pkgAvail(repos = packageOrigRepos, type = "win.binary")
packageDB <- addPkgListingGH(packageDB, dependencies)

getPkgDeps <- function(pkgs)
getPkgDeps <- function(pkgs, onlyGH)
{
ret <- names(pkgs)
if (onlyGH)
ret <- ret[sapply(pkgs, "[[", "type") == "gh"]
for (md in pkgs)
{
if (!is.null(md[["deps"]]))
ret <- c(ret, getPkgDeps(md$deps))
ret <- c(ret, getPkgDeps(md$deps, onlyGH))
}
return(ret)
}

allDependencyNames <- getPkgDeps(dependencies)
allDependencyNames <- getPkgDeps(dependencies, onlyGH = FALSE)
packagesForRepos <- pkgDep(allDependencyNames, availPkgs = packageDB, repos = packageOrigRepos,
type = "win.binary", suggests = FALSE)

Expand All @@ -81,7 +83,7 @@ if (file.exists(packagesFile))

removedPackages <- setdiff(packages, packagesForRepos)
newPackages <- setdiff(packagesForRepos, packages)
newPackages <- setdiff(newPackages, allDependencyNames)
newPackages <- setdiff(newPackages, getPkgDeps(dependencies, onlyGH = TRUE))

# will be re-added
# removedPackages <- union(removedPackages, localPackages)
Expand Down

0 comments on commit 7dec95f

Please sign in to comment.