Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When patching files, my git apply
fails when trying this patch: http://drupal.org/files/nodes-are-imported-as-language-neutral-1247536-7...
That means that drush make
will use secondary patch applying command patch -p0
, but when using that, it doesn't use those two patching levels (-p0 and -p1) as git apply
does.
I need to apply that patch with patch -p1
command, so I propose to loop the patch levels thru when using secondary patching command too.
diff --git commands/make/make.project.inc commands/make/make.project.inc
index 3640424..9df1257 100644
--- commands/make/make.project.inc
+++ commands/make/make.project.inc
@@ -177,9 +177,13 @@ class DrushMakeProject {
}
// In some rare cases, git will fail to apply a patch, fallback to using
- // the 'patch -p0' command.
+ // the 'patch' command.
if (!$patched) {
- $patched = drush_shell_exec("patch -p0 -d %s < %s", $project_directory, $filename);
+ foreach ($patch_levels as $patch_level) {
+ if ($patched = drush_shell_exec("patch %s -d %s < %s", $patch_level, $project_directory, $filename)) {
+ break;
+ }
+ }
}
if ($output = drush_shell_exec_output()) {
Comment | File | Size | Author |
---|---|---|---|
#1 | 1450374-1.patch | 789 bytes | iMiksu |
Comments
Comment #1
iMiksuPatch file added.
Comment #2
jhedstromCode looks good to me, will commit when I'm at a different computer.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedCommitted.