diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-09 18:41:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-09 18:41:49 +0900 |
| commit | 6d257691a39fb8c4191f4564ec6406d080dbf6b5 (patch) | |
| tree | 0e3749b2a35bb2a3afc0d72575024194417b2257 /crates/shirabe | |
| parent | 72cbecaec29cecc723ce29c87d10048114aeef5b (diff) | |
| download | php-shirabe-6d257691a39fb8c4191f4564ec6406d080dbf6b5.tar.gz php-shirabe-6d257691a39fb8c4191f4564ec6406d080dbf6b5.tar.zst php-shirabe-6d257691a39fb8c4191f4564ec6406d080dbf6b5.zip | |
feat(path-downloader): restrict a mirrored path package to its archivable files
PathDownloader builds an ArchivableFilesFinder and hands it to
Filesystem::mirror as the iterator that selects what to copy, so a path
package installed by mirroring drops what .gitattributes marks
export-ignore, what .gitignore excludes and the VCS directories. The
port dropped the argument, and mirrored the source tree whole.
Every method mirror() calls on the entries it walks is derived from the
pathname, so the iterator is modeled as a list of pathnames rather than
as a Traversable of SplFileInfo.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe')
| -rw-r--r-- | crates/shirabe/src/downloader/path_downloader.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/shirabe/src/downloader/path_downloader.rs b/crates/shirabe/src/downloader/path_downloader.rs index 076f313d..5fa69ec7 100644 --- a/crates/shirabe/src/downloader/path_downloader.rs +++ b/crates/shirabe/src/downloader/path_downloader.rs @@ -443,13 +443,14 @@ impl DownloaderInterface for PathDownloader { io_interface::NORMAL, ); } - let _iterator = ArchivableFilesFinder::new(&real_url, vec![], false)?; - // PHP: $symfonyFilesystem->mirror($realUrl, $path, $iterator); - // TODO(phase-c): Symfony Filesystem::mirror takes a Traversable iterator as its third - // argument, but the external-package Filesystem stub does not model the iterator type - // that ArchivableFilesFinder (an IteratorAggregate) would be wrapped into, so None is - // passed and the mirrored file list is not restricted. - symfony_filesystem.mirror(&real_url, &path)?; + let iterator = ArchivableFilesFinder::new(&real_url, vec![], false)?; + symfony_filesystem.mirror( + &real_url, + &path, + iterator + .map(|entry| entry.to_string_lossy().into_owned()) + .collect(), + )?; } if output { |
