aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/gzip_downloader.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-02 08:42:53 +0900
committernsfisis <nsfisis@gmail.com>2026-08-02 08:42:53 +0900
commit3e367f78eec3521106979461fda717926717515a (patch)
tree980141af2c614178ebe757df1f933c2070df8fdb /crates/shirabe/src/downloader/gzip_downloader.rs
parent0d62424c7067c49d5b7e7a599a7c64189511c2b4 (diff)
downloadphp-shirabe-3e367f78eec3521106979461fda717926717515a.tar.gz
php-shirabe-3e367f78eec3521106979461fda717926717515a.tar.zst
php-shirabe-3e367f78eec3521106979461fda717926717515a.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader/gzip_downloader.rs')
-rw-r--r--crates/shirabe/src/downloader/gzip_downloader.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/shirabe/src/downloader/gzip_downloader.rs b/crates/shirabe/src/downloader/gzip_downloader.rs
index 6b5f3872..70b9f7bb 100644
--- a/crates/shirabe/src/downloader/gzip_downloader.rs
+++ b/crates/shirabe/src/downloader/gzip_downloader.rs
@@ -146,7 +146,7 @@ impl ChangeReportInterface for GzipDownloader {
package: PackageInterfaceHandle,
path: &str,
) -> anyhow::Result<Option<String>> {
- self.inner.get_local_changes(package, path)
+ self.inner.base_get_local_changes(self, package, path)
}
}
@@ -197,7 +197,10 @@ impl crate::downloader::DownloaderInterface for GzipDownloader {
target: PackageInterfaceHandle,
path: &str,
) -> anyhow::Result<Option<PhpMixed>> {
- 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(