Skip to content

rename downloaded files when they do not mirror convention#732

Merged
aronatkins merged 1 commit intomainfrom
aron-issue-731
Jun 12, 2025
Merged

rename downloaded files when they do not mirror convention#732
aronatkins merged 1 commit intomainfrom
aron-issue-731

Conversation

@aronatkins
Copy link
Copy Markdown
Contributor

fixes #731

Copy link
Copy Markdown
Contributor

@toph-allen toph-allen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good. Does it need a test?

@aronatkins aronatkins force-pushed the aron-issue-731 branch 2 times, most recently from 0393b67 to 05be1ad Compare June 11, 2025 20:25
@aronatkins
Copy link
Copy Markdown
Contributor Author

The change looks good. Does it need a test?

Will exercise outside this PR.

Steps to recreate the problem:

rstudioapi::openProject("~/Desktop/r-universe-test", newSession = TRUE)

# Within the new RStudio session
writeLines(c("library(xgboost)"), "script.R")
options(
  repos = c(
    DMLC = "https://dmlc.r-universe.dev",
    CRAN = "https://cran.rstudio.com/"
  )
)
packrat::.snapshotImpl(
  project = ".",
  snapshot.sources = TRUE,
  fallback.ok = TRUE,
  verbose = TRUE,
  implicit.packrat.dependency = FALSE
)

Prior to the fix, this produces:

Adding these packages to packrat:
               _        
    Matrix       1.6-5  
    data.table   1.17.4 
    jsonlite     2.0.0  
    lattice      0.22-7 
    xgboost      3.0.2.1

Fetching sources for Matrix (1.6-5) ... OK (CRAN archived)
Fetching sources for data.table (1.17.4) ... OK (CRAN current)
Fetching sources for jsonlite (2.0.0) ... OK (CRAN current)
Fetching sources for lattice (0.22-7) ... OK (CRAN current)
Fetching sources for xgboost (3.0.2.1) ... FAILED
Error in snapshotSources(project, activeRepos(project), allRecordsFlat) : 
  Errors occurred when fetching source files:
Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) : 
  Could not find sources for xgboost (3.0.2.1).

After the fix:

Adding these packages to packrat:
               _        
    Matrix       1.6-5  
    data.table   1.17.4 
    jsonlite     2.0.0  
    lattice      0.22-7 
    xgboost      3.0.2.1

Fetching sources for Matrix (1.6-5) ... OK (CRAN archived)
Fetching sources for data.table (1.17.4) ... OK (CRAN current)
Fetching sources for jsonlite (2.0.0) ... OK (CRAN current)
Fetching sources for lattice (0.22-7) ... OK (CRAN current)
Fetching sources for xgboost (3.0.2.1) ... OK (https://dmlc.r-universe.dev current)
Snapshot written to '/Users/aron/Desktop/r-universe-test/packrat/packrat.lock'

@aronatkins aronatkins merged commit b44ff11 into main Jun 12, 2025
9 checks passed
@aronatkins aronatkins deleted the aron-issue-731 branch June 12, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

download.packages may not download the expected file name

2 participants