Documentation ¶
Overview ¶
Copyright (C) 2023 by Posit Software, PBC
Copyright (C) 2023 by Posit Software, PBC
Index ¶
Constants ¶
const ( DescriptionRepository = "Repository: RSPM" DescriptionEncoding = "Encoding: %s" )
Variables ¶
This section is empty.
Functions ¶
func PreferredReadme ¶
Types ¶
type RPackageArchive ¶
type RPackageArchive struct {
// contains filtered or unexported fields
}
RPackageArchive supports rewriting .tar.gz source packages and binaries in a single data stream while (a) calculating the source and destination SHA256 checksums, (b) calculating the source and destination file sizes, (c) rewriting the `DESCRIPTION` file to include the correct `Repository` field, and (d) rewriting the `MD5` file with any corrections required for the updated DESCRIPTION.
IMPORTANT: If you make improvements to `RPackageArchive`, please also update `RPackageZipArchive` in `archive_zip.go`. We decided to maintain the code separately since there are some substantial differences in reading ZIP vs. TAR archives.
func NewRPackageArchive ¶
func NewRPackageArchive(bufferSize, gzipLevel int) *RPackageArchive
func (*RPackageArchive) RewriteBinary ¶
func (*RPackageArchive) RewriteWithReadme ¶
type RPackageZipArchive ¶
type RPackageZipArchive struct {
// contains filtered or unexported fields
}
RPackageZipArchive is very similar to RPackageArchive (see `archive.go`). However, ZIP reading requires random access (io.ReaderAt), so we had to create a separate util. Instead of passing a stream as `r`, instead save the ZIP archive to a temporary file and then pass an `*os.File` as `r`. The file will be scanned twice: once to calculate the original checksum and size, and once to rewrite to the destination.
IMPORTANT: If you make improvements to `RPackageZipArchive`, please also update `RPackageArchive` in `archive.go`.
func NewRPackageZipArchive ¶
func NewRPackageZipArchive(bufferSize int) *RPackageZipArchive