diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-31 20:00:58 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-31 20:02:23 +0900 |
| commit | dc15a0d66642244870abd839bc172388c08e96be (patch) | |
| tree | 05983d8f43af64df3dc997bf8816aacbfc996c27 | |
| parent | ccf4e921416780c3ff727482f0a65bc0bd574357 (diff) | |
| download | php-shirabe-dc15a0d66642244870abd839bc172388c08e96be.tar.gz php-shirabe-dc15a0d66642244870abd839bc172388c08e96be.tar.zst php-shirabe-dc15a0d66642244870abd839bc172388c08e96be.zip | |
feat(installer): downcast UpdateOperation in download/execute batches
| -rw-r--r-- | crates/shirabe/src/installer/installation_manager.rs | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs index 26fe84f..31cc23c 100644 --- a/crates/shirabe/src/installer/installation_manager.rs +++ b/crates/shirabe/src/installer/installation_manager.rs @@ -308,17 +308,13 @@ impl InstallationManager { let package: PackageInterfaceHandle; let initial_package: Option<PackageInterfaceHandle>; - // TODO(phase-b): downcast for UpdateOperation / Install/Mark/Uninstall variants - let update_op: Option<&UpdateOperation> = None; if op_type == "update" { // @var UpdateOperation $operation - if let Some(_u) = update_op { - // TODO(phase-c): bridge UpdateOperation handles (target/initial) into the - // &dyn PackageInterface that the installer APIs still expect. - continue; - } else { - continue; - } + let update_op = operation + .as_update_operation() + .expect("op_type == \"update\" implies UpdateOperation"); + package = update_op.get_target_package(); + initial_package = Some(update_op.get_initial_package()); } else { // @var InstallOperation|MarkAliasInstalledOperation|MarkAliasUninstalledOperation|UninstallOperation $operation package = operation.get_package(); @@ -451,15 +447,12 @@ impl InstallationManager { let package: PackageInterfaceHandle; let initial_package: Option<PackageInterfaceHandle>; - let update_op: Option<&UpdateOperation> = None; if op_type == "update" { - if let Some(_u) = update_op { - // TODO(phase-c): bridge UpdateOperation handles (target/initial) into the - // &dyn PackageInterface that the installer APIs still expect. - continue; - } else { - continue; - } + let update_op = operation + .as_update_operation() + .expect("op_type == \"update\" implies UpdateOperation"); + package = update_op.get_target_package(); + initial_package = Some(update_op.get_initial_package()); } else { package = operation.get_package(); initial_package = None; |
