Title: | Tools for 'CRAN'-Like Repositories |
---|---|
Description: | A set of functions to manage 'CRAN'-like repositories efficiently. |
Authors: | Gábor Csárdi |
Maintainer: | Gábor Csárdi <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.3.9000 |
Built: | 2025-02-09 04:44:55 UTC |
Source: | https://github.com/r-hub/cranlike |
The files must exist in the directory. If the package database does not exist, then it will be created.
add_PACKAGES(files, dir = ".", fields = NULL, xcolumns = NULL)
add_PACKAGES(files, dir = ".", fields = NULL, xcolumns = NULL)
files |
Files to add, only the file names, without the path.
You can use |
dir |
Package directory. |
fields |
Fields to use in the database if the database is created. |
xcolumns |
Extra scalar columns to add to the database.
Should be a named list of character scalars or |
Other PACKAGES manipulation:
remove_PACKAGES()
,
update_PACKAGES()
A set of functions to manage CRAN-like repositories efficiently.
Useful links:
Create an empty package database if it does not exist. It also updates the PACKAGES* files from the new (empty) database.
create_empty_PACKAGES(dir = ".", fields = NULL, xcolumns = NULL)
create_empty_PACKAGES(dir = ".", fields = NULL, xcolumns = NULL)
dir |
Character vector describing the location of the repository (directory including source or binary packages) to generate the ‘PACKAGES’, ‘PACKAGES.gz’ and ‘PACKAGES.rds’ files from and write them to. |
fields |
a character vector giving the fields to be used in the
‘PACKAGES’, ‘PACKAGES.gz’ and ‘PACKAGES.rds’ files in
addition to the default ones, or The default corresponds to
the fields needed by |
xcolumns |
Extra scalar columns to add to the database.
Should be a named list of character scalars or |
List all packages and versions in a CRAN-like repository
package_versions(dir = ".", xcolumns = character())
package_versions(dir = ".", xcolumns = character())
dir |
Path to the repository. |
xcolumns |
Extra columns to include in the result. |
Data frame with at least three columns:
Package
, Version
, MD5sum
.
The files will be first removed from the database, and then from the directory.
remove_PACKAGES(files, dir = ".")
remove_PACKAGES(files, dir = ".")
files |
Files to remove. They must still exist at the time this function is called. |
dir |
Package directory. |
Other PACKAGES manipulation:
add_PACKAGES()
,
update_PACKAGES()
This function is similar to tools::write_PACKAGES()
, with some
differences:
It always uses the MD5sum
field.
It defaults to addFiles = TRUE
, to allow following the package
files better.
It does not support the verbose
, unpacked
, and subdirs
arguments currently.
It uses a database to speed up the indexing process, and only reindexes files that have added, removed or updated.
update_PACKAGES( dir = ".", fields = NULL, type = c("source", "mac.binary", "win.binary"), xcolumns = NULL )
update_PACKAGES( dir = ".", fields = NULL, type = c("source", "mac.binary", "win.binary"), xcolumns = NULL )
dir |
Character vector describing the location of the repository (directory including source or binary packages) to generate the ‘PACKAGES’, ‘PACKAGES.gz’ and ‘PACKAGES.rds’ files from and write them to. |
fields |
a character vector giving the fields to be used in the
‘PACKAGES’, ‘PACKAGES.gz’ and ‘PACKAGES.rds’ files in
addition to the default ones, or The default corresponds to
the fields needed by |
type |
Type of packages: currently source ‘.tar.{gz,bz2,xz}’ archives,
and macOS or Windows binary (‘.tgz’ or ‘.zip’,
respectively) packages are supported. Defaults to
|
xcolumns |
Extra scalar columns to add to the database.
Should be a named list of character scalars or |
update_PACKAGES
uses a SQLite database to aid updating PACKAGES*
files quickly. It this database does not exist, then it will be created
based on the existing PACKAGES* files. If no PACKAGES* files exist,
either, then these will be created via tools::write_PACKAGES()
.
Other PACKAGES manipulation:
add_PACKAGES()
,
remove_PACKAGES()