prepare_install_target

Function prepare_install_target 

Source
pub fn prepare_install_target(
    conn: &DbConnection,
    name: &str,
    install_dir: &Path,
) -> Result<()>
Expand description

Validate the target install path and clear stale failed state if present.

This function enforces the database-level install preconditions before any download work begins. It rejects packages that are already installed, already installing, or currently updating. If the previous attempt failed, the stale package row is removed and the install directory is cleaned so the next attempt starts from a known-good state.