diff --git a/composer.lock b/composer.lock index 744c7e9a9ea81678fedbcf0e7c864de1deabad3f..afa2d6a3f8b17a537113a3628765e38b12841d2f 100644 --- a/composer.lock +++ b/composer.lock @@ -999,16 +999,16 @@ }, { "name": "cweagans/composer-patches", - "version": "1.7.0", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/cweagans/composer-patches.git", - "reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf" + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/ae02121445ad75f4eaff800cc532b5e6233e2ddf", - "reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", "shasum": "" }, "require": { @@ -1041,9 +1041,9 @@ "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.0" + "source": "https://github.com/cweagans/composer-patches/tree/1.7.3" }, - "time": "2020-09-30T17:56:20+00:00" + "time": "2022-12-20T22:53:13+00:00" }, { "name": "desandro/imagesloaded", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index b7bedf7319506f572d15243e09b5f751af352fc2..420140cb9cb0c0d3fc42c011f31cd18cea0a981c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1033,17 +1033,17 @@ }, { "name": "cweagans/composer-patches", - "version": "1.7.0", - "version_normalized": "1.7.0.0", + "version": "1.7.3", + "version_normalized": "1.7.3.0", "source": { "type": "git", "url": "https://github.com/cweagans/composer-patches.git", - "reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf" + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/ae02121445ad75f4eaff800cc532b5e6233e2ddf", - "reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", "shasum": "" }, "require": { @@ -1054,7 +1054,7 @@ "composer/composer": "~1.0 || ~2.0", "phpunit/phpunit": "~4.6" }, - "time": "2020-09-30T17:56:20+00:00", + "time": "2022-12-20T22:53:13+00:00", "type": "composer-plugin", "extra": { "class": "cweagans\\Composer\\Patches" @@ -1076,6 +1076,10 @@ } ], "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" + }, "install-path": "../cweagans/composer-patches" }, { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 10d2bfc948a14e24489771a2839e306375df5868..3ad5de65189cabec3cad17a448f7cec4d9e314a3 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'osu-asc-webservices/d8-upstream', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'a904cf0b71d032fda01c19c17f414e5c60475b28', + 'reference' => 'd72c4eac4e1624bb6b3dfbe90b06be607985b300', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -155,9 +155,9 @@ 'dev_requirement' => false, ), 'cweagans/composer-patches' => array( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', - 'reference' => 'ae02121445ad75f4eaff800cc532b5e6233e2ddf', + 'pretty_version' => '1.7.3', + 'version' => '1.7.3.0', + 'reference' => 'e190d4466fe2b103a55467dfa83fc2fecfcaf2db', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../cweagans/composer-patches', 'aliases' => array(), @@ -1615,7 +1615,7 @@ 'osu-asc-webservices/d8-upstream' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'a904cf0b71d032fda01c19c17f414e5c60475b28', + 'reference' => 'd72c4eac4e1624bb6b3dfbe90b06be607985b300', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/vendor/cweagans/composer-patches/README.md b/vendor/cweagans/composer-patches/README.md index 972694028def52240b512b43ff3be52bda1a91da..87f9dc0c7482798dfd49fbf76df4d578ee1e8d52 100644 --- a/vendor/cweagans/composer-patches/README.md +++ b/vendor/cweagans/composer-patches/README.md @@ -166,6 +166,33 @@ To enforce throwing an error and stopping package installation/update immediatel By default, failed patches are skipped. +## Patches reporting + +When a patch is applied, the plugin writes a report-file `PATCHES.txt` to a patching directory (e.g. `./patch-me/PATCHES.txt`), +which contains a list of applied patches. + +If you want to avoid this behavior, add a specific key to the `extra` section: +```json +"extra": { + "composer-patches-skip-reporting": true +} +``` + +Or provide an environment variable `COMPOSER_PATCHES_SKIP_REPORTING` with a config. + +## Patching composer.json in dependencies + +This doesn't work like you'd want. By the time you're running `composer install`, +the metadata from your dependencies' composer.json has already been aggregated by +packagist (or whatever metadata repo you're using). Unfortunately, this means that +you cannot e.g. patch a dependency to be compatible with an earlier version of PHP +or change the framework version that a plugin depends on. + +@anotherjames over at @computerminds wrote an article about how to work around +that particular problem for a Drupal 8 -> Drupal 9 upgrade: + +[Apply Drupal 9 compatibility patches with Composer](https://www.computerminds.co.uk/articles/apply-drupal-9-compatibility-patches-composer) ([archive](https://web.archive.org/web/20210124171010/https://www.computerminds.co.uk/articles/apply-drupal-9-compatibility-patches-composer)) + ## Difference between this and netresearch/composer-patches-plugin - This plugin is much more simple to use and maintain diff --git a/vendor/cweagans/composer-patches/src/Patches.php b/vendor/cweagans/composer-patches/src/Patches.php index 0e36c7ff356a43f8c1035c8a79b15f47aff3cbc0..3d7d864a2eb93d3649a9543d1476402db9fee286 100644 --- a/vendor/cweagans/composer-patches/src/Patches.php +++ b/vendor/cweagans/composer-patches/src/Patches.php @@ -48,6 +48,11 @@ class Patches implements PluginInterface, EventSubscriberInterface { */ protected $patches; + /** + * @var array $installedPatches + */ + protected $installedPatches; + /** * Apply plugin modifications to composer * @@ -124,6 +129,7 @@ public function checkPatches(Event $event) { } // Remove packages for which the patch set has changed. + $promises = array(); foreach ($packages as $package) { if (!($package instanceof AliasPackage)) { $package_name = $package->getName(); @@ -135,10 +141,14 @@ public function checkPatches(Event $event) { || ($has_patches && $has_applied_patches && $tmp_patches[$package_name] !== $extra['patches_applied'])) { $uninstallOperation = new UninstallOperation($package, 'Removing package so it can be re-installed and re-patched.'); $this->io->write('<info>Removing package ' . $package_name . ' so that it can be re-installed and re-patched.</info>'); - $installationManager->uninstall($localRepository, $uninstallOperation); + $promises[] = $installationManager->uninstall($localRepository, $uninstallOperation); } } } + $promises = array_filter($promises); + if ($promises) { + $this->composer->getLoop()->wait($promises); + } } // If the Locker isn't available, then we don't need to do this. // It's the first time packages have been installed. @@ -278,6 +288,7 @@ public function postInstall(PackageEvent $event) { // Check if we should exit in failure. $extra = $this->composer->getPackage()->getExtra(); $exitOnFailure = getenv('COMPOSER_EXIT_ON_PATCH_FAILURE') || !empty($extra['composer-exit-on-patch-failure']); + $skipReporting = getenv('COMPOSER_PATCHES_SKIP_REPORTING') || !empty($extra['composer-patches-skip-reporting']); // Get the package object for the current operation. $operation = $event->getOperation(); @@ -324,7 +335,10 @@ public function postInstall(PackageEvent $event) { $localPackage->setExtra($extra); $this->io->write(''); - $this->writePatchReport($this->patches[$package_name], $install_path); + + if (true !== $skipReporting) { + $this->writePatchReport($this->patches[$package_name], $install_path); + } } /** @@ -555,6 +569,19 @@ protected function applyPatchWithGit($install_path, $patch_levels, $filename) { return $patched; } + /** + * Indicates if a package has been patched. + * + * @param \Composer\Package\PackageInterface $package + * The package to check. + * + * @return bool + * TRUE if the package has been patched. + */ + public static function isPackagePatched(PackageInterface $package) { + return array_key_exists('patches_applied', $package->getExtra()); + } + /** * {@inheritDoc} */