I have a makefile to build a custom site based off Pressflow. I have two core patches to Pressflow that I made that work and apply cleanly. However, I have a third patch that will not apply no matter what I do.
The makefile includes patches from our private server. 2 out of 3 apply, and each one was made using Git Tower, PHPStorm Git plugin, and git command line, with and without prefixes.
Here is a partial drush make dump:
* [@self.12] drealty-7.x-3.0-beta3 downloaded. [12.99 sec, 9.11 MB] [ok]
[notice]
* [@self.11] Project devel (7.x-1.2) downloaded to /private/tmp/make_tmp_1337871103_4fbe4aff277ea/__build__/sites/all/modules/devel. [13.07 sec, 9.25 MB] [success]
* [@self.11] Command dispatch complete [13.07 sec, 9.21 MB] [notice]
* [@self.11] Peak memory usage was 10.47 MB [13.07 sec, 9.21 MB] [memory]
* [@self.11] Load alias @self [13.07 sec, 9.21 MB] [notice]
* [@self.11] Project devel contains 3 modules: devel_generate, devel, devel_node_access.
* [@self.9 ] Bootstrap to phase 0. [13.12 sec, 8.79 MB] [bootstrap]
* [@self.12] can't find file to patch at input line 5 [notice]
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/sites/all/modules/drealty/drealty.install b/sites/all/modules/drealty/drealty.install
|index da46027b005fbfd4976739da5dbf888795c78245..d645b084fe70b65ee25ead9c4df256a7a21b49f6 100644
|--- a/sites/all/modules/drealty/drealty.install
|+++ b/sites/all/modules/drealty/drealty.install
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 18
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/sites/all/modules/drealty/drealty.module b/sites/all/modules/drealty/drealty.module
|index 574027c384c2d8171e02a089ba7a781bbfd98439..48d3466cb6f6ca6e0b34fc79d536f29b9195f4f9 100644
|--- a/sites/all/modules/drealty/drealty.module
|+++ b/sites/all/modules/drealty/drealty.module
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored [13.12 sec, 9.09 MB]
* [@self.12] Unable to patch drealty with phrets-4.patch. [13.13 sec, 12.82 MB]
Here is the patchfile:
diff --git a/sites/all/modules/drealty/drealty.install b/sites/all/modules/drealty/drealty.install
index da46027b005fbfd4976739da5dbf888795c78245..d645b084fe70b65ee25ead9c4df256a7a21b49f6 100644
--- a/sites/all/modules/drealty/drealty.install
+++ b/sites/all/modules/drealty/drealty.install
@@ -41,7 +41,7 @@ function drealty_requirements($phase) {
}
break;
case 'runtime':
- $file_exists = file_exists(libraries_get_path('phRets') . '/phRets.php');
+ $file_exists = file_exists(libraries_get_path('phrets') . '/phrets.php');
$requirements['drealty'] = array(
'title' => t('phRets library'),
'value' => t('!msg', array(
diff --git a/sites/all/modules/drealty/drealty.module b/sites/all/modules/drealty/drealty.module
index 574027c384c2d8171e02a089ba7a781bbfd98439..48d3466cb6f6ca6e0b34fc79d536f29b9195f4f9 100644
--- a/sites/all/modules/drealty/drealty.module
+++ b/sites/all/modules/drealty/drealty.module
@@ -290,8 +290,8 @@ function drealty_load_phrets() {
$static_cache = &drupal_static(__FUNCTION__);
if (!isset($static_cache)) {
- $path = libraries_get_path('phRets');
- $file = $path . '/phRets.php';
+ $path = libraries_get_path('phrets');
+ $file = $path . '/phrets.php';
if (file_exists($file)) {
if (include_once($file)) {
$static_cache = $file;
It sounds like from the debug dump that drush make tries to apply a patch to a file it cannot find. The outputs for the other patches are as follows:
Executing: wget -q --timeout=30 -O /private/tmp/download_file0kCDL6 http://ourdomain.com/aegir/patches/view_mode_support.patch
Calling is_readable(/private/tmp/download_file0kCDL6) [1.92 sec, 9.59 MB] [debug]
Calling is_writable(/tmp/make_tmp_1337871103_4fbe4aff277ea) [1.92 sec, 9.59 MB] [debug]
Calling rename(/private/tmp/download_file0kCDL6, /tmp/make_tmp_1337871103_4fbe4aff277ea/view_mode_support.patch) [1.93 sec, 9.59 MB] [debug]
Executing: cd /tmp/make_tmp_1337871103_4fbe4aff277ea/__build__ && GIT_WORK_TREE=. git apply --check -p1 /tmp/make_tmp_1337871103_4fbe4aff277ea/view_mode_support.patch --verbose
Checking patch modules/comment/comment.module...
Checking patch modules/node/node.module...
Checking patch modules/taxonomy/taxonomy.module...
Checking patch modules/user/user.module...
Executing: cd /tmp/make_tmp_1337871103_4fbe4aff277ea/__build__ && GIT_WORK_TREE=. git apply -p1 /tmp/make_tmp_1337871103_4fbe4aff277ea/view_mode_support.patch --verbose
Checking patch modules/comment/comment.module...
Checking patch modules/node/node.module...
Checking patch modules/taxonomy/taxonomy.module...
Checking patch modules/user/user.module...
Applied patch modules/comment/comment.module cleanly.
Applied patch modules/node/node.module cleanly.
Applied patch modules/taxonomy/taxonomy.module cleanly.
Applied patch modules/user/user.module cleanly.
Checking patch modules/comment/comment.module... [notice]
Checking patch modules/node/node.module...
Checking patch modules/taxonomy/taxonomy.module...
Checking patch modules/user/user.module...
Applied patch modules/comment/comment.module cleanly.
Applied patch modules/node/node.module cleanly.
Applied patch modules/taxonomy/taxonomy.module cleanly.
Applied patch modules/user/user.module cleanly. [1.94 sec, 9.59 MB]
Comments
Comment #1
kevinquillen commentedI gave up and had to use git type, git url, and revision instead of just module version and a patch url. Not sure what is going on, other contrib patches work..
Comment #2
erikwebb commentedThe problem you're seeing is the Drush Make does not support Git-style patch files.
Comment #3
sylus commentedHey erikwebb can you elaborate on Drush Make not supporting git style patch files? I'd like to have confirmation on this as I know many distro profiles are using git style patches for instance (line 75 for apps module for panopoly distro): http://drupalcode.org/project/panopoly.git/blob/refs/heads/7.x-1.x:/drup...
Populist is doing just that with many of his modules but I was wondering if drush make is different then how drupal.org packages and builds the make files. Also Drush Make does support git style patch files I thought as long as you specified the revision and git url etc. For example:
Will Fail:
projects[jquery_update][version] = 2.x-dev
projects[jquery_update][subdir] = contrib
projects[jquery_update][patch][1524944] = http://drupal.org/files/allow-different-version-for-admin-pages-1524944-...
projects[jquery_update][subdir] = contrib
Will Succeed:
projects[jquery_update][version] = 2.x-dev
projects[jquery_update][subdir] = contrib
projects[jquery_update][type] = module
projects[jquery_update][download][type] = git
projects[jquery_update][download][revision] = 5d2a4b2
projects[jquery_update][download][branch] = 7.x-2.x
projects[jquery_update][patch][1524944] = http://drupal.org/files/allow-different-version-for-admin-pages-1524944-...
Also did older versions of drush support git style patches, I have not noticed a problem in drush 5.1 and only recently saw patches not applying properly using git diff. Although Drush Make reported everything as success.
Comment #4
kevinquillen commentedYes. I have 3 patches, all created with git. Two work, one fails. Seems random. I created them with and without prefixes, from command line, Tower, and PHPStorm Git, the last one refuses to work for some reason.
Comment #5
sylus commentedYeah agreed it is super random. I have git style patches applied to the drupal project that apply perfectly, but all other git style patches don't apply. The only think I can think of how I am doing the build. Where I call drush make "some_url/distro.make" which contains:
api = 2
core = 7.x
projects[drupal][version] = 7.14
includes[] = https://some_url/webexp-core.make
; Add webexp to the full Drupal distro build
projects[webexp][type] = profile
projects[webexp][download][type] = git
projects[webexp][download][url] = http://some_url/sample.git
Where webexp-core.make successfully applies the following:
projects[drupal][type] = core
projects[drupal][version] = "7.14"
projects[drupal][patch][985814] = http://drupal.org/files/drupal-actions-985814-11-D7.patch
projects[drupal][patch][1558548] = http://drupal.org/files/drupal-1558548-3.patch
projects[drupal][patch][707484] = http://drupal.org/files/drupal-image_instance_checking-1559696-2.patch
However in the sample.git repository which when downloaded would call webexp.make thanks to drush make recursion no patches apply that are just using drupal version + project and a git style diff patch... All of them fail unless I use git download type + revision.
I wonder if it is because I initially downloaded the profile as download type git so can only ever apply using git revision + url and not drupal project + version. Definitely strange and inconsistent behavior though.
At least I think a fix it to just make every patch use git download url and revision instead of drupal project + version for inside my webexp.make file.
Comment #6
sylus commentedHey @kevinquillen could this be related?
http://drupal.org/node/1276872#comment-6190628
Comment #7
Anonymous (not verified) commentedI've run into this issue, but only if my patch file had the full path to the module from my project root. Patches apply fine, if the paths only contain the immediate file to be patched.
Examples (first line of the patch file):
Fails
diff --git a/modules/contrib/views_slideshow_galleria/views_slideshow_galleria.theme.inc b/modules/contrib/views_slideshow_galleria/views_slideshow_galleria.theme.incWorks
diff --git a/views_slideshow_galleria.theme.inc b/views_slideshow_galleria.theme.incComment #8
devkinetic commentedWhats the status of this issue? Is FilmKnerd's solution a fix? It sounds logical that the patch should be relative to the specific module directory it's executed from.
Comment #9
joestewart commentedWasn't this resolved in #745224: Apply patches from git diff and git format-patch ?
http://drupal.org/node/745224#comment-4779608
Comment #10
jhedstromRe #9 I thought this was resolved as well. Please update with examples if not.
Comment #11
mrfelton commentedCant apply the patches from http://drupal.org/node/1954912#comment-7434938 http://drupal.org/node/1954912#comment-7434928 or http://drupal.org/files/navbar-contrib-icons-1954912-9_0.patch
The problem seems to be related to the new binary files that the patch tried to add
eg
Comment #12
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.