|
| 1 | +generateMetaDbs <- function(outgoing_path, db_filepath) { |
| 2 | + |
| 3 | + meat_dir <- Sys.getenv("BBS_MEAT_PATH") |
| 4 | + bbs_central_rdir <- Sys.getenv("BBS_CENTRAL_RDIR") |
| 5 | + prop_status <- read.dcf(file.path(bbs_central_rdir, db_filepath)) |
| 6 | + |
| 7 | + pkgs <- c() |
| 8 | + for (i in 1:dim(prop_status)[2]) { |
| 9 | + pkg_type_stage <- strsplit(colnames(prop_status)[i], "#")[[1]] |
| 10 | + if ("source" %in% pkg_type_stage && |
| 11 | + strsplit(prop_status[i], ",")[[1]][1] %in% c("YES", "UNNEEDED")) { |
| 12 | + pkgs <- c(pkgs, pkg_type_stage[1]) |
| 13 | + } |
| 14 | + } |
| 15 | + |
| 16 | + # Because the location is always recreated, we always create the Meta |
| 17 | + # directory and always create all the databases |
| 18 | + web_dir <- file.path(bbs_central_rdir, "web", "packages") |
| 19 | + meta_dir <- file.path(bbs_central_rdir, "OUTGOING", "Meta") |
| 20 | + dir.create(meta_dir, recursive = TRUE) |
| 21 | + |
| 22 | + biocViews::build_db_from_source(file.path(meat_dir, pkgs), bbs_central_rdir) |
| 23 | + |
| 24 | + aliases_db_file <- file.path(meta_dir, "aliases.rds") |
| 25 | + biocViews::build_meta_aliases_db(web_dir, aliases_db_file, TRUE) |
| 26 | + |
| 27 | + rdxrefs_db_file <- file.path(meta_dir, "rdxrefs.rds") |
| 28 | + biocViews::build_meta_rdxrefs_db(web_dir, rdxrefs_db_file, TRUE) |
| 29 | +} |
0 commit comments