So I have the following in a make file:

projects[collapsiblock][subdir] = "contrib"
projects[collapsiblock][type] = "module"
projects[collapsiblock][download][type] = "git"
projects[collapsiblock][download][url] = "git://git.drupal.org/project/collapsiblock.git"
projects[collapsiblock][download][revision] = "dea20849fb7535bbe5f7227fb4f614873620f117"
projects[collapsiblock][patch][] = "http://drupal.org/files/issues/892340-11-Bringing-up-to-Drupal-7-no-prefix.patch"

Here's what I expect Drush make to do:

  1. Download the git repo specified.
  2. Try patching it with git, p1, fail
  3. Try patching it with git, p0, succeed

This is what happens with Drush 4 and Drush make 2, however with the new Drush 5 the third step there also fails. It fails because, for some reason, Drush decides that it's going to modify the info files after doing the git checkout, then because the patch touches the info files, it fails.

I'm not sure why Drush thinks it should start going around writing code when I've just asked it to download something?

So a possible solution would be to create a patch that applies to the Drush 5 make downloaded file, but then that patch wouldn't apply to the actual git repo, meaning that it's not useful to the module maintainer at all, and actually, not useful to the testbot either.

Is there a way to at least stop drush from writing code for me?

CommentFileSizeAuthor
#8 rewrite-after-pacthing-1528422-7.patch4.23 KBfabsor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Category: bug » support
Status: Active » Fixed

Use the --no-gitinfofile option.

We added that rewriting so that the cloned code works with Drupal's update status system.

jhedstrom’s picture

Status: Fixed » Active

Marked #1536328: Drush make fails to build a particular patch as a duplicate.

I'm re-opening because it occurs to me that while --no-gitinfofile is a valid workaround for local development, people cannot control that on d.o., and thus any distribution that needs to patch a .info file cannot be built.

My initial thoughts on resolving it are to keep the logic of what the .info file should contain where it is now, but do the actual re-writing after patches have been applied.

jhedstrom’s picture

Category: support » task
Steven Jones’s picture

Would it be better to invert that option so you have to opt in to having the code downloaded re-written automagically?

jhedstrom’s picture

Even if we were to invert the option, we'd still need to fix the patching since d.o. will leave that on for packaging.

One concern I have with making that opt-in is that the majority of people won't do so, and then unless they are building sites with git deploy (and even then, always deploying with the --working-copy flag), all modules pulled from git are stuck in an unknown version for people who aren't aware of the .make file (eg, site admins using the update interface).

jhedstrom’s picture

Letharion’s picture

#2 sounds like a good suggestion. It will preserve the idea of the added info, while still letting patches apply.

fabsor’s picture

Here is patch that moves the rewrite logic to MakeProject. While not ideal (it somewhat ties the makeproject class to the download method), it is the easiest way to go forward without doing a lot of rewriting.

fabsor’s picture

Status: Active » Needs review
jhedstrom’s picture

Status: Needs review » Fixed

Committed #8 (see 134990ea). I'm all for fixing this with a minimum of re-writing. Thanks fabsor!

jhedstrom’s picture

I committed a small follow-up fix that was missed in the initial review of this patch.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Add code tags.