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()) {
CommentFileSizeAuthor
#1 1450374-1.patch789 bytesiMiksu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iMiksu’s picture

FileSize
789 bytes

Patch file added.

jhedstrom’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good to me, will commit when I'm at a different computer.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.