From 3e367f78eec3521106979461fda717926717515a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 08:42:53 +0900 Subject: fix(downloader): restore late binding in getLocalChanges/update paths PHP's FileDownloader::getLocalChanges and ::update call $this->download() / $this->install() / $this->remove() / $this->getInstallOperationAppendix(), which late-bind to the concrete downloader class. The Rust port embeds the parent as `inner`, so delegating these methods to FileDownloader pinned the calls to FileDownloader's own implementations: `status` built the compare tree without extracting the archive (flagging every file of dist-installed packages as changed), and `update` re-installed the raw dist file instead of extracting it. Thread the concrete downloader in as `this: &dyn DownloaderInterface` via shared helpers (base_get_local_changes / base_update) and pass `self` from each delegating downloader. Co-Authored-By: Claude Fable 5 --- crates/shirabe/src/downloader/xz_downloader.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/downloader/xz_downloader.rs') diff --git a/crates/shirabe/src/downloader/xz_downloader.rs b/crates/shirabe/src/downloader/xz_downloader.rs index d3defae5..2041c356 100644 --- a/crates/shirabe/src/downloader/xz_downloader.rs +++ b/crates/shirabe/src/downloader/xz_downloader.rs @@ -94,7 +94,7 @@ impl ChangeReportInterface for XzDownloader { package: PackageInterfaceHandle, path: &str, ) -> anyhow::Result> { - self.inner.get_local_changes(package, path) + self.inner.base_get_local_changes(self, package, path) } } @@ -145,7 +145,10 @@ impl crate::downloader::DownloaderInterface for XzDownloader { target: PackageInterfaceHandle, path: &str, ) -> anyhow::Result> { - self.inner.update(initial, target, path).await + let appendix = self.get_install_operation_appendix(target.clone(), path); + self.inner + .base_update(self, appendix, initial, target, path) + .await } async fn remove( -- cgit v1.3.1