Fetch TinyTeX URLs dynamically from GitHub releases API - #7
Merged
Conversation
Gli URL di TinyTeX erano scritti a mano (TinyTeX-1.zip sui tag "daily" e "latest", più il redirect di yihui.org). Le release di tinytex-releases ora allegano archivi con la versione nel nome (TinyTeX-1-v2025.08.zip), quindi tutte e tre le fonti rispondevano 404 e l'installazione falliva: senza distribuzione, anche la pagina Pacchetti restava inutilizzabile. Ora gli indirizzi si ricavano dall'API delle release: fra gli allegati con l'estensione della piattaforma si preferisce TinyTeX-1, poi le altre varianti, scorrendo le release dalla più recente. Gli URL fissi restano solo come riserva se l'API non è raggiungibile. In più: il nome dell'archivio temporaneo segue la piattaforma e non l'URL (è quello che decide come estrarlo), gli archivi sospetti sotto 1 MB sono scartati come fonti non valide, e il messaggio d'errore finale spiega come usare TEXFORGE_TINYTEX_URL. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017W5az9Prp2cseUs6W4zi2N
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored TinyTeX download mechanism to dynamically fetch available releases from the GitHub API instead of relying on hardcoded URLs. This makes the installation more resilient to naming scheme changes and new release formats.
Key Changes
urlDalleRelease()function that queries the GitHub API (/repos/rstudio/tinytex-releases/releases) to discover available TinyTeX archivesordineVarianteTinyTeX()to intelligently select the "TinyTeX-1" variant (medium installation) from available releases, handling both versioned and unversioned filenamesTINYTEX_URLtoTINYTEX_URL_RISERVAand repositioned it as a last-resort fallback when the API is unreachableTEXFORGE_TINYTEX_URLenvironment variableTinyTeX.zip,TinyTeX.tgz,TinyTeX.tar.gz) to handle varying URL schemesscaricaTesto()to fetch small JSON resources with redirect support and proper GitHub API headersImplementation Details
risolviCandidati()function orchestrates the resolution strategy: environment variable → API results → fallback URLsTEXFORGE_TINYTEX_URLoverridehttps://claude.ai/code/session_017W5az9Prp2cseUs6W4zi2N