composer-patches
composer-patches copied to clipboard
Patch to drupal/core applied twice
Drupal core is in web/. After applying patch https://www.drupal.org/files/issues/2673628-17.patch (from https://www.drupal.org/node/2673628) the patch correctly applies but I'm getting also a duplicate file in web/core/b/core/modules/system/src/Tests/Update/CustomStorageEntityDefinitionUpdateTest.php. I suspect "b" comes from an incorrect usage of system patch command (missing probably the -p1?) but the patch is correctly applied, the file is also present in the right location.
Note that In my case the patch is applied, not from d.o, but from local filesystem.
Relevant composer.json lines:
...
"require": {
"composer/installers": "^1.0.20",
"cweagans/composer-patches": "~1.0",
...
"drupal/core": "8.1.7",
...
}
...
"extra": {
"installer-paths": {
"web/core": ["type:drupal-core"],
...
},
"patches": {
"drupal/core": {
...
"Ignore custom storage field definition removals/additions @see https://www.drupal.org/node/2673628": "patches/2673628-17.patch"
},
...
}
...
}
...
I am seeing duplication too, but in two places: 'web/core/b/core' and 'web/core/core'.
The following patch directive:
"patches": {
"drupal/core": {
"node/user reference fields": "https://www.drupal.org/files/issues/2447727-184.patch",
"audio/video file formatters": "https://www.drupal.org/files/issues/file_field_formatters-1174892-63.patch"
}
}
produces files in 'web/core/b/core/lib', 'web/core/b/core/modules', 'web/core/core/lib', 'web/core/core/modules'.
This stems from how the plugin tries to figure out the right -p value. I'm not really sure how to make this better, to be honest, but I'll explore some solutions for the 2.x branch.
You'll be able to specify patch depth per-patch in 2.0.0. See #93 for details on that release.
main allows you to specify depth on a per-patch basis now. I'll be adding the ability to specify a default per-package in the next day or two.