chore(local): add S3 migration and CRAN-source helper scripts
- migrate-s3-hetzner-to-backblaze.sh: rclone-based bucket migration helper. - find-R-api-packages.sh: scan CRAN package sources for a C-API usage pattern. - query-pkgs-without-old-versions.R, test-package-loading.R: ad-hoc helpers.
This commit is contained in:
parent
3ae4672d66
commit
a9ad907f9c
1 changed files with 494 additions and 0 deletions
34
local/find-R-api-packages.sh
Normal file
34
local/find-R-api-packages.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Directory to clone repos into
|
||||
WORKDIR="cran_repos"
|
||||
mkdir -p "$WORKDIR"
|
||||
cd "$WORKDIR"
|
||||
|
||||
# GitHub API paginates results, so we loop through pages
|
||||
PAGE=1
|
||||
PER_PAGE=100
|
||||
MATCHES=()
|
||||
|
||||
while :; do
|
||||
# Fetch a page of repos
|
||||
REPOS=$(curl -s "https://api.github.com/orgs/cran/repos?per_page=$PER_PAGE&page=$PAGE" | jq -r '.[].clone_url')
|
||||
[ -z "$REPOS" ] && break
|
||||
|
||||
for REPO_URL in $REPOS; do
|
||||
REPO_NAME=$(basename "$REPO_URL" .git)
|
||||
# Skip if already cloned
|
||||
[ -d "$REPO_NAME" ] && continue
|
||||
git clone --depth 1 "$REPO_URL" "$REPO_NAME" >/dev/null 2>&1
|
||||
if [ -d "$REPO_NAME/src" ]; then
|
||||
# Search for Rinternals.h in src/
|
||||
if grep -r -q 'R_VERSION < R_Version(' "$REPO_NAME/src"; then
|
||||
echo "$REPO_NAME"
|
||||
fi
|
||||
fi
|
||||
# Clean up to save space
|
||||
rm -rf "$REPO_NAME"
|
||||
done
|
||||
|
||||
PAGE=$((PAGE + 1))
|
||||
done
|
||||
Loading…
Reference in a new issue