Files
Vijay Janapa Reddi 5a66c935f1 Fix book build failures and harden book checks
- Vol II: close the margin note wrapping the storage-compute figure,
  move the bandwidth figure out of its callout, and separate the NPU
  figure from the preceding footnote so all three cross-references
  resolve; widen Table 11.3 so it stays inside the page trim.
- Landing pages: hide the download card, star counter, and podcast from
  EPUB output and point the cover and podcast at shared/assets.
- Vol I/II frontmatter image paths, table column widths, Vol III
  equation labels, Vol IV lint fixes and SVG newline repairs, and
  regenerated volume bibliographies.
- Bibliography integrity scan ignores math spans; currency check skips
  render caches; Prentice Hall joins the canonical publisher list.
- Unprefixed chapter URLs publish redirect stubs to numbered pages.
- Remove stray test files, duplicate quiz files, unused cover options,
  generated figure lists, and outdated review scripts; drop generator
  metadata from quiz files.
- Repoint documentation at current chapter paths and deduplicate
  pre-commit file patterns.
2026-09-12 09:17:53 +02:00

38 lines
1.4 KiB
R

#!/usr/bin/env Rscript
# Library path and requireNamespace only. Do not source install_packages.R (re-runs install + tinytex).
# Docker/CI: R_LIBS_USER is ignored if the path does not exist, so we mirror install_packages.R
lib <- Sys.getenv("R_LIBS_USER", unset = NA_character_)
if (!is.na(lib) && nzchar(lib)) {
dir.create(lib, recursive = TRUE, showWarnings = FALSE)
.libPaths(c(lib, .libPaths()))
}
a <- commandArgs()
fa <- a[grepl("^--file=", a)]
script_dir <- if (length(fa)) {
normalizePath(dirname(sub("^--file=", "", fa[1])), mustWork = FALSE)
} else {
"."
}
# Docker: /tmp; local: repo locations (verify lives under binder/docker/linux/)
candidates <- c(
if (file.exists("/tmp/required_r_packages.R")) "/tmp/required_r_packages.R" else NULL,
file.path(script_dir, "required_r_packages.R"),
normalizePath(file.path(script_dir, "..", "tools", "dependencies", "required_r_packages.R"), mustWork = FALSE)
)
candidates <- candidates[file.exists(candidates)]
rpf <- if (length(candidates)) candidates[1] else {
stop("required_r_packages.R not found (checked /tmp, script dir, binder/tools/dependencies).", call. = FALSE)
}
source(rpf, local = FALSE)
missing_packages <- required_packages[!sapply(required_packages, requireNamespace, quietly = TRUE)]
if(length(missing_packages) > 0) {
cat('❌ Missing packages:', paste(missing_packages, collapse = ', '), '\n')
quit(status = 1)
} else {
cat('✅ All required R packages installed successfully\n')
}