diff --git a/assets/symfony-fs-mirror.patch b/assets/symfony-fs-mirror.patch deleted file mode 100644 index d3b99ffc2..000000000 --- a/assets/symfony-fs-mirror.patch +++ /dev/null @@ -1,67 +0,0 @@ -From c5aaa3a3a6c83049dc31782a0cdfb6eba0151a6e Mon Sep 17 00:00:00 2001 -From: Dane Powell -Date: Fri, 27 Oct 2023 10:42:00 -0700 -Subject: [PATCH] Fix #14068: [Filesystem] mirror() does not work correctly - with custom iterators - ---- - src/Symfony/Component/Filesystem/Filesystem.php | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php -index 78458d5b91..20639b1a29 100644 ---- a/src/Symfony/Component/Filesystem/Filesystem.php -+++ b/src/Symfony/Component/Filesystem/Filesystem.php -@@ -519,18 +519,19 @@ class Filesystem - * - existing files in the target directory will be overwritten, except if they are newer (see the `override` option) - * - files in the target directory that do not exist in the source directory will not be deleted (see the `delete` option) - * -- * @param \Traversable|null $iterator Iterator that filters which files and directories to copy, if null a recursive iterator is created -+ * @param \Traversable|null $originIterator Iterator that filters which files and directories to copy, if null a recursive iterator is created - * @param array $options An array of boolean options - * Valid options are: - * - $options['override'] If true, target files newer than origin files are overwritten (see copy(), defaults to false) - * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink(), defaults to false) - * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) -+ * @param \Traversable|null $targetIterator Iterator that filters which files and directory in target directory to delete if not in source directory (if $options['delete'] is true) - * - * @return void - * - * @throws IOException When file type is unknown - */ -- public function mirror(string $originDir, string $targetDir, \Traversable $iterator = null, array $options = []) -+ public function mirror(string $originDir, string $targetDir, \Traversable $originIterator = null, array $options = [], \Traversable $targetIterator = null) - { - $targetDir = rtrim($targetDir, '/\\'); - $originDir = rtrim($originDir, '/\\'); -@@ -542,7 +543,7 @@ class Filesystem - - // Iterate in destination folder to remove obsolete entries - if ($this->exists($targetDir) && isset($options['delete']) && $options['delete']) { -- $deleteIterator = $iterator; -+ $deleteIterator = $targetIterator; - if (null === $deleteIterator) { - $flags = \FilesystemIterator::SKIP_DOTS; - $deleteIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($targetDir, $flags), \RecursiveIteratorIterator::CHILD_FIRST); -@@ -558,15 +559,15 @@ class Filesystem - - $copyOnWindows = $options['copy_on_windows'] ?? false; - -- if (null === $iterator) { -+ if (null === $originIterator) { - $flags = $copyOnWindows ? \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS : \FilesystemIterator::SKIP_DOTS; -- $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($originDir, $flags), \RecursiveIteratorIterator::SELF_FIRST); -+ $originIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($originDir, $flags), \RecursiveIteratorIterator::SELF_FIRST); - } - - $this->mkdir($targetDir); - $filesCreatedWhileMirroring = []; - -- foreach ($iterator as $file) { -+ foreach ($originIterator as $file) { - if ($file->getPathname() === $targetDir || $file->getRealPath() === $targetDir || isset($filesCreatedWhileMirroring[$file->getRealPath()])) { - continue; - } --- -2.42.0 - diff --git a/composer.json b/composer.json index 7da9b77ec..432b23363 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,6 @@ "bugsnag/bugsnag": "^3.0", "composer/semver": "^3.3", "consolidation/self-update": "^2.1.0", - "cweagans/composer-patches": "^1.7", "dflydev/dot-access-data": "^3", "grasmash/expander": "^3", "guzzlehttp/guzzle": "^7.4", @@ -96,7 +95,6 @@ "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, "phpstan/extension-installer": true, - "cweagans/composer-patches": true, "phpro/grumphp": true, "symfony/flex": true, "infection/extension-installer": true, @@ -106,14 +104,6 @@ "extra": { "branch-alias": { "dev-main": "2.x-dev" - }, - "patches": { - "symfony/filesystem": [ - "assets/symfony-fs-mirror.patch" - ] - }, - "patchLevel": { - "symfony/filesystem": "-p5" } }, "prefer-stable": true, diff --git a/composer.lock b/composer.lock index 5329893a3..ce772f6e5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "084a46f1a9cbc8ff0fab0281880b86a1", + "content-hash": "44d3340d715b4b51314cf67d01cf0832", "packages": [ { "name": "acquia/drupal-environment-detector", @@ -455,54 +455,6 @@ }, "time": "2023-03-18T01:37:41+00:00" }, - { - "name": "cweagans/composer-patches", - "version": "1.7.3", - "source": { - "type": "git", - "url": "https://github.com/cweagans/composer-patches.git", - "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", - "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3.0" - }, - "require-dev": { - "composer/composer": "~1.0 || ~2.0", - "phpunit/phpunit": "~4.6" - }, - "type": "composer-plugin", - "extra": { - "class": "cweagans\\Composer\\Patches" - }, - "autoload": { - "psr-4": { - "cweagans\\Composer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Cameron Eagans", - "email": "me@cweagans.net" - } - ], - "description": "Provides a way to patch Composer packages.", - "support": { - "issues": "https://github.com/cweagans/composer-patches/issues", - "source": "https://github.com/cweagans/composer-patches/tree/1.7.3" - }, - "time": "2022-12-20T22:53:13+00:00" - }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", diff --git a/src/Command/Push/PushArtifactCommand.php b/src/Command/Push/PushArtifactCommand.php index 6c03f1b6c..544ed196f 100644 --- a/src/Command/Push/PushArtifactCommand.php +++ b/src/Command/Push/PushArtifactCommand.php @@ -216,7 +216,8 @@ private function buildArtifact(Closure $outputCallback, string $artifactDir): vo ->ignoreVCSIgnored(TRUE); $targetFinder = $this->localMachineHelper->getFinder(); $targetFinder->in($artifactDir)->ignoreDotFiles(FALSE); - $this->localMachineHelper->getFilesystem()->mirror($this->dir, $artifactDir, $originFinder, ['override' => TRUE, 'delete' => TRUE], $targetFinder); + $this->localMachineHelper->getFilesystem()->remove($targetFinder); + $this->localMachineHelper->getFilesystem()->mirror($this->dir, $artifactDir, $originFinder, ['override' => TRUE]); $this->localMachineHelper->checkRequiredBinariesExist(['composer']); $outputCallback('out', 'Installing Composer production dependencies');