Skip to content

Commit 33ac969

Browse files
author
smeyer
committed
tweak checking for unexpected \bib* expansions
git-svn-id: https://svn.r-project.org/R/trunk@89408 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent aa690c3 commit 33ac969

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/library/tools/R/bibtools.R

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,21 +197,17 @@ function(dir)
197197

198198
if(basename(dir) %notin% .get_standard_package_names()$base) {
199199
## Check whether we got everything from the build stage
200-
## expansions.
200+
## expansions. Catch if built with \bib* stubs/unknowns.
201201
built_file <- file.path(dir, "build", "partial.rdb")
202202
if(!file.exists(built_file)) {
203203
u <- TRUE
204204
} else {
205205
y <- lapply(readRDS(built_file)[names(x)],
206206
.bibentries_cited_or_shown)
207-
## Cannot simply use identical() as entries in the partial
208-
## Rd db are subject to section re-ordering.
209-
## <FIXME>
210-
## Is this still true now that we go via .build_Rd_db()?
211-
## </FIXME>
212207
g <- function(u, v) {
213-
is.null(v) || # built with \bib stubs/unknowns in R < 4.6.0
214-
length(setdiff(split(u, row(u)), split(v, row(v)))) > 0L
208+
is.null(v) || # page not in partial.rdb (no build-stage macros)
209+
# or built with undefined macros
210+
sum(startsWith(v[,3L], "\\Sexpr")) != nrow(u)
215211
}
216212
if(any(unlist(Map(g, x, y), use.names = FALSE)))
217213
u <- TRUE

0 commit comments

Comments
 (0)