This function obsoletes a DataONE package with a newer version by merging the two version chains. The ideal use case for this function is when the only option to fix a broken package is by re-uploading a previous version and merging the two version chains. In other cases arcticdatautils::publish_update() should be used.

obsolete_package(mn, metadata_obsolete, metadata_new)

Arguments

mn

(MNode) The DataONE member node.

metadata_obsolete

(character) The metadata PID of the old, or broken, version. Any metadata PID from the obsolete version chain can be used - sets the PID to the end of the version chain.

metadata_new

(character) The metadata PID of the new version. Any metadata PID from the new version chain can be used - sets the PID to the beginning of the version chain.

Value

(logical) TRUE/FALSE

Examples

# NOT RUN {
cn <- dataone::CNode("STAGING")
mn <- dataone::getMNode(cn,"urn:node:mnTestARCTIC")

pkg_old <- arcticdatautils::create_dummy_package(mn)
pkg_new <- arcticdatautils::create_dummy_package(mn)

obsolete_package(mn, pkg_old$metadata, pkg_new$metadata)
# }