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

Closed
@jimhester

Description

@jimhester

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions