Skip to contents

Prune orphan packets from your metadata store. This function can be used to remove references to packets that are no longer reachable; this could have happened because you deleted a packet manually from the archive and ran orderly_validate_archive or because you removed a location.

Usage

orderly_prune_orphans(root = NULL, locate = TRUE)

Arguments

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 orphaned packet ids

Details

If an orphan packet is not used anywhere, then we can easily drop it - it's as if it never existed. If it is referenced by metadata that you know about from elsewhere but not locally, then that is a problem for the upstream location (and one that should not happen). If you have referenced it in a packet that you have run locally, the the metadata is not deleted.

We expose this function mostly for users who want to expunge permanently any reference to previously run packets. We hope that there should never need to really be a reason to run it.