Skip to contents

Validate unpacked packets. Over time, expect this function to become more fully featured, validating more.

Usage

orderly_validate_archive(..., action = "inform", root = NULL, locate = TRUE)

Arguments

...

Either arguments that a search can be constructed from (useful options here include name = "something"), a character vector of ids, or leave empty to validate everything.

action

The action to take on finding an invalid packet. See Details.

root

The path to the root directory, or NULL (the default) to search for one from the current working directory if locate is TRUE. This function does not require that the directory is configured for orderly, and can be any outpack root (see orderly_init for details).

locate

Logical, indicating if the root should be searched for. If TRUE, then we looks in the directory given for root (or the working directory if NULL) and then up through its parents until it finds an .outpack directory or orderly_config.yml

Value

Invisibly, a character vector of repaired (or invalid) packets.

Details

The actions that we can take on finding an invalid packet are:

  • inform (the default): just print information about the problem

  • orphan: mark the packet as orphaned within the metadata, but do not touch the files in your archive (by default the directory archive/) - this is a safe option and will leave you in a consistent state without deleting anything.

  • delete: in addition to marking the packet as an orphan, also delete the files from your archive.

Later, we will add a "repair" option to try and fix broken packets.

The validation interacts with the option core.require_complete_tree; if this option is TRUE, then a packet is only valid if all its (recursive) dependencies are also valid, so the action will apply to packets that have also had their upstream dependencies invalidated. This validation will happen even if the query implied by ... does not include these packets if a complete tree is required.

The validation will also interact with core.use_file_store once repair is supported, as this becomes trivial.