Skip to main content

apply_package_patch

Function apply_package_patch 

Source
pub async fn apply_package_patch(
    package_key: &str,
    pkg_path: &Path,
    files: &HashMap<String, PatchFileInfo>,
    sources: &PatchSources<'_>,
    uuid: Option<&str>,
    dry_run: bool,
    force: bool,
) -> ApplyResult
Expand description

Verify and apply patches for a single package.

For each file in files, this function:

  1. Verifies the file is ready to be patched (or already patched).
  2. If not dry_run, tries patch sources in order: package archive → diff archive → per-file blob. Each strategy is opt-in via sources.
  3. Returns a summary of what happened.

uuid is the patch UUID. Pass Some to enable package- and diff-archive lookup (the corresponding sources.packages_path / sources.diffs_path must also be set). Pass None to restrict the pipeline to per-file blobs only — equivalent to pre-2.2 behavior.