Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pkgcache is likely too strict about trailing newlines when parsing PACKAGES files #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jimhester opened this issue Apr 24, 2023 · 0 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@jimhester
Copy link
Member

Artifactory generates PACKAGES files with the unfortunate combination of windows newlines an empty blank line at the end. The latter likely for compatibility with debian Packages files (RTFACT-12881). It seems unlikely that we could get Artifactory to change this behavior in a reasonable amount of time. If the PACKAGES file does not use windows newlines or if it does use windows newlines and there is not a blank line at the end the file is parsed as expected.

Unfortunately currently pkgcache does not parse these files with both windows newlines and a trailing blank line properly and after dd5a590 now throws errors in this case instead of a warning.

Would it be possible for pkgcache to handle this case?

You can reproduce the issue without needing access to an Artifactory instance with

lines <- readLines("http://cloud.r-project.org/src/contrib/PACKAGES")
writeLines(c(lines, ""), "PACKAGES", sep = "\r\n")
pkgcache::parse_packages("PACKAGES")
#> Error in pkgcache::parse_packages("PACKAGES") :
#>  PACKAGES file ended while parsing a key @lib.c:481 (pkgcache_parse_packages_raw)
@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants