Update embedded sysreqs
pkgdepends ships a bundled copy of the r-hub/r-system-requirements
database under inst/sysreqs/. At runtime pkgdepends
prefers a freshly-fetched cached copy, but falls back to this embedded one (see
sysreqs2_list_rules() in R/sysreqs2.R). This skill
refreshes the embedded copy to the current upstream HEAD.
Layout of inst/sysreqs/:
HEAD— the 40-char upstream commit hash the embedded copy was taken from, plus a trailing newline.VERSION— the schema version, matchingsysreqs_db_versioninR/sysreqs2.R.rules/*.json— a full mirror of the upstreamrules/directory (nothing is filtered out).
Steps
Clone the upstream repo (shallow) into a scratch/temp dir and read its HEAD:
git clone --depth 1 https://github.com/r-hub/r-system-requirements.git "$TMPDIR/r-system-requirements" git -C "$TMPDIR/r-system-requirements" rev-parse HEAD(A
failed to store: ...keychain warning during clone is harmless in the sandbox.)If that hash already matches
inst/sysreqs/HEAD, there is nothing to do — stop and report that it is up to date.Replace the rules and update HEAD (run from the repo root):
rm -rf inst/sysreqs/rules cp -R "$TMPDIR/r-system-requirements/rules" inst/sysreqs/rules printf '%s\n' "$(git -C "$TMPDIR/r-system-requirements" rev-parse HEAD)" > inst/sysreqs/HEADDo not touch
VERSIONunless the upstream JSON schema changed in a way that breaks parsing insysreqs2_match()/ needs different files. If it did, bump bothinst/sysreqs/VERSIONandsysreqs_db_versioninR/sysreqs2.Rto the same new value.Sanity-check the result:
ls inst/sysreqs/rules | grep -v '[.]json$' # expect no output (json only) git status --short inst/sysreqs # review added/modified/removed rulesReport the HEAD change (old → new) and a summary of added / modified / removed rules. Commit only if the user asks; the conventional message is
Update embedded sysreqs.