How do I add a local patch file to the patches.make file?

Issue #30 new
Former user created an issue

I have a few patches that were created locally and added to the associated contrib module directory. When trying to add them to the patches.make file, then running "drush ps", i get an error when trying to use a relative URL for the patch location. (Eg. /sites/all/modules/contrib/...") versus one from D.O. Do all patch references need to be from D.O.?

Comments (1)

  1. Former user Account Deleted

    Placing your patches in the directory of the module you want to patch is a risk. With drush ps you can apply the patch, but you will loose the patch once the module is updated using drush dl or drush up.

    First of all, I encourage you to share your patches with the community by adding the to a related issue. No need to be ashamed of partial solutions of imperfect code ;) Further I advise you to keep local patches together, for example in a directory outside the drupal root (e.g. ../patches). When you place the patches.make file in that directory too, you have everything nicely documented in one place.

    If my_path.patch is a patch file placed in ../patches folder, then this is how in the patches.make file in that same directory would look like:

    api = 2
    core = 7.x
    projects[my_module][patch][] = "../patches/my_path.patch"
    

    Note that the path to the patch is relative to the drupal root.

  2. Log in to comment