From 6a120e397e90c3193ed296327a43c086ea30fba9 Mon Sep 17 00:00:00 2001 From: LiNk-NY Date: Sat, 24 May 2025 11:14:38 -0400 Subject: [PATCH 1/3] add Roxygen version --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 5f8f910..1527b64 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,3 +30,4 @@ Collate: AllClasses.R AllGenerics.R as-methods.R htmlDoc-methods.R VignetteBuilder: knitr RoxygenNote: 7.3.2 Encoding: UTF-8 +RoxygenNote: 7.3.2 From f28836c828db433c6554d1968c336cef7ae8837f Mon Sep 17 00:00:00 2001 From: LiNk-NY Date: Fri, 10 Feb 2023 14:55:48 -0500 Subject: [PATCH 2/3] add hasAuthorsAtR field in dbMat --- R/repository.R | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/R/repository.R b/R/repository.R index 1eaf76e..f5d5866 100644 --- a/R/repository.R +++ b/R/repository.R @@ -449,6 +449,22 @@ getFileExistsAttr <- function(pkgList, reposRootPath, dir, filename) { })) } +DESCfieldExistsAttr <- function(pkgList, reposRootPath, field) { + vapply( + pkgList, + function(pkg) { + filedir <- file.path(reposRootPath, pkg) + file <- file.path(filedir, "DESCRIPTION") + result <- file.exists(file) + if (result) { + field <- as.character(read.dcf(file, fields = field)) + result <- !is.na(field) && identical(length(field), 1L) + } + result + }, logical(1L) + ) +} + getFileLinks <- function(pkgList, reposRootPath, vignette.dir, ext, ignore.case=FALSE) { if (length(pkgList) == 0L) @@ -720,6 +736,8 @@ write_VIEWS <- function(reposRootPath, fields = NULL, install <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "install", "INSTALL") license <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "licenses", "LICENSE") + authorsr <- + DESCfieldExistsAttr(dbMat[, "Package"], reposRootPath, "Authors@R") # add additional values to matrix for writing dbMat <- cbind(dbMat, allVigs) @@ -729,9 +747,10 @@ write_VIEWS <- function(reposRootPath, fields = NULL, dbMat <- cbind(dbMat, install) dbMat <- cbind(dbMat, license) dbMat <- cbind(dbMat, rfiles) + dbMat <- cbind(dbMat, authorsr) colnames(dbMat) <- c(fldNames, "vignettes", "vignetteTitles", "hasREADME", - "hasNEWS", "hasINSTALL", "hasLICENSE", "Rfiles") + "hasNEWS", "hasINSTALL", "hasLICENSE", "Rfiles", "hasAuthorsAtR") # get reverse dependency list including CRAN all_repos <- repositories() From 45a73a756d25a125157ce55520dc2ddb5ac5fed9 Mon Sep 17 00:00:00 2001 From: LiNk-NY Date: Fri, 5 Dec 2025 12:57:37 -0500 Subject: [PATCH 3/3] check identical first before is.na --- R/repository.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/repository.R b/R/repository.R index f5d5866..dbc26b9 100644 --- a/R/repository.R +++ b/R/repository.R @@ -458,7 +458,7 @@ DESCfieldExistsAttr <- function(pkgList, reposRootPath, field) { result <- file.exists(file) if (result) { field <- as.character(read.dcf(file, fields = field)) - result <- !is.na(field) && identical(length(field), 1L) + result <- identical(length(field), 1L) && !is.na(field) } result }, logical(1L)