archive.packages: Deal with old packages in your local repository

Description Usage Arguments Note See Also Examples

Description

Use this function to move older versions of a package to a specified archive directory, or remove them completely.

Usage

1
2
3
archive.packages(repo.root, to.dir = "Archive", keep = 1, package = NULL,
  type = "source", archive.root = repo.root, overwrite = FALSE,
  reallyDoIt = FALSE)

Arguments

repo.root

Path to the repository root, i.e., the directory which contains the src and bin directories. Usually this path should start with "file:///" except for Windows.

to.dir

Character string, name of the folder to move the old packages to.

keep

An integer value defining the maximum nuber of versions to keep. Setting this to 0 will completely remove all packages from the repository, which is probably only useful in combination with the option package.

package

A character vector with package names to check. If set, archive.packages will only take actions on these packages. If NULL, all packages are affected.

type

A character vector defining the package formats to keep. Valid entries are "source", "win.binary" and "mac.binary.leopard". By default, only the source packages are archived, all other packages are deleted.

archive.root

Path to the archive root, i.e., the directory to which files should be moved. Usually the Archive is kept i repo.root

overwrite

Logical, indicated whether existing files in the archive can be overwritten.

reallyDoIt

Logical, real actions are only taken if set to TRUE, otherwise the actions are only printed.

Note

This function responds to sandbox.

See Also

sandbox to run archive.packages() in a sandbox.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# dry run, only prints what would happen, so you can check
# if that's really what you want
archive.packages("file:///var/www/repo")

# after we've confirmed that the right packages will be moved
# and deleted, let's actually commit the changes
archive.packages("file:///var/www/repo", reallyDoIt=TRUE)

# if we don't want a standard archive, but for instance a parallel
# archive repository, we can have it. let's move all but the latest two
# versions from /var/www/repo to /var/www/archive. to suppress the
# creation of a special archive directory, we set to.dir=""
archive.packages("file:///var/www/repo", to.dir="", keep=2,
  type=c("source", "win.binary", "mac.binary.leopard"),
  archive.root="/var/www/archive", reallyDoIt=TRUE)

## End(Not run)

saurfang/roxyPackage documentation built on May 29, 2019, 3:20 p.m.